Skip to content

fix(mcp): return structured compact results#1043

Open
WarGloom wants to merge 2 commits into
DeusData:mainfrom
WarGloom:agent/fix-mcp-structured-content
Open

fix(mcp): return structured compact results#1043
WarGloom wants to merge 2 commits into
DeusData:mainfrom
WarGloom:agent/fix-mcp-structured-content

Conversation

@WarGloom

Copy link
Copy Markdown

What does this PR do?

Every MCP tool advertises an object outputSchema, but compact TOON and
plain-text results omitted structuredContent. Strict MCP clients therefore
rejected otherwise successful tool calls with -32600.

This change keeps JSON-object results unchanged and adds an object for every
other result:

  • successful text and TOON payloads use {"text":"..."}
  • error text uses {"error":"..."}

The existing text content block remains for model visibility and backwards
compatibility.

Validation

  • ASAN_OPTIONS=detect_leaks=0 make -f Makefile.cbm test — 6,009 passed,
    1 skipped
  • make -f Makefile.cbm lint-ci
  • wire-level coverage for compact search_graph responses plus unit coverage
    for plain-text and error results

Checklist

  • Every commit is signed off (git commit -s) — required, CI rejects
    unsigned commits (DCO, see CONTRIBUTING.md)
  • Tests pass locally (make -f Makefile.cbm test)
  • Lint passes (make -f Makefile.cbm lint-ci)
  • New behavior is covered by a test (reproduce-first for bug fixes)

WarGloom added 2 commits July 12, 2026 13:55
Tools advertise an object outputSchema, so strict MCP clients reject compact TOON responses that omit structuredContent.

Signed-off-by: wargloom <wargloom@gmail.com>
@WarGloom WarGloom marked this pull request as ready for review July 12, 2026 18:24
@WarGloom WarGloom requested a review from DeusData as a code owner July 12, 2026 18:24
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