agentCard

Configures a behavior for handling Agent Card mock server requests. This method simulates interactions with an endpoint that retrieves agent card data.

Remote Agents that support A2A are required to publish an Agent Card in JSON format describing the agent's capabilities/skills and authentication mechanism. Clients use the Agent Card information to identify the best agent that can perform a task and leverage A2A to communicate with that remote agent.

Example usage:

// Configure the mock server to respond with the AgentCard
a2aServer.agentCard() responds {
delay = 1.milliseconds
card {
name = "test-agent"
description = "test-agent-description"
url = a2aServer.baseUrl()
documentationUrl = "https://example.com/documentation"
version = "0.0.1"
provider = AgentProvider(
"Acme, Inc.",
"https://example.com/organization",
)
authentication = AgentAuthentication(
schemes = listOf("none", "bearer"),
credentials = "test-token",
)
capabilities = AgentCapabilities(
streaming = true,
pushNotifications = true,
stateTransitionHistory = true,
)
skills = listOf(
AgentSkill(
id = "walk",
name = "Walk the walk",
),
AgentSkill(
id = "talk",
name = "Talk the talk",
),
)
}
}

Return

An instance of AbstractBuildingStep allowing further configuration of the response for agent card requests using AgentCardResponseSpecification.

Parameters

name

An optional identifier for the configured request.

See also