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)
The agent's A2A card URL + bearer token from the agent Share dialog
Python 3.10+ with a2a-sdk pinned < 1.0 (server speaks A2A 0.3 today)
1

Scaffold the project

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

Install dependencies

Pins a2a-sdk below 1.0 — Glean serves A2A spec 0.3 today; 1.x clients won't interop until the server upgrades.

cd a2a-client && pip install -r requirements.txt
3

Set credentials

Fill in GLEAN_A2A_CARD_URL and GLEAN_A2A_TOKEN from the agent's Share → A2A dialog — this is a per-agent bearer token, not the general Glean OAuth/token chain.

cp .env.example .env
4

Run it

python main.py
5

Verify

Confirm a real answer to "Who owns the payments service?", 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.
Scaffold starter code

Copies a prompt your AI assistant can build from.

At a glance
SurfacesAgents, Client API
StatusProduction pattern
Time~45 min
Required scopes
Agent-scoped Client API token (AGENTS)