client: Prefer structuredContent in toolJSON #14

Merged
linus merged 1 commits from client/tooljson-structured into develop 2026-09-04 23:45:26 -05:00
Collaborator

What

Prefer CallToolResult.StructuredContent in client.toolJSON (marshal → json.RawMessage) before falling back to TextContent JSON.

Why

On CT113, paper make once fails with historicals: mcp get_equity_historicals: non-json tool result even though auth and quotes/accounts work. Robinhood may return structured historicals with empty/non-JSON text; toolJSON previously ignored StructuredContent (SEP-2106 / go-sdk v1.7.0).

Test

  • go test ./... green (new TestToolJSON: structured-only, text JSON, text non-JSON + structured, empty; plus nil / GetError / non-JSON text)
  • Existing equity TestHistoricals_rhntest still passes; no envelope widen

Issue: #13

Do not merge until Remy re-proves after deploy (paper only).

## What Prefer `CallToolResult.StructuredContent` in `client.toolJSON` (marshal → `json.RawMessage`) before falling back to TextContent JSON. ## Why On CT113, paper `make once` fails with `historicals: mcp get_equity_historicals: non-json tool result` even though auth and quotes/accounts work. Robinhood may return structured historicals with empty/non-JSON text; `toolJSON` previously ignored StructuredContent (SEP-2106 / go-sdk v1.7.0). ## Test - `go test ./...` green (new `TestToolJSON`: structured-only, text JSON, text non-JSON + structured, empty; plus nil / GetError / non-JSON text) - Existing equity `TestHistoricals_rhntest` still passes; no envelope widen Issue: https://git.s1d3sw1ped.com/s1d3sw1ped/robinhood-agentic-mcp/issues/13 Do not merge until Remy re-proves after deploy (paper only).
ash added 1 commit 2026-09-04 23:40:55 -05:00
client: Prefer structuredContent in toolJSON
CI / Test and build (pull_request) Successful in 12s
bc50f3fd6b
get_equity_historicals can return MCP StructuredContent with empty or
non-JSON TextContent. Prefer StructuredContent (marshal to RawMessage)
so paper tradey once/run can parse historicals.

#13
ash requested review from linus 2026-09-04 23:41:01 -05:00
ash self-assigned this 2026-09-04 23:41:01 -05:00
linus merged commit 11feaad0e3 into develop 2026-09-04 23:45:26 -05:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: s1d3sw1ped/robinhood-agentic-mcp#14