Get Agent Card
The Get Agent Card task fetches the Agent Card of a remote agent that supports the Agent2Agent (A2A) protocol. An Agent Card is a JSON document in which an agent describes itself, including its name, endpoint, skills, and supported capabilities. Use this task to discover what a remote agent can do before calling it with an Agent task.
Task parameters
Configure these parameters for the Get Agent Card task.
| Parameter | Description | Required/ Optional |
|---|---|---|
| inputParameters.agentUrl | The URL of the remote agent. Use either the agent's base URL, or the direct URL of its Agent Card (a URL ending in .json). For a base URL, the task requests /.well-known/agent-card.json first, then /.well-known/agent.json. |
Required. |
| inputParameters.headers | A map of HTTP headers to send with the request, such as an Authorization header. |
Optional. |
| inputParameters.agentType | The type of agent. Only a2a is supported. Defaults to a2a. |
Optional. |
The following are generic configuration parameters that can be applied to the task and are not specific to the Get Agent Card task.
Caching parameters
You can cache the task outputs using the following parameters. Refer to Caching Task Outputs for a full guide.
| Parameter | Description | Required/ Optional |
|---|---|---|
| cacheConfig.ttlInSecond | The time to live in seconds, which is the duration for the output to be cached. | Required if using cacheConfig. |
| cacheConfig.key | The cache key is a unique identifier for the cached output and must be constructed exclusively from the task’s input parameters. It can be a string concatenation that contains the task’s input keys, such as ${agentUrl} or re_${agentUrl}. |
Required if using cacheConfig. |
Other generic parameters
Here are other parameters for configuring the task behavior.
| Parameter | Description | Required/ Optional |
|---|---|---|
| optional | Whether the task is optional. If set to true, any task failure is ignored, and the workflow continues with the task status updated to COMPLETED_WITH_ERRORS. However, the task must reach a terminal state. If the task remains incomplete, the workflow waits until it reaches a terminal state before proceeding. |
Optional. |
Task configuration
This is the task configuration for a Get Agent Card task.
{
"name": "get_agent_card",
"taskReferenceName": "get_agent_card_ref",
"type": "GET_AGENT_CARD",
"inputParameters": {
"agentUrl": "<YOUR-AGENT-URL>"
}
}
Task output
The Get Agent Card task will return the following parameter.
| Parameter | Description |
|---|---|
| agentCard | The Agent Card of the remote agent. Fields that the agent does not advertise are not returned. See the fields below. |
The agentCard object can include the following fields.
| Field | Description |
|---|---|
| name | The name of the agent. |
| description | A description of the agent. |
| url | The JSON-RPC endpoint of the agent. Use it as agentUrl in an Agent task. |
| version | The version of the agent. |
| protocolVersion | The A2A protocol version the agent supports. |
| preferredTransport | The preferred transport protocol of the agent. |
| provider | The organization that provides the agent. |
| capabilities | The features the agent supports, such as streaming and pushNotifications. |
| skills | The skills the agent offers, each with an id, name, description, tags, and examples. |
| defaultInputModes | The content types the agent accepts by default. |
| defaultOutputModes | The content types the agent returns by default. |
| securitySchemes | The authentication methods the agent supports. |
Examples
Here are some examples for using the Get Agent Card task.
Getting an Agent Card
This workflow fetches the Agent Card of a remote agent, then sends the agent a message using the endpoint advertised in the card.
{
"name": "get_agent_card_example",
"version": 1,
"tasks": [
{
"name": "get_agent_card",
"taskReferenceName": "get_agent_card_ref",
"type": "GET_AGENT_CARD",
"inputParameters": {
"agentUrl": "<YOUR-AGENT-URL>"
}
},
{
"name": "agent",
"taskReferenceName": "agent_ref",
"type": "AGENT",
"inputParameters": {
"agentUrl": "${get_agent_card_ref.output.agentCard.url}",
"text": "Hello"
}
}
]
}