fix: mcp show (missing server name) emits missing_argument error_kind (#830)

`claw --output-format json mcp show` (no server name) previously emitted
error_kind:"unknown_mcp_action" — misleading because `show` IS a known
action; the problem is a missing required argument.

Fix:
- `render_mcp_report_json_for`: `Some("show")` arm now emits a dedicated
  JSON response with error_kind:"missing_argument" + usage hint
- `classify_error_kind`: add classifier arm for "missing_argument:" prefix

One new test: mcp_show_missing_server_name_emits_missing_argument

572+ tests pass.
This commit is contained in:
YeonGyu-Kim
2026-05-29 17:07:15 +09:00
parent 4d3dc5b873
commit 63931c74fb
3 changed files with 46 additions and 2 deletions

View File

@@ -271,7 +271,9 @@ Run `claw --help` for usage."
/// matching against the error messages produced throughout the CLI surface.
fn classify_error_kind(message: &str) -> &'static str {
// Check specific patterns first (more specific before generic)
if message.starts_with("unknown_slash_command:") {
if message.starts_with("missing_argument:") || message.starts_with("missing required argument:") {
"missing_argument"
} else if message.starts_with("unknown_slash_command:") {
"unknown_slash_command"
} else if message.starts_with("command_not_found:") {
"command_not_found"