Hey! Quick questions about Koog 0.7.3, Kotlinx-sch...
# koog-agentic-framework
d
Hey! Quick questions about Koog 0.7.3, Kotlinx-schema 0.4.3 and MCP 0.8.1: 1. I migrated from Xemantic to Kotlinx-schema for my tool schema generation. It appears that Kotlinx-schema generates
[type, "null"]
for nullable primitive values. But then Koog's
McpToolDefinitionParser
crashes on the array with
Element class kotlinx.serialization.json.JsonArray is not a JsonPrimitive
(full stack-trace in thread). Is it a known problem or a misuse of Kotlinx-schema on my part? 2. Koog 0.7.3 uses the MCP SDK version 0.8.1. But the MCP SDK at version 0.11.0. What's the versioning policy on Koog's side w.r.t. the MCP SDK? Does Koog uses the lowest compatible version, meaning that might be safe for me to bump to 0.11.0? (I need
defs
support in ToolSchema...)
The stack trace for the first question:
Copy code
java.lang.IllegalArgumentException: Element class kotlinx.serialization.json.JsonArray is not a JsonPrimitive
	at kotlinx.serialization.json.JsonElementKt.error(JsonElement.kt:320)
	at kotlinx.serialization.json.JsonElementKt.getJsonPrimitive(JsonElement.kt:224)
	at ai.koog.agents.mcp.DefaultMcpToolDescriptorParser.parseParameterType(McpToolDefinitionParser.kt:69)
	at ai.koog.agents.mcp.DefaultMcpToolDescriptorParser.parseParameterType$default(McpToolDefinitionParser.kt:60)
	at ai.koog.agents.mcp.DefaultMcpToolDescriptorParser.parseParameters(McpToolDefinitionParser.kt:205)
	at ai.koog.agents.mcp.DefaultMcpToolDescriptorParser.parse(McpToolDefinitionParser.kt:46)
The input tool schema being:
Copy code
ToolSchema(properties={"query":{"type":"string"},"maxResults":{"type":["integer","null"]},"region":{"$ref":"#/$defs/io.github.ptitjes.konvo.mcp.web.DuckDuckGoEngine.Region"},"timeFrame":{"$ref":"#/$defs/io.github.ptitjes.konvo.mcp.web.DuckDuckGoEngine.TimeFrame"}}, required=[query])
k
Hi, Didier 1. It looks looks like Koog/kotlinx-schema integration issue to me. Thank tou for reproducer 2. MCP 0.11 was released last Tuesday and it’s time for Koog to upgrade and it’s planned. Ktor versions are now aligned. Hopefully it will happen in 0.7.4. You may try upgrading mcp to 0.11 but has not been verified.
❤️ 1
BTW, there is a dedicated channel now for schema-specific discussion #C0AN6QM3H16
👀 1