Skip to content

Fix MCP structuredContent array rejection in routes tool#113

Merged
renardeinside merged 5 commits intomainfrom
fixes/post-release
Feb 21, 2026
Merged

Fix MCP structuredContent array rejection in routes tool#113
renardeinside merged 5 commits intomainfrom
fixes/post-release

Conversation

@renardeinside
Copy link
Copy Markdown
Collaborator

Summary

  • MCP spec requires structuredContent to be a JSON object (record), but the routes tool returned a serialized Vec<RouteInfo> which produces a JSON array
  • Wraps array values in {"items": [...]} inside from_serializable so all tool results comply with the protocol
  • Adds regression test from_serializable_vec_wraps_in_object

Test plan

  • New test reproduces the exact error (expected record, received array) and passes after fix
  • All 32 apx-mcp tests pass
  • Manual: invoke routes tool via MCP client and confirm no validation error

🤖 Generated with Claude Code

renardeinside and others added 5 commits February 21, 2026 02:11
…pile-time structuredContent safety

Replace 13 manual `impl StructuredObject` declarations with a single
`tool_response!` macro that combines `#[derive(Serialize)]` + the marker
trait. Add `from_serializable_error` to close the handle_check bypass
where structured errors weren't getting compile-time guarantees.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@renardeinside renardeinside merged commit e29c897 into main Feb 21, 2026
3 checks passed
@renardeinside renardeinside deleted the fixes/post-release branch February 21, 2026 11:44
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