Documentation Index
Fetch the complete documentation index at: https://docs.xpander.ai/llms.txt
Use this file to discover all available pages before exploring further.
ToolsRepository is the registry that holds every tool an agent can call. There are two kinds:
- Backend tools: connectors and OpenAPI imports configured in the Workbench. Loaded automatically when you
agents.aget(...)an agent. - Local tools: Python functions you decorate with
@register_tool. Registered in-process and merged into the agent’s tool list.
ToolsRepository directly: accessing agent.tools gives you the configured instance for that agent.
Class layout
| Type | Reference |
|---|---|
ToolsRepository | This page |
Tool | Tool class |
@register_tool decorator | register_tool |
| MCP types | MCP |
| Tool lifecycle hooks | @on_tool_* |
Constructor
| Parameter | Type | Default | Description |
|---|---|---|---|
configuration | Configuration | Configuration() | SDK configuration. |
tools | list[Tool] | [] | Backend-managed tools to seed the repository. |
agent_graph | AgentGraph | None | Owning agent’s graph (for schema overrides). |
is_async | bool | True | Whether .functions should produce async callables. |
agents.aget(...) constructs a ToolsRepository for you with all four arguments populated.
Properties
list
id). Each tool has its Configuration set and any agent-graph schema overrides applied.
functions
.list. Each callable accepts a single payload argument validated against the tool’s auto-generated Pydantic schema. The callable’s __name__ is the tool id and its __doc__ includes a usage example.
This is what Backend.aget_args injects into your framework agent’s tools=... parameter: you rarely need it directly. Useful when binding tools to a custom framework manually.
Methods
get_tool_by_id
id, or None.
get_tool_by_name
name (display name), or None.
register_tool (classmethod)
@register_tool decorator: you don’t usually call this directly.
should_sync_local_tools
True when at least one local tool is marked should_add_to_graph=True and hasn’t been synced yet.
get_local_tools_for_sync
agent.aload).
aload_tool_by_id
connector_id_operation_id form (e.g. "slack_postMessage") and seeds it into the repository. Useful when you want to invoke a single tool without loading an agent.
The sync sibling is load_tool_by_id.

