Skip to content
Help guide the future of agentgateway — Take the survey

For the complete documentation index, see llms.txt. Markdown versions of all docs pages are available by appending .md to any docs URL.

Connect to an agent

Page as Markdown

Route to A2A servers and securely expose their skills through agentgateway.

With agentgateway, you can route to agent-to-agent (A2A) servers and expose their tools securely.

Before you begin

Install and set up an agentgateway proxy.
  1. Get the agentgateway address.

    export INGRESS_GW_ADDRESS=$(kubectl get gateway agentgateway-proxy -n agentgateway-system -o=jsonpath="{.status.addresses[0].value}")
    echo $INGRESS_GW_ADDRESS
  2. Get the agent card through agentgateway. Agentgateway rewrites the url field in the card so that clients send requests to the gateway instead of the agent.

    curl http://$INGRESS_GW_ADDRESS/myagent/.well-known/agent.json | jq

    Example output: The url field points to the /myagent path on the gateway, not to the agent’s own address. The host in url matches the address that you sent the request to, such as the load balancer address. Agentgateway also rewrites the agent card that the agent serves at /.well-known/agent-card.json, if your agent uses A2A v0.3.0 or later.

    {
      "name": "Echo Agent",
      "description": "This agent echos the input given",
      "url": "http://localhost:8080/myagent",
      "version": "0.1.0",
      "capabilities": {
        "streaming": true,
        "pushNotifications": false,
        "stateTransitionHistory": false
      },
      "defaultInputModes": [
        "text"
      ],
      "defaultOutputModes": [
        "text"
      ],
      "skills": [
        {
          "id": "my-project-echo-skill",
          "name": "Echo Tool",
          "description": "Echos the input given",
          "tags": [
            "echo",
            "repeater"
          ],
          "examples": [
            "I will see this echoed back to me"
          ],
          "inputModes": [
            "text"
          ],
          "outputModes": [
            "text"
          ]
        }
      ]
    }
  3. As a user, send a request to the A2A server. As an assistant, the agent echoes back the message that you sent.

    curl -X POST http://$INGRESS_GW_ADDRESS/myagent \
      -H "Content-Type: application/json" \
        -v \
        -d '{
      "jsonrpc": "2.0",
      "id": "1",
      "method": "tasks/send",
      "params": {
        "id": "1",
        "message": {
          "role": "user",
          "parts": [
            {
              "type": "text",
              "text": "hello gateway!"
            }
          ]
        }
      }
      }' | jq

    Example output:

    {
      "jsonrpc": "2.0",
      "id": "1",
      "result": {
        "id": "1",
        "message": {
          "role": "assistant",
          "parts": [
            {
              "type": "text",
              "text": "hello gateway!"
            }
          ]
        }
      }
    }

Cleanup

You can remove the resources that you created in this guide.
kubectl delete Deployment a2a-agent --ignore-not-found
kubectl delete Service a2a-agent --ignore-not-found
kubectl delete HTTPRoute a2a --ignore-not-found
kubectl delete AgentgatewayBackend a2a-backend --ignore-not-found
Was this page helpful?
Agentgateway assistant

Ask me anything about agentgateway configuration, features, or usage.

Note: AI-generated content might contain errors; please verify and test all returned information.

Tip: one topic per conversation gives the best results. Use the + button in the chat header to start a new conversation.

Switching topics? Starting a new conversation improves accuracy.
↑↓ navigate ↵ select esc dismiss

What could be improved?

Your feedback helps us improve assistant answers and identify docs gaps we should fix.

Need more help? Join us on Discord: https://discord.gg/y9efgEmppm

Want to use your own agent? Add the Solo MCP server to query our docs directly. Get started here: https://search.solo.io/.