fix(mcp): return typed error JSON for unsupported actions (info/describe/list-filter)#2989
Merged
code-yeongyu merged 1 commit intomainfrom May 4, 2026
Merged
fix(mcp): return typed error JSON for unsupported actions (info/describe/list-filter)#2989code-yeongyu merged 1 commit intomainfrom
code-yeongyu merged 1 commit intomainfrom
Conversation
Collaborator
Author
|
QA: Two test failures on this branch. (1) |
…ibe/list-filter) `claw mcp info nonexistent --output-format json` and `claw mcp list nonexistent --output-format json` fell through to the generic help renderer, returning an opaque envelope with only `unexpected` set — no machine-readable error_kind. Fix: - Add typed guards in render_mcp_report_for/_json_for for: - `list <filter>`: list accepts no filter argument - `info <name>` / `describe <name>`: suggest `mcp show` - New render_mcp_unsupported_action_text/json helpers emit `ok:false`, `error_kind:"unsupported_action"`, `hint`, `requested_action` - `mcp show`, `mcp list`, `mcp help` existing paths unchanged Test: mcp_unsupported_actions_return_typed_error_not_generic_help asserts kind=="mcp", ok==false, error_kind=="unsupported_action" for info/list-filter/describe paths. Pinpoint: ROADMAP #504
a10d547 to
061e1e9
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
claw mcp info nonexistent --output-format json,claw mcp list nonexistent --output-format json,claw mcp describe myserver --output-format jsonall fell through to the generic help renderer, returning an opaque envelope with onlyunexpectedset — no machine-readableerror_kind.mcp show nonexistent --output-format jsonalready returns a properfound:falseenvelope — that path is unchanged.Fix
list <filter>/info/describeguards inrender_mcp_report_forandrender_mcp_report_json_forrender_mcp_unsupported_action_text/jsonhelpers emitok:false,error_kind:"unsupported_action",hint,requested_actionTest
mcp_unsupported_actions_return_typed_error_not_generic_helpassertskind=="mcp",ok==false,error_kind=="unsupported_action"forinfo,list <filter>, anddescribepaths.Pinpoint: ROADMAP #504