Commit e426bee
committed
fix(deploy/cf): pass through string returns as raw text in tools/call
The Worker template wrapped every result in `JSON.stringify(...)`, so a
photon method returning a Markdown string came back to clients as a
JSON-quoted string with escaped newlines instead of renderable Markdown.
The `read` tool on the deployed `web-lite` was unusable from clients that
expect plain text in `content[0].text`.
Pass strings through verbatim and only stringify non-string returns.
Surface objects via `structuredContent` per the MCP convention so clients
that prefer the JSON shape still get it.1 parent fdedd67 commit e426bee
1 file changed
Lines changed: 9 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
63 | 70 | | |
64 | 71 | | |
65 | 72 | | |
66 | 73 | | |
67 | | - | |
| 74 | + | |
| 75 | + | |
68 | 76 | | |
69 | 77 | | |
70 | 78 | | |
| |||
0 commit comments