Skip to main content

What it does

This example demonstrates the grantex-adk integration by building scope-enforced tools for Google Agent Development Kit (ADK):
  1. Register an agent and obtain a grant token via the sandbox flow
  2. Create scoped tools using create_grantex_tool — each tool returns a plain function that can be used directly with Google ADK agents (calendar:read, email:send)
  3. Invoke tools directly as plain functions (in a full ADK agent, Gemini would select and call these tools)
  4. Demonstrate scope enforcement — attempting to create a tool with account:delete (a scope not in the grant) raises a PermissionError
  5. Inspect the audit trail to see the logged actions

Prerequisites

  • Python 3.9+
  • Docker (Docker Desktop or Docker Engine with Compose)

Run

Start the local Grantex stack from the repository root:
In a separate terminal, run the example:

Expected output

Environment variables

Source code

The full source is in examples/google-adk/main.py.
Last modified on February 28, 2026