Skip to content

featherweight.registry

registry

The tools one attempt of an agent may use, checked together before the model sees any of them.

ToolRegistry

ToolRegistry()

Every tool of one attempt, with where it came from and how the model gets it: the agent's own tools, the tools of its MCP servers, and the ones the runner adds. Adding a tool whose name is taken, or one the model could not be given, raises SetupError. A direct tool is bound to the model; a discoverable one is found with a keyword search.

tools property

tools: list[BaseTool]

The tools bound to the model.

names property

names: list[str]

The names of the bound tools.

add_mcp async

add_mcp(server: MCPServer, lease: Lease) -> None

Add the tools of one of the agent's MCP servers, as this agent's declaration says: the allow-list, the <server>_ prefix, the timeout, the size cap, and whether they are found by search. The connection is shared and knows none of that.

search

search(
    keywords: list[str], k: int = 5
) -> list[RegistryEntry]

The discoverable tools that match the keywords, best first. A tool is indexed by its name (twice, because it is the strongest signal and carries the server's name), its description and the names of its arguments.

input_schema

input_schema(tool: BaseTool) -> dict[str, Any]

The JSON schema of a tool's input: the one an MCP server published, or the one langchain builds.