Skip to content

API Reference parrot.interfaces.tools

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

parrot.interfaces.tools

View source

ToolInterface - Interface for tool management functionality.

This interface provides methods for initializing, managing, and using tools in bot implementations.

Alias AbstractClient

Re-exported from parrot.clients.base.AbstractClient.

Alias AbstractTool

Re-exported from parrot.tools.AbstractTool.

Alias AgentMCPServerSpec

Re-exported from parrot.tools.spec.AgentMCPServerSpec.

Alias DatasetManager

Re-exported from parrot.tools.dataset_manager.tool.DatasetManager.

Alias MCPServerConfig

Re-exported from parrot.mcp.MCPServerConfig.

Alias SUPPORTED_CLIENTS

Re-exported from parrot.clients.factory.SUPPORTED_CLIENTS.

Alias TenantToolingPolicy

Re-exported from parrot.tools.tooling_policy.TenantToolingPolicy.

Alias TenantToolingRefused

Re-exported from parrot.tools.tooling_policy.TenantToolingRefused.

Alias ToolDefinition

Re-exported from parrot.tools.manager.ToolDefinition.

Class ToolInterface

Interface for tool management in bot implementations.

This interface provides methods for:

  • Initializing and registering tools
  • Syncing tools with LLM clients
  • Determining when to use tools
  • Validating tools
  • Configuring LLM clients

Attributes:

Attribute Type Description
pageindex_toolkit Any The bot's PageIndexToolkit instance, or None. Populated by :meth:_initialize_tools when a PageIndex toolkit is wired into the bot. Used by the REST knowledge handler to manage the agent's PageIndex documents.
graphindex_toolkit Any The bot's GraphIndexToolkit instance, or None.
graphindex_builder Any Optional GraphIndexBuilder enabling document ingestion.
has_pageindex_tools bool Whether this bot has PageIndex tools incorporated. True when a PageIndexToolkit instance was captured during tool wiring, or when any registered tool is namespaced under the pageindex prefix.
has_graphindex_tools bool Whether this bot has GraphIndex tools incorporated.
llmwiki_toolkit Any The bot's LLMWikiToolkit instance, or None. Populated by :meth:_initialize_tools when an LLMWikiToolkit is wired into the bot. Provides access to the full wiki lifecycle API (ingest, query, lint, bookkeeping) from REST handlers and other code.
has_llmwiki_tools bool Whether this bot has LLM Wiki tools incorporated. True when an LLMWikiToolkit instance was captured during tool wiring, or when any registered tool is namespaced under the wiki_ prefix.
has_knowledge_index bool Whether the bot exposes any knowledge index (Page or Graph).
tooling_failures list[dict[str, str]] [{"slug", "error"}] of the toolkit/tool specs the last build could not apply (never silently skipped).

Method ToolInterface.bind_tooling_policy

Bind the build-time tenant tooling policy for the next configure() (FEAT-622, RC-9).

bind_tooling_policy(policy: TenantToolingPolicy | None, subject: ToolingSubject, *, owner: str | None = None) -> None

Parameter Type Default Description
policy TenantToolingPolicy | None
subject ToolingSubject
owner str | None None

Raises:

  • RuntimeError — tooling was already applied; a late binding would police nothing.

Method ToolInterface.apply_tooling_specs

Hydrate and register pending toolkit / MCP specs once (FEAT-593). Never raises.

apply_tooling_specs(*, tooling_policy: TenantToolingPolicy | None = None, tooling_subject: ToolingSubject | None = None, tooling_owner: str | None = None) -> list[str]

Parameter Type Default Description
tooling_policy TenantToolingPolicy | None None
tooling_subject ToolingSubject | None None
tooling_owner str | None None

Returns: list[str]

Method ToolInterface.sync_tools

Assign Bot's ToolManager as a reference to LLM's ToolManager.

Instead of copying tools via sync(), we share the same ToolManager instance so that changes to tools are immediately reflected in both places. This allows users to swap the tool_manager at runtime for session-specific toolsets.

sync_tools(llm: AbstractClient = None) -> None

Parameter Type Default Description
llm AbstractClient None

Method ToolInterface.get_tools_summary

Get a comprehensive summary of available tools and configuration.

get_tools_summary() -> Dict[str, Any]

Returns: Dict[str, Any]

Method ToolInterface.validate_tools

Validate all registered tools.

validate_tools() -> Dict[str, Any]

Returns: Dict[str, Any]

Method ToolInterface.register_tool

Register a tool in the shared ToolManager.

Since Bot and LLM share the same ToolManager reference (assigned during configure), we only need to register once. The tool will be immediately available to both.

register_tool(tool: Union[ToolDefinition, AbstractTool] = None, name: str = None, description: str = None, input_schema: Dict[str, Any] = None, function: Callable = None) -> None

Parameter Type Default Description
tool Union[ToolDefinition, AbstractTool] None
name str None
description str None
input_schema Dict[str, Any] None
function Callable None

Method ToolInterface.configure_llm

Configuration of LLM at runtime (during conversation/ask methods)

configure_llm(llm: Union[str, Callable] = None, **kwargs) -> AbstractClient

Parameter Type Default Description
llm Union[str, Callable] None
**kwargs {}

Returns: AbstractClient

Method ToolInterface.llm_chain

llm_chain.

llm_chain(llm: str = 'vertexai', model: str = None, **kwargs) -> AbstractClient

Parameter Type Default Description
llm str 'vertexai' The language model to use.
model str None
**kwargs {}

Returns: AbstractClient — The language model to use.

Alias ToolParamRefused

Re-exported from parrot.tools.tooling_policy.ToolParamRefused.

Alias ToolingSubject

Re-exported from parrot.tools.tooling_policy.ToolingSubject.

Alias ToolkitSpec

Re-exported from parrot.tools.spec.ToolkitSpec.

Alias constructor_server_params

Re-exported from parrot.tools.server_params.constructor_server_params.

Alias get_toolkit_resolver

Re-exported from parrot.tools.resolver.get_toolkit_resolver.

Alias hydrate_mcp

Re-exported from parrot.tools.spec.hydrate_mcp.

Alias hydrate_params

Re-exported from parrot.tools.spec.hydrate_params.

Alias tooling_revision

Re-exported from parrot.tools.spec.tooling_revision.

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