The agent card¶
An agent card is a JSON document that describes an agent: who it is, what it can do and where to reach it. A client usually fetches it first, from /.well-known/agent-card.json on the agent's host.
The card of the greeter is built by agent_card:
examples/src/quickstart/agent.rs
/// The agent card: who the agent is, what it can do and where to reach it.
pub fn agent_card(base_url: &str) -> AgentCard {
AgentCard {
name: "Greeter".to_string(),
description: "Greets you by name. Asks for the name first if it was not given.".to_string(),
version: "0.1.0".to_string(),
provider: None,
capabilities: AgentCapabilities {
streaming: Some(true),
push_notifications: Some(false),
extensions: None,
extended_agent_card: None,
},
skills: vec![AgentSkill {
id: "greet".to_string(),
name: "Greet".to_string(),
description: "Greets the name in the message.".to_string(),
tags: vec!["greeting".to_string()],
examples: Some(vec!["Ada".to_string()]),
input_modes: None,
output_modes: None,
security_requirements: None,
}],
default_input_modes: vec!["text/plain".to_string()],
default_output_modes: vec!["text/plain".to_string()],
supported_interfaces: vec![
AgentInterface::new(format!("{base_url}/jsonrpc"), TRANSPORT_PROTOCOL_JSONRPC),
AgentInterface::new(format!("{base_url}/rest"), TRANSPORT_PROTOCOL_HTTP_JSON),
],
security_schemes: None,
security_requirements: None,
documentation_url: None,
icon_url: None,
signatures: None,
}
}
What the fields say:
name,descriptionandversionidentify the agent.versionis the agent's own version, not the protocol's.capabilities.streamingpromises that the agent answersSendStreamingMessage. The greeter does, so it istrue.push_notificationsisfalse: the greeter does not call a webhook back.skillslists what the agent does, each with anid, aname, adescription,tagsand optionalexamples. The greeter has one skill,greet.default_input_modesanddefault_output_modesare the media types the agent reads and writes. The greeter works in plain text.supported_interfaceshas one entry per way to reach the agent: a URL and a binding.agent_cardtakes the base URL, so the same card works wherever the agent runs. The greeter offersJSONRPCat/jsonrpcandHTTP+JSON(REST) at/rest, both speaking protocol version1.0.
AgentCard has no default value, so every field is written out, and None marks an optional one that the agent leaves unset.
Next, the executor holds the logic the card advertises.