Skip to content

API Reference parrot.mcp.adapter

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

parrot.mcp.adapter

View source

Alias AbstractTool

Re-exported from parrot.tools.abstract.AbstractTool.

Alias AbstractToolArgsSchema

Re-exported from parrot.tools.abstract.AbstractToolArgsSchema.

Alias AuthRequiredPayload

Re-exported from parrot.auth.credentials.AuthRequiredPayload.

Alias AuthorizationRequired

Re-exported from parrot.auth.exceptions.AuthorizationRequired.

Alias CredentialRequired

Re-exported from parrot.auth.credentials.CredentialRequired.

Class MCPToolAdapter

Adapts AI-Parrot AbstractTool to MCP tool format.

Tools marked routing_meta["requires_confirmation"] (e.g. the destructive members of a toolkit's confirming_tools) get an MCP-side guard: a required confirm boolean is injected into their input schema and the call is rejected unless confirm=true is passed — the stdio transport has no interactive HITL channel, so the explicit argument is the confirmation record.

Parameter Type Default Description
tool AbstractTool
execution_context Optional[ToolExecutionContext] None

Method MCPToolAdapter.to_mcp_tool_definition

Convert AbstractTool to MCP tool definition.

to_mcp_tool_definition() -> dict[str, Any]

Returns: dict[str, Any]

Method MCPToolAdapter.execute

Execute the AI-Parrot tool and convert result to MCP format.

execute(arguments: dict[str, Any]) -> dict[str, Any]

Parameter Type Default Description
arguments dict[str, Any]

Returns: dict[str, Any]

Class ToolExecutionContext

Process-scoped identity for stdio servers; None keeps today's behavior.

identity_error is set when a login exists but could not be bound (unsafe file, unresolvable principal). Tools that declare a credential_provider then fail closed with an authorization-required result instead of running anonymously.

Parameter Type Default Description
permission_context Optional[Any] None
broker Optional[Any] None
channel str 'cli'
identity_error Optional[str] None

Fields:

Field Type Default Description
permission_context Optional[Any] None
broker Optional[Any] None
channel str 'cli'
identity_error Optional[str] None

Method ToolExecutionContext.exec_kwargs

Return reserved kwargs for AbstractTool.execute.

exec_kwargs() -> Dict[str, Any]

Returns: Dict[str, Any]

Alias ToolResult

Re-exported from parrot.tools.abstract.ToolResult.

Function auth_required_result

Return the MCP envelope for a tool that requires authorization.

auth_required_result(payload: AuthRequiredPayload) -> Dict[str, Any]

Parameter Type Default Description
payload AuthRequiredPayload

Returns: Dict[str, Any]

Function identity_unavailable_result

Return the MCP envelope for a credential tool whose login identity could not be bound.

identity_unavailable_result(provider: str, tool_name: Optional[str], reason: str) -> Dict[str, Any]

Parameter Type Default Description
provider str
tool_name Optional[str]
reason str

Returns: Dict[str, Any]

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