The four locations
Reading a field from the input
Every mapping names a source withfrom_field, which takes one of two shapes:
Validation
Path, query, and header mappings each accept validation constraints, applied before the request is built:
A validation failure fails the tool call rather than sending a malformed request.
Validation checks types; it does not coerce them. A string
"10" where
param_type is integer fails — it is not converted. There is also no
default-value field: an absent optional parameter is simply omitted.Body strategies
body_config has a strategy and an optional content_type (default
application/json). The strategy is a tagged object:
Whole input as the body:
mapped is what you want when the API’s field names are worse than the ones you
want the model to see.
A complete example
POST /repos/{owner}/{repo}/issues: