client: Honor IsError and extract JSON from tool text #16
Reference in New Issue
Block a user
Delete Branch "client/tooljson-iserror"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What
Honor
CallToolResult.IsErroron the client and harden TextContent JSON extraction intoolJSON.IsErroris set, surface TextContent as the tool error (notnon-json tool result).GetError()stays for the server/SetError path but is always nil on clients (go-sdk v1.7.0).StructuredContentwhen present (keep #14).{…}/[…](string/escape-aware).Why
CT113 tip
11feaad(#14) still fails:historicals: mcp get_equity_historicals: non-json tool result. StructuredContent prefer did not clear the live path → StructuredContent likely nil; TextContent non-JSON or IsError soft-fail that looked like non-json becauseGetError()is never set on clients.Test
go test ./...greentool error, wrapped JSON in prose, one-of-many text JSON, array / brace-in-string extract, non-JSON with shape hintIssue: #15
Do not merge until Remy re-proves after deploy (paper only). Out of scope: live/place, knobs, lab SSH / CT113 from this PR.