CCDV-F Tools & MCP EASY
PRODUCTION SCENARIO
A set_alarm tool takes a unit parameter, typed in its input_schema as a plain string. In testing Claude sometimes sends secs or hr, and the server rejects the call.

Which change stops those invalid values at the source?

Answering here is anonymous. Nothing is saved unless you sign in.

Show answer and explanation

Answer: Constrain the `unit` property with an `enum` of seconds, minutes, and hours.

Anthropic tool schemas are JSON Schema, so an enum on the property restricts the value to the listed literals, the way the documented get_weather tool restricts unit to celsius or fahrenheit. Strict tool use guarantees that inputs match the schema, but a schema that says only 'string' still admits secs, so strict alone changes nothing here. A description is guidance the model may or may not follow, not a constraint the API enforces. And normalising on the server hides the problem instead of stopping it, and breaks the moment a new abbreviation appears.
Free

Keep practicing CCDV-F

105 original CCDV-F practice questions, each with an explanation and a source link. No account needed.

Start free practice set → Timed, explained, free