-
Notifications
You must be signed in to change notification settings - Fork 143
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Given that CallToolResult.content
is a List<PromptMessageContent>
, I'd expect structuredContent
to be a JsonArray
, but it's a JsonObject
.
I can wrap the results in an object with something like
CallToolResult(
content = jsonResult.toPromptMessageContent(), // Converts array to list of TextContent
structuredContent = buildJsonObject { put("results", jsonResult) }
)
However, when using the MCP Inspector, I get this warning:
⚠ No text block matches structured content
Which makes me think this implementation might be incompatible with some clients. A workaround can be:
val wrapperResult = buildJsonObject { put("results", jsonResult) }
CallToolResult(
content = listOf(TextContent(wrapperResult.toString())),
structuredContent = wrapperResult
)
But passing a single item to content
doesn't look optimal.
Is this the recommended approach or am I missing something? Thank you!
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request