FunctionTool declares every functools.partial as `partial` and drops the `__call__` docstring

Open
#7,190 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
74/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
python
Domain
ai, tooling

Research direction

Start in google.adk.tools.function_tool.FunctionTool and google.adk.models.llm_request.LlmRequest, using the reported Python 3.13 reproduction to trace tool naming and declaration descriptions. Done means both functools.partial tools retain distinct names and docstrings, and OrderLookup's call docstring appears in its declaration.

Written by the indexing model from the issue text.

Description

If you bind an API key into two tools with functools.partial, they're both declared as partial with the functools.partial docstring. Only the last one stays registered, so weather calls run get_forecast.

A callable object documented only on __call__ shows that docstring in tool.description, but its declaration doesn't have one.

Repro on main (f33d492), Python 3.13:

from functools import partial
from google.adk.models.llm_request import LlmRequest
from google.adk.tools.function_tool import FunctionTool

def get_weather(key: str, city: str):
  """Current weather for a city."""

def get_forecast(key: str, city: str):
  """Forecast for a city."""

class OrderLookup:
  def __call__(self, order_id: str):
    """Finds an order by id."""

req = LlmRequest()
req.append_tools([FunctionTool(partial(get_weather, "k")),
                  FunctionTool(partial(get_forecast, "k")),
                  FunctionTool(OrderLookup())])
for d in req.config.tools[0].function_declarations:
  print(d.name, repr(d.description))

It logs Duplicate tool name 'partial', prints partial twice, then OrderLookup None. I'd expect each tool under its own name and docstring.

Dominant language
Python
Stars
21.6k
Forks
4k
Avg merge
13h 49m
Merged PRs (30d)
10

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from google/adk-python

All issues in google/adk-python

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.