From adk-tools
Use this skill to write a custom Python function tool for an ADK 2.0 agent. Triggers on: "ADK function tool", "create a tool for ADK", "custom tool in ADK", "wrap a function as ADK tool", "agent tool that does X", "Python callable as ADK tool", "ADK tool with type hints". Generates a properly type-hinted Python function with docstring (used by ADK as the tool schema) ready to drop into an agent's tools=[] list.
How this skill is triggered — by the user, by Claude, or both
Slash command
/adk-tools:function-tool-authorThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Author a Python function tool for ADK 2.0. ADK reads type hints and the docstring to build the tool schema sent to the LLM.
Author a Python function tool for ADK 2.0. ADK reads type hints and the docstring to build the tool schema sent to the LLM.
from typing import Optional
def get_weather(city: str, units: str = "fahrenheit") -> dict:
"""Get the current weather for a city.
Args:
city: City name (e.g., 'San Francisco', 'Tokyo').
units: Temperature units. One of 'fahrenheit' or 'celsius'.
Returns:
A dict with keys: temperature (number), conditions (string),
humidity (number, percent).
"""
# Replace with your real call
return {
"temperature": 68,
"conditions": "partly cloudy",
"humidity": 55,
"city": city,
"units": units,
}
from google.adk.agents import LlmAgent
root_agent = LlmAgent(
name="weather_assistant",
model="gemini-2.5-flash",
instruction="Answer weather questions using get_weather.",
tools=[get_weather],
)
Args: block — these become parameter descriptionsstr, int, float, bool, list[T], dict, Optional[T]async def fetch_user(user_id: str) -> dict:
"""Fetch a user record by ID.
Args:
user_id: The unique user identifier.
Returns:
User record with name, email, created_at.
"""
async with httpx.AsyncClient() as client:
r = await client.get(f"https://api.example.com/users/{user_id}")
return r.json()
ADK auto-detects async functions; bind same way as sync.
def divide(a: float, b: float) -> dict:
"""Divide a by b. Returns {'result': float} or {'error': str}."""
if b == 0:
return {"error": "Cannot divide by zero"}
return {"result": a / b}
Return errors as data — don't raise. The LLM can recover from a structured error.
print(get_weather("Tokyo")) worksadk web — ADK shows the function call in the UIGuides creation, editing, and verification of skills for AI coding agents using test-driven development with subagent scenarios. Use when authoring or debugging skills.
npx claudepluginhub healthcare-ai-consulting-llc/adk-2-toolkit --plugin adk-tools