Skip to content

Keep tool parameters named title in generated input_schema, closes #1679 - #1680

Merged
simonw merged 1 commit into
simonw:mainfrom
cpruijsen:fix/issue-1679
Sep 19, 2026
Merged

simonw merged 1 commit into
simonw:mainfrom
cpruijsen:fix/issue-1679

Conversation

@cpruijsen

@cpruijsen cpruijsen commented Sep 12, 2026

Copy link
Copy Markdown
Contributor

Fixes:

A tool function with a parameter named title had that parameter deleted from the generated input_schema properties while required still listed it. Schema-strict models then omit the argument and the call fails with TypeError: ... missing 1 required positional argument: 'title'.

Tatsuhiko Miyagawa reported this on llm 0.26 and 0.35 and traced it to _remove_titles_recursively(), which is meant to strip Pydantic's "title": "When" annotations. Recursion into properties (and $defs) treated a property named title as that keyword and deleted the whole field. The same tool had been working on models that were willing to go off-schema; it broke on gpt-5.6-luna.

The helper now pops title only when the value is a string, which is what JSON Schema's title keyword is. A property or $defs entry named title has an object value, so it is kept. Pydantic annotations on sibling fields are still removed.

I chose the string-value check rather than skipping properties/$defs name-maps (the other fix suggested on the issue) or popping only when the dict also has type/anyOf. The string check is one condition, matches the spec, and covers nested models without a keyword list. Happy to switch to the name-map walker if preferred.

@simonw
simonw merged commit 3b9dd77 into simonw:main Sep 19, 2026
11 of 17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Tool parameter named "title" is stripped from input_schema but kept in required

2 participants