Skip to content

API Reference parrot.integrations.agentd.tools

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

parrot.integrations.agentd.tools

View source

Derive LLM tools from an agentd daemon's exposed_methods allowlist.

exposed_methods and the agent's LLM toolbox were two disconnected surfaces: the allowlist governs agent.invoke (RPC, the MCP proxy, /invoke in the REPL), while the tools the model may call during a conversation come from the agent's own agent_tools(). A daemon could therefore expose sync_transcripts over RPC while the agent, asked the very thing that method answers, had no way to call it — it would apologise instead of acting.

This module closes that gap: for each allowlisted method it builds an AbstractTool whose argument schema is derived from the method signature and whose description comes from its docstring, so declaring a method in exposed_methods is enough for the model to reach it.

Wired from AgentDaemon.run(); opt out (or narrow the set) with AgentServiceConfig.expose_as_tools.

Alias AbstractTool

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

Alias ToolResult

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

Function build_method_tools

Build one AbstractTool per agent method name.

Methods that cannot be turned into a tool are skipped with a warning rather than raising: a malformed signature on one method must not stop a daemon from booting.

build_method_tools(agent: Any, method_names: Sequence[str], skip_existing: Iterable[str] = ()) -> list[AbstractTool]

Parameter Type Default Description
agent Any The agent instance owning the methods.
method_names Sequence[str] Method names to expose (typically AgentServiceConfig.exposed_methods).
skip_existing Iterable[str] () Tool names the agent already registers, so a hand-written tool always wins over a derived one.

Returns: list[AbstractTool] — The derived tools, in the order the names were given.

Attribute logger

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