Repository navigation
FunctionTool declares every functools.partial as partial and drops the __call__ docstring #7190
Description
Activity
Hi! I would like to work on this issue. My planned approach: in FunctionTool name/description inference, unwrap functools.partial (use partial.func.name and its docstring) and for callable instances fall back to type(obj).name plus the call docstring, with regression tests using the repro from this issue (no model or network needed). Please let me know if that direction sounds right, and assign it to me if so. Google CLA is already signed on my account. Thanks!
Opened PR #7198 with the fix (partial unwrapping for names, unwrap-aware description with instance call fallback, 6 new tests, full declarations suite 51/51 green). Google CLA is signed on my account. Happy to adjust if you prefer a different approach.
Heads up @aslamalkarywk7, #7191 has been open for this since I filed the issue, so there are two PRs closing it now. I'll leave it to the maintainers to pick one.
Reacted by Islam El-Nashar@Om-singhaI Thanks for the heads-up — I really appreciate it. I’m glad to see this is being looked at, and I’d be happy to collaborate on the fix if that helps. I’m already working through the issue and would welcome the opportunity to coordinate with you so we can avoid duplicated effort and land a solid solution together. Thanks again for the note and for keeping everyone informed.
- addedtools[Component] This issue is related to tools[Component] This issue is related to tools
on Sep 21, 2026 @Om-singhaI Reproduced this on main (2.9.0). Partials never get unwrapped when the tool name and description are picked so both end up as "partial".
As a workaround try setting p.name and p.doc on each partial (or wrapping it in a small named function) and see if each tool then shows up under its own name and docstring on your end. Please test it thoroughly and confirm it works before raising or updating a PR, and worth checking that a keyword-bound arg like key="k" still lands in the schema as a default.
Since #7191 and #7198 both target this the maintainers will probably want to pick one so it may help to coordinate there.
- added a commit that references this issue
on Oct 9, 2026
If you bind an API key into two tools with
functools.partial, they're both declared aspartialwith thefunctools.partialdocstring. Only the last one stays registered, so weather calls runget_forecast.A callable object documented only on
__call__shows that docstring intool.description, but its declaration doesn't have one.Repro on main (f33d492), Python 3.13:
It logs
Duplicate tool name 'partial', printspartialtwice, thenOrderLookup None. I'd expect each tool under its own name and docstring.