Skip to content

API Reference parrot.mcp.agent_resources

github-actions[bot] edited this page Dec 2, 2026 · 4 revisions

parrot.mcp.agent_resources

View source

Agent metadata as MCP resources (FEAT-477, Module 2, OQ8).

Publishes exactly three read-only MCP resources per exposed agent:

  • an identity card — name, role, goal, capabilities, description (the same fields A2A's AgentCard already publishes, a2a/server.py:334)
  • a tool catalog — a browsable manifest of the tools this principal may call, filtered by the same policy as tools/list
  • KB descriptors — which knowledge bases the agent consults (AbstractBot.knowledge_bases, bots/abstract.py:554)

OQ8 — hard exclusion (merge blocker). The agent's system prompt, backstory and rationale are never served here — not policy-gated, excluded outright. Each resource is built from an explicit allowlist of fields, never a denylist, so a future agent attribute cannot leak in by default. Publishing guardrail wording hands an attacker the bypass design.

Attribute ToolPolicyFilter

Function register_agent_resources

Register the three agent metadata resources on server.

Re-registering (e.g. after an OQ5 rebuild following reload_agent()) simply overwrites the same three URIs with handlers closing over the new agent instance — RemoteMCPServerBase.register_resource keys its resource/handler dicts by URI.

register_agent_resources(server: Any, agent_name: str, agent: Any, exposure_names: list[str], policy_filter: ToolPolicyFilter | None = None) -> None

Parameter Type Default Description
server Any The per-agent RemoteMCPServerBase (a StreamableHttpMCPServer) to register resources on.
agent_name str Configured agent name (used to build resource URIs).
agent Any The agent instance to introspect. Resolved fresh by the caller — never cached beyond this call (OQ5).
exposure_names list[str] Names already known to be in the agent's MCP exposure set (TASK-2600), included in the tool catalog alongside agent.tool_manager's own tools.
policy_filter ToolPolicyFilter | None None Optional (agent_name, tool_name) -> bool (or awaitable) hook filtering the tool catalog by the calling principal's policy. None (default) means everything is visible — the stub until TASK-2605's PBAC guard is wired in.

Architecture

Clients

Bots & Agents

Memory

Knowledge

Tools & Toolkits

Flows

Experts

Skills

Stores & Loaders

MCP & A2A

Server & APIs

Integrations

Outputs & A2UI

Prompts

Security

Operations

Migration

SDD Tooling

LLM Wiki

Deployment

Decisions

API Reference

Clone this wiki locally