Skip to content

UP-15: Agent capabilities declaration with A2A-compatible skills#21

Merged
Killea merged 2 commits intoKillea:mainfrom
bertheto:feat/agent-capabilities
Mar 1, 2026
Merged

UP-15: Agent capabilities declaration with A2A-compatible skills#21
Killea merged 2 commits intoKillea:mainfrom
bertheto:feat/agent-capabilities

Conversation

@bertheto
Copy link
Contributor

@bertheto bertheto commented Mar 1, 2026

Summary

  • Add structured skills[] metadata to agent registration (A2A AgentCard-compatible), alongside existing capabilities string tags
  • New agent_update MCP tool and PUT /api/agents/{id} REST endpoint for post-registration metadata updates (token-authenticated)
  • New GET /api/agents/{id} REST endpoint for single-agent detail
  • Expose capabilities and skills in agent_list MCP tool, GET /api/agents, and chat://agents/active resource
  • Minimal UI: .skills-badge pill in agent status item when skills are declared

Skill Schema (A2A AgentCard compatible)

Each skill object requires id and name; description, tags, and examples are optional:

{
  "id": "code-review",
  "name": "Code Review",
  "description": "Reviews code for style, security, and best practices",
  "tags": ["review", "security"],
  "examples": ["Review this PR for security issues"]
}

Changes

Backend

  • src/db/models.py: AgentInfo.skills field (optional, after existing optional fields — backward-compatible)
  • src/db/database.py: safe migration ALTER TABLE agents ADD COLUMN skills TEXT
  • src/db/crud.py: agent_register + skills, new agent_get, new agent_update
  • src/mcp_server.py: agent_register schema extended, agent_update tool added, agent_list description updated, chat://agents/active resource includes skills
  • src/tools/dispatch.py: handle_agent_register, handle_agent_list, new handle_agent_update
  • src/main.py: AgentRegister + skills, new AgentUpdate model, GET /api/agents + skills, new GET /api/agents/{id}, new PUT /api/agents/{id}

Web UI

  • acb-agent-status-item.js: .skills-badge pill (count badge, supports array or JSON string)
  • main.css: .skills-badge styles (dark + light theme)

Tests

  • tests/test_agent_capabilities.py: 19 pytest (11 unit in-memory + 8 HTTP integration)
  • frontend/src/__tests__/agent-capabilities.test.js: 6 Vitest DOM tests

All tests pass: 73/73 pytest + 30/30 Vitest

Test plan

  • agent_register with skills=[] → response includes parsed skills array
  • agent_list → each agent includes capabilities and skills
  • agent_update with valid token → skills updated, response ok: true
  • agent_update with wrong token → error returned
  • GET /api/agents/{id} → full agent detail with skills
  • GET /api/agents/{id} for unknown ID → 404
  • PUT /api/agents/{id} → updates skills, returns updated agent
  • Agent with skills in web UI → badge N skills visible in agent status panel
  • Agent without skills → no badge rendered

Expose capabilities (string tags) and add structured skills[] metadata
to agent registration, enabling A2A AgentCard-compatible routing.

Backend (Python/FastAPI):
- AgentInfo: add skills field (Optional[str], JSON, backward-compatible)
- DB migration: ALTER TABLE agents ADD COLUMN skills TEXT
- agent_register: accept skills parameter, store as JSON
- agent_get: new function returning a single agent by ID
- agent_update: new token-authenticated partial update function
- _row_to_agent: populate skills from DB row

MCP Tools:
- agent_register: add skills to input schema (A2A-aligned object structure)
- agent_list: now returns capabilities and skills in response
- agent_update (new tool): token-gated post-registration metadata update
- chat://agents/active resource: include skills array

REST API:
- AgentRegister: add skills field
- AgentUpdate (new Pydantic model)
- POST /api/agents/register: pass skills, return capabilities + skills
- GET /api/agents: include capabilities + skills per agent
- GET /api/agents/{id} (new): single agent detail with 404
- PUT /api/agents/{id} (new): partial update, token-authenticated

Web UI:
- acb-agent-status-item.js: show skills-badge pill when skills > 0
- main.css: .skills-badge styles (dark + light theme)

Tests:
- tests/test_agent_capabilities.py: 19 pytest (11 unit + 8 HTTP integration)
- frontend/src/__tests__/agent-capabilities.test.js: 6 Vitest DOM tests

All tests pass: 73/73 pytest + 30/30 Vitest
bertheto added a commit to bertheto/AgentChatBus that referenced this pull request Mar 1, 2026
The feat/structured-metadata branch inherited crud.py changes that
reference agents.skills (from UP-15 work), but the corresponding DB
migration was missing, causing sqlite3.OperationalError in CI.

UP-15 (PR Killea#21) is still pending review; this migration makes UP-17
self-contained regardless of merge order.
bertheto added a commit to bertheto/AgentChatBus that referenced this pull request Mar 1, 2026
crud.py (inherited from UP-15 work) passes skills=skills_json to AgentInfo()
but the field was missing from the dataclass, causing TypeError in CI.

This makes UP-17 self-contained regardless of UP-15 (PR Killea#21) merge order.
@Killea Killea merged commit dff4817 into Killea:main Mar 1, 2026
1 check 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.

2 participants