ADK Tool Architect (Python Edition)
Philosophy & Architecture
Tools are the "hands" of the agent. In ADK (Python), tools are typically standard Python functions decorated or wrapped to be exposed to the LLM.
Logic Flow
- •Define Capabilities: Identify the discrete actions the agent needs (e.g.,
search_web,query_db). - •Read References:
- •For Function Tools and Tool Context, read
references/tools.md.
- •For Function Tools and Tool Context, read
- •Implementation:
- •Prefer simple
deffunctions with type hints. - •Use
ToolContextfor state/control flow. - •Wrap with
FunctionToolonly if advanced configuration (custom schema) is needed.
- •Prefer simple
Standards
- •Docstrings: Google-style or Sphinx-style. Must describe what the tool does and what the arguments are.
- •Type Hints: Mandatory for all arguments.
- •Return Value: Must be a
dict(recommended) or primitive. - •Async:
async defis supported and recommended for I/O bound tools.