Skip to content

docs: add HTTP/JSON-RPC examples to a2a-agents - #742

Merged
Rachael-Graham merged 3 commits into
kagent-dev:mainfrom
boxcee-interview:fix/issue-538
Dec 1, 2026
Merged

Rachael-Graham merged 3 commits into
kagent-dev:mainfrom
boxcee-interview:fix/issue-538

Conversation

@boxcee-interview

Copy link
Copy Markdown
Contributor

Closes #538

examples/a2a-agents.md calls the kagent A2A service exclusively with grpcurl and lists the HTTP/JSON-RPC endpoints (agent card + JSON-RPC POST) only in a table. A reader who wants to use an ordinary HTTP client has nothing to follow: no curl example for reading the card, and no JSON-RPC request body to copy.

This adds a Call it over HTTP section showing the equivalent curl calls, grounded in the upstream endpoint contract (docs/architecture/a2a-transports.md on kagent-dev/kagent v1.0.0-alpha13):

  • read the Agent card at GET /agents/{namespace}/{name}/.well-known/agent-card.json
  • send a message with a JSON-RPC 2.0 request to POST /agents/{namespace}/{name}, mirroring the existing SendMessage example (messageId / role / parts)
  • the v1 SDK method names the JSON-RPC surface exposes, with the older A2A method names they replaced

Applies to the latest and main copies of the page, which are kept identical.

How to Test

hugo --config hugo.yaml --gc --minify
grep -c "Call it over HTTP" docs-site/public/kagent/latest/examples/a2a-agents/index.html

Builds cleanly (956 pages) and the new section renders in the built HTML for both latest and main.

@boxcee-interview

Copy link
Copy Markdown
Contributor Author

Heads up on the red deploy check: it's expected for fork PRs. The Preview workflow's wrangler step needs the repo's CLOUDFLARE_API_TOKEN/CLOUDFLARE_ACCOUNT_ID secrets, which aren't shared with fork PRs, so it fails before the (fork-guarded) preview-comment step — same for any fork PR here. The content checks (Static + content, linkChecker, DCO) all pass on this diff. No action needed from you unless you want to grant this fork secret access.

Signed-off-by: Moritz Schmitz von Hülst <mschmitzvonhuelst@gmail.com>
@boxcee-interview

Copy link
Copy Markdown
Contributor Author

Rebased onto the latest main (no content changes — still just the two a2a-agents.md files, 72 added lines). Content checks are green; the red deploy remains the expected fork-secret failure from my note above. Ready for review.

@Rachael-Graham Rachael-Graham left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this. I ran both curl calls as written against a kagent v1.0.1 cluster: the card lists the JSON-RPC interface first, and SendMessage returns a completed task with the answer in artifacts and the contextId you describe. The comments below are style only, and each one applies to the main copy too.


{{< reuse "kagent-docs/snippets/grpcurl-prerequisites.md" >}}

The examples in the rest of this page use `grpcurl` to call the gRPC transport. The controller serves the same service over HTTP/JSON-RPC on the same port `8083`; the `Call it over HTTP` section near the end of this page shows the equivalent `curl` calls.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The docs avoid spatial pointers such as "near the end of this page", and this sentence joins two clauses with a semicolon. Suggest: "To call the same service over HTTP/JSON-RPC with curl, see Call it over HTTP."


A tool approval works in the same way, but the agent sends `tool_approval_request`, and the caller answers with `tool_approval_response`. For the pause kinds, the approval model, and what a nested agent's pause looks like, see [Human in the loop]({{< link path="agents/human-in-the-loop" >}}).

## Call it over HTTP

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"it" in the heading has no antecedent for a reader who lands here from the table of contents, and the intro below it says "so far" and "below", which the style guide avoids. Suggest a heading such as "Call an agent over HTTP/JSON-RPC", and an intro that names the gRPC examples instead of pointing at them.

curl -s localhost:8083/agents/kagent/my-first-agent/.well-known/agent-card.json
```

The card advertises the JSON-RPC URL first, then the gRPC interface. Point every JSON-RPC call at the first `supportedInterfaces` entry, whose `url` is `http://<controller>/agents/<namespace>/<name>`. A hand-assembled HTTP call sets the Agent in the URL and needs no `tenant`; a `tenant` that an HTTP request does supply must match its URL.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"the first supportedInterfaces entry" depends on order. Name it by its value instead, for example "the entry whose protocolBinding is JSONRPC" (I confirmed on a v1.0.1 cluster that this entry carries the /agents/<namespace>/<name> URL). The semicolon before "a tenant that an HTTP request does supply" should also become a full stop.


The reply is the same task the `SendMessage` gRPC call returns: the answer arrives in `artifacts`, and `contextId` is the Session ID to repeat on a follow-up message.

3. The JSON-RPC surface uses the pinned upstream A2A v1 SDK method names: `SendMessage`, `SendStreamingMessage` (streams events over the same `POST` endpoint), `GetTask`, `ListTasks`, `CancelTask`, `SubscribeToTask`, and `GetExtendedAgentCard`. Those are the v1 names for what older A2A clients called `message/send`, `message/stream`, `tasks/get`, `tasks/list`, `tasks/cancel`, and `tasks/resubscribe`.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This step lists method names but asks the reader to do nothing, so it reads better as a short paragraph, or a table that maps each v1 method to its older name, after the steps. "pinned upstream A2A v1 SDK" is also internal phrasing, and "A2A v1 method names" says the same thing.

…t-dev#538)

Signed-off-by: Moritz Schmitz von Hülst <mschmitzvonhuelst@gmail.com>

@Rachael-Graham Rachael-Graham left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, thank you as always!

@Rachael-Graham
Rachael-Graham merged commit edd04c1 into kagent-dev:main Dec 1, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Docs: cover the A2A HTTP and JSON-RPC transport for kagent 1.x

2 participants