Skip to content

feat: serve A2A Agent Cards from template.yaml for external discoverability #737

Closed

Description

@vybe

Summary

Generate and serve an A2A-compliant Agent Card (`/.well-known/agent-card.json`) for each Trinity agent by reading `template.yaml` skills and `CLAUDE.md`. External A2A orchestrators (AWS Bedrock, Azure Copilot, Google ADK) can discover and call Trinity agents without knowing Trinity's internal API. No agent-server changes required — the backend generates and proxies the card.

Context

An Agent Card is the A2A protocol's discovery primitive: a JSON document at `/.well-known/agent-card.json` that describes an agent's capabilities, skills, and auth requirements. Trinity's `template.yaml` already contains the raw material (name, description, skills, credential requirements). Serving a card from that data makes Trinity agents first-class citizens in the A2A ecosystem with zero agent-code changes. See `docs/research/a2a-protocol.md` § 2.2 and § 13.2 Option A/B.

Acceptance Criteria

  • New backend endpoint `GET /api/agents/{name}/a2a/agent-card` returns a valid A2A v1.0 Agent Card JSON
  • Card fields populated from: `template.yaml` (name, description, version, skills array) + agent ownership (capabilities)
  • Backend proxies `GET /.well-known/agent-card.json` for requests with `X-Trinity-Agent: {name}` header (or via subdomain / path convention TBD)
  • `skills[]` in card populated from `template.yaml` skills list; each skill includes `id`, `name`, `description`, `tags`, `examples` where available
  • `securitySchemes` declares `bearerAuth` (Trinity MCP API key); public card omits sensitive details
  • Extended card (requires auth) adds internal endpoint URLs and full skill schemas
  • `capabilities.streaming: true` set for all agents (agent-server supports SSE)
  • Card cached in Redis with 5-min TTL, invalidated on agent update/restart
  • New MCP tool `get_agent_card(agent_name)` returns the card JSON for introspection
  • Integration test: fetch card, validate against A2A v1.0 schema

Technical Notes

  • A2A Agent Card schema: `docs/research/a2a-protocol.md` § 2.2
  • `template.yaml` skills array → A2A `skills[]`: `id`, `name`, `description`, `tags`, `examples`
  • Auth declaration: `securitySchemes.bearerAuth = {type: "http", scheme: "bearer"}`; `security: [{bearerAuth: []}]`
  • The card's `url` field should point to the A2A JSON-RPC endpoint (to be added in a follow-on issue)
  • Related files: `src/backend/routers/agents.py`, `src/backend/services/template_service.py`, `src/mcp-server/src/tools/agents.ts`

Activity

  1. added
    priority-p2
    type-feature
    on May 8, 2026
  2. added
    status-in-progress
    on May 14, 2026
  3. self-assigned this
    on May 14, 2026
  4. added a commit that references this issue on May 20, 2026
  5. added
    status-in-dev
    and removed
    status-in-progress
    on May 28, 2026
  6. vybe commented on Jun 1, 2026

    @vybe
    ContributorAuthor

    Shipped in v0.6.0 (released via #998).

  7. added
    theme-infrastructure
    and removed
    status-in-dev
    on Jun 1, 2026
  8. added a commit that references this issue on Jun 23, 2026
  9. 33 remaining items

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

priority-p2theme-infrastructuretype-feature

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions