Expand description
Agent card discovery with HTTP caching.
A2A agents publish their AgentCard at a well-known URL. This module
provides helpers to fetch and parse the card.
The default discovery path is /.well-known/agent-card.json appended to
the agent’s base URL.
Per spec §8.6, CachingCardResolver caches the card as RFC 9111
describes: it reuses a stored card while it is fresh (max-age,
Expires, Age) and revalidates a stale one with If-None-Match /
If-Modified-Since. The free functions fetch once and cache nothing.
Structs§
- Caching
Card Resolver - A caching agent card resolver: a private HTTP cache (RFC 9111) of one agent card (spec §8.6.2: clients SHOULD honor RFC 9111 when fetching Agent Cards).
- Card
Cache - A cache of agent cards for many agents: one
CachingCardResolverper card URL, each with this cache’s settings. - Card
Fetch Options - What a card fetch sends and how long it may take.
Constants§
- AGENT_
CARD_ PATH - The standard well-known path for agent card discovery.
- DEFAULT_
MAX_ ENTRIES - The default bound on the URLs a
CardCachekeeps.
Functions§
- fetch_
card_ from_ url - Fetches the
AgentCardfrom an absolute URL. - fetch_
card_ from_ url_ with_ options fetch_card_from_urlwith the headers and budget inoptions.- resolve_
agent_ card - Fetches the
AgentCardfrom the standard well-known path. - resolve_
agent_ card_ with_ options resolve_agent_cardwith the headers and budget inoptions.- resolve_
agent_ card_ with_ path - Fetches the
AgentCardfrom a custom path.