“adk-tools”
Handling Binary Payloads: Returning Images, PDFs, and Audio from Tools
How to handle non-text outputs from ADK tools — choosing between inline base64 data parts, artifact storage services, and signed Cloud Storage URLs.
Multi-Step Tool Chains: Tools That Call Other Subordinate Tools
When and how to compose composite tools in ADK — bundling multi-step validation, fetching, and transformation pipelines into single atomic operations.
Caching Tool Responses to Eliminate Duplicate Expensive API Calls
How to eliminate redundant API calls and cut agent latency by implementing deterministic tool caching with in-memory LRUs, Redis backends, and cache-busting keys.
Rate-Limiting External Tool Calls to Protect Upstream Services
How to safeguard third-party APIs and downstream services by enforcing token-bucket rate limits, concurrency semaphores, and exponential backoff inside ADK tools.
Mocking Tools in Unit Tests: Building Predictable Agent Test Suites
How to isolate ADK agents from external side-effects using tool mocking, fake declarations, unittest.mock patches, and deterministic assertion harnesses in CI.
Tool Output Formatting: Markdown vs Structured Dictionaries for LLM Consumption
Choose what a tool actually returns: structured dicts with status and summary beat Markdown for chaining and callbacks, while prose belongs in the agent's final answer.
Pagination and Batch Processing Patterns for High-Volume Tools
Stop flooding the context: cap page sizes, switch from offset to cursor pagination, fan out bounded batches, and hand the model resumable state instead of raw row dumps.
Webhook Dispatcher Tools: Sending Outbound Events from Agent Actions
Build an ADK tool that fires outbound webhooks safely: signed HMAC payloads, endpoint allow-lists, idempotency keys, bounded retries, and a delivery status the model can act on.
GraphQL API Integration as Dynamic ADK Tools
Turn a GraphQL API into typed ADK tools: introspect the schema at build time, expose named operations with variables, batch requests, and shape responses for the model.
Database Querying Tools: Building Safe Read-Only SQL Agents
Layer a SQL tool so an ADK agent can explore data but never modify it: a read-only connection, a statement gate, an identifier allow-list, parameter binding, and a bounded result payload.
File System and Disk I/O Tools: Safe Workspace Isolation for Agents
Build ADK file tools that stay inside a per-session workspace: path confinement, traversal defense, artifact-backed storage, quotas, and an auditable cleanup policy.
Sandboxed Python Execution: Securing Dynamic Code Tools with E2B or Docker
Give agents a Python interpreter without handing them your server: sandbox options from E2B microVMs to hardened Docker, plus the ADK tool wrapper and the residual risks.
Tool Authorization and Permission Gates: Validating Caller Roles
Four places to enforce authorization in ADK — schema, in-tool policy, before_tool_callback, and plugins — plus identity choices and denial messages the model can act on.
Dynamic Tool Registration: Adding and Removing Tools Mid-Session
How ADK resolves an agent's tools per invocation, and the four ways to change the tool set at runtime: toolsets, list mutation, callback gating, and sub-agent routing.
Injecting Session and Context into Tools: Accessing State Inside Functions
How ADK injects ToolContext into a function tool, what the session, user, app, and temp state prefixes each mean, and the serialization and event rules that keep state consistent.
Long-Running Tools: Managing Asynchronous Jobs and Polling Patterns
Handle jobs that outlive a turn with LongRunningFunctionTool — pause semantics, event.long_running_tool_ids, resuming with FunctionResponse, and when to poll instead.
Building an MCP Client Toolset for Local and Stdio MCP Servers
Run local stdio MCP servers as agent tools — StdioConnectionParams, subprocess lifecycle, tool curation, diagnostics, and how it compares to using an MCP session directly.
Connecting MCP Servers to ADK Agents
Attach any MCP server to an ADK agent with McpToolset — transport choices, connection lifecycle, auth, resources, and how the three MCP integration patterns differ.
Enterprise REST API Integration: Auto-Generating Tools from OpenAPI Specs
Turn an OpenAPI 3.x document into callable ADK tools with OpenAPIToolset — how names and schemas are derived, how auth and headers are applied, and when to curate instead.
Built-in Tools: Web Grounding with Google Search Grounding Tool
Wire ADK's built-in google_search tool into an agent, understand the grounding data flow, read groundingMetadata for citations, and meet the display and billing rules that come with it.