Skip to content

Conversation

lavinigam-gcp
Copy link
Collaborator

This PR addresses outdated and incorrect documentation for FunctionTool parameter handling, closing issues #473, #481, and #210.

The existing documentation incorrectly advises against using default values for parameters, a feature that is fully supported by the ADK framework. This has caused confusion and limited developers' ability to define flexible tools.

This change:

  • Removes the inaccurate statement about default parameters.
  • Completely overhauls the 'Parameters' section in function-tools.md into a new, structured guide on defining function signatures.
  • Provides clear, distinct code examples for required parameters, optional parameters with default values, and optional parameters using typing.Optional.
  • Clarifies that variadic arguments (*args, **kwargs) are ignored for schema generation.
  • Briefly explains how ADK inspects function signatures to generate the LLM tool schema, adding clarity to the automatic wrapping process.

This comprehensive update will provide developers with accurate guidance, prevent common errors, and enable them to leverage the full capabilities of FunctionTool.

@Hereforlolz
Copy link

@lavinigam-gcp This is awesome! Just tested it out and everything works like a charm.
I tested and threw a bunch of different function signatures and they all worked. Thank you for taking time to rewrite this whole section and putting effort into this!

@polong-lin polong-lin merged commit c9b4a1e into main Jul 30, 2025
3 of 4 checks passed
@polong-lin polong-lin deleted the fix-473 branch July 30, 2025 09:07
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.

3 participants