Repository navigation
fix: preserve ignored-filter diagnostics and reject unscoped MCP results - #484
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Preview deployment for your docs. Learn more about Mintlify Previews.
|
Shadow risk calibration
Calibration result: agreement. Shadow risk never blocks or enables merge. Keep it in observation mode until roughly 50 pull requests have human-reviewed labels, then calibrate before considering any policy use. |
|
CI update: SDK/MCP suites, monorepo checks and all six local protocol versions pass. The 2026-07-28 preview evaluation failed during fixture discovery: list_shipments received an upstream HTTP 401 before the container-result tests ran. The other preview protocol check passed. Retrying the failed job once to distinguish a transient auth/availability issue; no credential or environment changes made. |
|
One follow-up on the MCP error response: Please use a controlled error type that the server can safely expose, such as the existing Add a test through the MCP server for both Verified against |
|
Fixed the error-boundary gap in the latest commit. Nonempty diagnostics now raise ToolInputError with controlled correction guidance. Only bounded filter identifiers are accepted for that message; malformed diagnostics remain generic and unexpected-error sanitization is unchanged. Added real MCP client/server transport tests for both list_containers and summarize_containers: isError true, no structured results, ignored names/correction guidance retained, and no item/group payload or applied_filters leaked. Added a malformed-diagnostics boundary regression too. All 750 MCP tests pass; build and package lint/format pass (existing warnings, zero errors). This complements the existing real-SDK mapping tests. |
SylvainGravejat
left a comment
There was a problem hiding this comment.
(Analysis done with Claude)
LGTM. One optional improvement: malformed ignored_filters diagnostics fall back to "contact support". Since the keys echo the caller's own request, a custom field slug with a space would get a generic error. A message like "some requested filters were not applied", without echoing the keys, would still tell the caller what to fix.
Summary
meta.ignored_filtersin OpenAPI and regenerate SDK types.list_containersandsummarize_containersreturn an actionable error before presenting results when the API reports ignored filters. Do not silently drop requested constraints.Validation
No deployment performed. Backend diagnostics must be available for the guard to detect ignored filters.
Need help on this PR? Tag
@codesmith-botwith what you need.Fix the lost correction message before merging so MCP callers can recover from ignored filters.
Fix with agent prompt
Summary
This PR preserves
ignored_filtersin SDK summary responses and makes the two MCP container tools withhold results when filters were ignored.Diagram
%%{init: {'theme': 'neutral'}}%% flowchart TD API[API response] --> SDK[SDK preserves ignored_filters] SDK --> Guard{Ignored filters reported?} Guard -->|No| Result[Return rows or counts] Guard -->|Yes| Error[Throw plain Error] Error --> Boundary[Shared MCP error code] Boundary --> Generic[Generic failure replaces correction message]Reviews (1) · Last reviewed commit: "fix(mcp): withhold container results whe..." · Reviewed by Greptile