Skip to main content

You've already built a Glean agent. A2A (Agent2Agent) lets any A2A-compliant client — not just Glean's own UI — discover and run it, multi-turn and streamed, with Glean's permissions still enforced.

A published auto agent with a chat-message trigger (text input only)
Its agent id, from the Agent Builder URL or agents/search
A work email for tenant discovery and OAuth sign-in; an AGENTS-scoped API token is the fallback
uv (a2a-sdk is pinned < 1.0 — see below)
1

Scaffold the project

npx -y tiged@2.12.8 --mode=git gleanwork/glean-cookbook/recipes/a2a-client a2a-client
2

Set credentials

Use the shipped login flow, then set GLEAN_AGENT_ID and GLEAN_DEMO_QUERY from the answers already supplied. Never implement authentication.

cd a2a-client && node scripts/glean-auth.mjs login --scopes agents --email "<work-email>"
3

Run it

Dependencies are declared inline (PEP 723) and locked, so uv installs them into an isolated environment on first run — no requirements.txt, venv, or activate step.

cd a2a-client && uv run main.py
4

Verify

Use the question supplied up front. Confirm a real answer, a follow-up reusing the same context_id to prove multi-turn, and a streaming response — all three paths this recipe exercises.

Take it further
  • Handle the Task-based response shape explicitly if your agent uses tool calls that return structured artifacts, not just text.
  • Watch for the a2a-sdk 1.x upgrade path once Glean's server moves past spec 0.3 — the pinning caveat in this recipe is temporary.
  • Combine with connect-mcp-hosts to compare calling the same agent via MCP vs. A2A.

Who owns our most critical service?

The agent returns a non-empty answer via the A2A message/send response (a Message or Task, not an error), the scripted follow-up carries the same context_id proving multi-turn works, and the streamed turn prints its answer once rather than repeating it per event.

Each of these was run against a live Glean instance on 2026-08-02.

View source

Runs the recipe through the Glean cookbook plugin.

Auth

Run the authenticate step on this page. It discovers your tenant from work email and signs you in with OAuth, using the shipped login command. If OAuth is unavailable, create a scoped Glean-issued token in Token Management (AGENTS).

At a glance
SurfacesAgents, Client API
StatusProduction pattern
Time~45 min
Required scopes
AGENTS