mcp: correct the JSON used for unstructured content
Recently, I refactored to fix validation and default application for structured output. However, I used the wrong byte slice for the unstructured output. Fix it to use the same bytes as structured output, with a test. Fixes #475
This commit is contained in:
parent
22f86c4dfd
commit
a3e753b8d8
1 changed files with 32 additions and 3 deletions
|
|
@ -292,7 +292,7 @@ func toolForErr[In, Out any](t *Tool, h ToolHandlerFor[In, Out]) (*Tool, ToolHan
|
|||
// https://modelcontextprotocol.io/specification/2025-06-18/server/tools#structured-content.
|
||||
if res.Content == nil {
|
||||
res.Content = []Content{&TextContent{
|
||||
Text: string(outbytes),
|
||||
Text: string(outJSON),
|
||||
}}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue