-
Notifications
You must be signed in to change notification settings - Fork 513
Labels
bugSomething isn't workingSomething isn't working
Description
If I create a tool like this:
[McpServerToolType]
public class EchoTool
{
[McpServerTool(Name = "echo", UseStructuredContent = true), Description("Echoes the message back to the client.")]
public static string Echo(string message) => $"Echo: {message}";
}
Then the response violates the spec in terms of the plain TextContent matching the StructuredContent:
{
"content": [
{
"type": "text",
"text": "Echo: Test"
}
],
"structuredContent": {
"result": "Echo: Test"
}
}
The text
property should be the stringified version of the structuredContent object, as per
https://modelcontextprotocol.io/specification/2025-06-18/server/tools#structured-content
Note that if UseStructuredContent
is not set in the attribute, this does not happen (as only plain text is returned), nor is there a discrepancy for object types, json nodes, etc.
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working