Agent2Agent (A2A) is an open protocol enabling communication and interoperability between opaque agentic applications. Parasoft Virtualize is well-suited for virtualizing A2A agents with its built-in JSON processing tools and extensions for a wide array of underlying transports. Virtualize supports the A2A protocol bindings JSON-RPC and gRPC. Virtualization is helpful in A2A environments where a consistent response is needed from an agent.
The following example illustrates how to create an A2A test scenario in Virtualize:
/.well-known/agent-card.json.

{
"name": "My AI Agent",
"description": "An agent that processes tasks and returns structured results.",
"url": "https://${{=sv:header('host')}}/A2A/my-ai-agent",
"version": "1.0.0",
"provider": {
"organization": "Example Corp",
"url": "https://example.com"
},
"capabilities": {
"streaming": false,
"pushNotifications": false,
"stateTransitionHistory": false
},
"authentication": {
"schemes": ["Bearer"]
},
"defaultInputModes": ["text/plain", "application/json"],
"defaultOutputModes": ["text/plain", "application/json"],
"skills": [
{
"id": "data-analysis",
"name": "Data Analysis",
"description": "Analyzes structured data and returns insights.",
"tags": ["data", "analytics"],
"examples": [
"Analyze this CSV and summarize trends",
"Find anomalies in this dataset"
],
"inputModes": ["application/json", "text/csv"],
"outputModes": ["application/json"]
},
{
"id": "text-summarization",
"name": "Text Summarization",
"description": "Summarizes long-form text content.",
"tags": ["nlp", "summarization"],
"examples": [
"Summarize this article in 3 bullet points"
],
"inputModes": ["text/plain"],
"outputModes": ["text/plain"]
}
]
} |

id and messageId as needed under Exclude Patterns for Request Message Correlation.
messageId and contextId.messageId.contextId.1234567890abcdef for both.{
"jsonrpc": "2.0",
"id": "req-001",
"method": "message/send",
"params": {
"message": {
"role": "ROLE_USER",
"parts": [{ "text": "Check drug interactions for warfarin and aspirin" }],
"messageId": "fec59aef01e660f0e0794740be2c907d"
},
"configuration": {
"acceptedOutputModes": ["text/plain", "application/json"],
"historyLength": 10,
"returnImmediately": false
}
}
} |
{
"jsonrpc": "2.0",
"id": "${{=/root/id/text()#req-001}}",
"result": {
"message": {
"messageId": "${messageId}",
"contextId": "${contextId}",
"role": "ROLE_AGENT",
"parts": [{ "text": "Combining warfarin and aspirin carries a major risk of severe bleeding and should only be done under strict medical supervision, as both medications thin the blood." }]
}
}
} |
{*} |
{
"jsonrpc": "2.0",
"id": "${{=/root/id/text()#req-001}}",
"result": {
"message": {
"messageId": "${messageId}",
"contextId": "${contextId}",
"role": "ROLE_AGENT",
"parts": [{ "text": "I'm sorry, I didn't understand the request or your request couldn't be processed right now." }]
}
}
} |