Skip to content

Declare typed output schemas and spill large payloads to resource links - #103

Merged
rajeeja merged 3 commits into
mainfrom
rajeeja/mcp-typed-results
Aug 8, 2026
Merged

Declare typed output schemas and spill large payloads to resource links#103
rajeeja merged 3 commits into
mainfrom
rajeeja/mcp-typed-results

Conversation

@rajeeja

@rajeeja rajeeja commented Aug 8, 2026

Copy link
Copy Markdown
Collaborator

Compiles MCP outputSchema for every published tool directly from the existing _CONTRACTS table in response_contract.py, so the advertised result shape is generated from the same source as the prose contract and cannot drift from it. Adds resource-link helpers so a payload above the inline budget is handed back as a URI instead of being inlined, and advertises a tools/list cache TTL so clients stop re-fetching the tool list every turn. Depends on the adapter support in Oaklight/toolregistry-server#57, which is still open, so this cannot merge until that lands and is released.

rajeeja added 3 commits August 7, 2026 20:55
Compile MCP outputSchema for each published tool directly from the existing
response-contract table so the advertised shape cannot drift from the prose,
and add resource-link helpers that hand back a URI when a payload exceeds the
inline budget. Also advertise a tools/list cache TTL so clients stop
re-fetching the tool list on every turn.
Pass the tools/list cache hints only when the installed adapter accepts them
and skip the two route-table assertions when it cannot forward output schemas,
so the server still starts and the suite still passes against the released
adapter. Schema compilation itself is unconditional, so the declarations light
up as soon as the adapter support ships.
Exercising the typed-result work through a real client session, rather
than through the helpers alone, turned up three faults.

Spilling a large PNG to the artifact store left no bytes to inline, but
both plot paths still built an ImageContent from the missing payload and
failed validation. Large figures now return the resource_link the spill
already wrote, and the multi-stage summary carries the URI through
instead of reporting no image. The meshes big enough to spill were
exactly the ones that could not be plotted.

Every contract-derived schema requires an operation field that no result
actually set, so contracted replies failed their own published contract.
attach_provenance now names the operation for contracted families only.

The analysis envelope was bound to analyze_dataset, which returns a
stage summary and no result_type; calling it made the server reject its
own structured content. The envelope belongs to run_analysis.

Each fault has a regression test that fails without its fix.
@rajeeja
rajeeja merged commit 85ccc39 into main Aug 8, 2026
7 checks passed
@rajeeja
rajeeja deleted the rajeeja/mcp-typed-results branch August 8, 2026 23:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant