Generated tool input errors do not identify the field to fix #818

Open
opened 2026-10-02 13:15:52 +00:00 by kayg · 1 comment
Owner

Context: #427 rev-mcp-api review, #484, DESIGN §41. Source base c4a61e8cf090170f35b1bed3350d9de20c83ecd5. Priority: Low. Source review only; product code is unchanged.

Evidence:

  • crates/calternal-api/src/actions.rs:234 reports only Unexpected tool input field; :243 reports only Missing required tool input field; :267 reports only Invalid tool parameter type.
  • apps/web/src/lib/webmcp/generated.ts:20 and :21 return the same unnamed-field errors; :39 omits the field and expected type.
  • Generated operations have nested path, query, headers and body groups. For example, update_body requires path.id, headers.If-Match and body. The current error does not say which group or field failed.

Impact:

An agent must guess which value to repair or reread the whole schema after a normal argument error. All generated adapters repeat this limitation.

Expected:

Report the action ID, field path and expected shape, such as headers.If-Match is required. Report unknown field names without echoing supplied values. Keep credential and Home content values out of error text.

Regression test idea:

Check missing nested headers, unknown fields and wrong primitive types through Rust and browser validators. Assert precise field paths and expected types. Include a sensitive test value and assert that the value is absent from the error.

Duplicate check:

Searched all issue states for the quoted exact phrase Missing required tool input field; no issue found.

Context: #427 rev-mcp-api review, #484, DESIGN §41. Source base `c4a61e8cf090170f35b1bed3350d9de20c83ecd5`. Priority: Low. Source review only; product code is unchanged. Evidence: - `crates/calternal-api/src/actions.rs:234` reports only Unexpected tool input field; `:243` reports only Missing required tool input field; `:267` reports only Invalid tool parameter type. - `apps/web/src/lib/webmcp/generated.ts:20` and `:21` return the same unnamed-field errors; `:39` omits the field and expected type. - Generated operations have nested path, query, headers and body groups. For example, update_body requires path.id, headers.If-Match and body. The current error does not say which group or field failed. Impact: An agent must guess which value to repair or reread the whole schema after a normal argument error. All generated adapters repeat this limitation. Expected: Report the action ID, field path and expected shape, such as headers.If-Match is required. Report unknown field names without echoing supplied values. Keep credential and Home content values out of error text. Regression test idea: Check missing nested headers, unknown fields and wrong primitive types through Rust and browser validators. Assert precise field paths and expected types. Include a sensitive test value and assert that the value is absent from the error. Duplicate check: Searched all issue states for the quoted exact phrase `Missing required tool input field`; no issue found.
Author
Owner

Finding fixed in 5d66713c7. Action::prepare returned generic errors for missing nested headers, unknown fields and wrong parameter types, while WebMCP emitted the same unnamed errors. The shared validators now name the operation and field path, state the expected type, and omit caller values. Rust and WebMCP tests cover missing headers.If-Match, wrong type, an unknown field with a sensitive value, and private body text.

Regression evidence: the new Rust test first failed because the error did not contain update_body; the WebMCP test first failed for the same reason. After the fix: test actions::tests::input_errors_name_action_field_and_expected_shape ... ok; Test Files 1 passed (1), Tests 10 passed (10). The full calternal-api crate gate passed: test result: ok. 11 passed; 0 failed; 0 ignored; 0 measured; finished in 0.18s.

Finding fixed in `5d66713c7`. `Action::prepare` returned generic errors for missing nested headers, unknown fields and wrong parameter types, while WebMCP emitted the same unnamed errors. The shared validators now name the operation and field path, state the expected type, and omit caller values. Rust and WebMCP tests cover missing `headers.If-Match`, wrong type, an unknown field with a sensitive value, and private body text. Regression evidence: the new Rust test first failed because the error did not contain `update_body`; the WebMCP test first failed for the same reason. After the fix: `test actions::tests::input_errors_name_action_field_and_expected_shape ... ok`; `Test Files 1 passed (1)`, `Tests 10 passed (10)`. The full `calternal-api` crate gate passed: `test result: ok. 11 passed; 0 failed; 0 ignored; 0 measured; finished in 0.18s`.
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
kayg/calternal#818
No description provided.