MCP: describe_command and execute_command accept id again (#365 follow-up)
#365 rejects arguments missing from a tool's schema; both tools read `id` as an alias of `command`, so declare it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
7b41793ab4
commit
3df56ce9d9
@@ -1053,3 +1053,14 @@ fn panicked_render_worker_finishes_with_an_error() {
|
||||
let reply: Value = serde_json::from_slice(&out).unwrap();
|
||||
assert_eq!(reply["result"]["isError"], true, "{reply}");
|
||||
}
|
||||
|
||||
/// `id` is an accepted alias of `command` (#365 made unknown keys an error).
|
||||
#[test]
|
||||
fn command_tools_accept_id_as_an_alias() {
|
||||
let mut s = server();
|
||||
let d = call_json(&mut s, "describe_command", json!({"id": "comp.new"}));
|
||||
assert_eq!(d["id"], "comp.new", "{d}");
|
||||
call_json(&mut s, "execute_command", json!({"id": "comp.new", "params": {"name": "Alias", "width": 64, "height": 36}}));
|
||||
let (_, err) = call(&mut s, "execute_command", json!({}));
|
||||
assert!(err, "neither key is an error");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user