Skip to content

API Reference parrot.tools.manager

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

parrot.tools.manager

View source

Alias AbstractPermissionResolver

Re-exported from parrot.auth.resolver.AbstractPermissionResolver.

Alias AbstractTool

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

Alias AbstractToolkit

Re-exported from parrot.tools.toolkit.AbstractToolkit.

Alias AgentCard

Re-exported from parrot.a2a.models.AgentCard.

Alias AuthorizationRequired

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

Alias BudgetError

Re-exported from parrot.core.exceptions.BudgetError.

Alias BudgetRouter

Re-exported from parrot.tools.compression.budget.BudgetRouter.

Alias CompressionStage

Re-exported from parrot.tools.compression.CompressionStage.

Alias CompressionTee

Re-exported from parrot.tools.compression.tee.CompressionTee.

Alias CompressorRegistry

Re-exported from parrot.tools.compression.CompressorRegistry.

Alias ConfirmationGuard

Re-exported from parrot.auth.confirmation.ConfirmationGuard.

Alias CredentialRequired

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

Alias GrantGuard

Re-exported from parrot.auth.grants.GrantGuard.

Alias MCPToolManagerMixin

Re-exported from parrot.tools.mcp_mixin.MCPToolManagerMixin.

Alias PermissionContext

Re-exported from parrot.auth.permission.PermissionContext.

Alias RegisteredAgent

Re-exported from parrot.a2a.models.RegisteredAgent.

Class ToolDefinition

Data structure for tool definition.

Parameter Type Default Description
name str
description str
input_schema Dict[str, Any]
function Callable
routing_meta Dict[str, Any] dict()
required_permissions Set[str] set()

Fields:

Field Type Default Description
name str
description str
input_schema Dict[str, Any]
function Callable
routing_meta Dict[str, Any] field(default_factory=dict)
required_permissions Set[str] field(default_factory=set)

Alias ToolExecutionRoute

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

Class ToolFormat

Enum for different tool format requirements by LLM providers.

Class ToolManager

Unified tool manager for handling tools across AbstractBot and AbstractClient.

Capabilities:

  • Local tool registration and execution
  • MCP server management (via MCPToolManagerMixin)
  • Tool schema generation for LLM providers
Parameter Type Default Description
logger Optional[logging.Logger] None Logger instance
debug bool False Enable debug logging
include_search_tool bool False Whether to include the 'search_tools' meta-tool. Set to False for agents that rely on RAG context rather than dynamic tool discovery. Default is True.
resolver Optional['AbstractPermissionResolver'] None Optional permission resolver for Layer 2 enforcement. If None, no permission enforcement is applied (backward compatible).
execution_policy Optional[Any] None Optional :class:~parrot.tools.executors.ExecutionPolicy (or a dict coercible to one) that routes matching tools/toolkits to remote executors at registration time. Tools constructed with an explicit executor= are never overridden.

Attributes:

Attribute Type Description
auto_share_dataframes bool
auto_push_to_pandas bool
enable_redaction bool
pandas_tool_name str
resolver Optional['AbstractPermissionResolver'] Get the current permission resolver.
execution_policy Return the active ExecutionPolicy, or None.
broker Optional[Any] Return the credential broker, or None if none is configured.
grant_guard Optional[GrantGuard] Return the current grant guard, or None if not configured.
confirmation_guard Optional['ConfirmationGuard'] Return the current confirmation guard, or None if not configured.
tools List[AbstractTool] Get list of registered tool instances.
invocation_observer Optional[Any] The installed invocation observer, or None.

Method ToolManager.set_resolver

Set or swap the permission resolver at runtime.

This allows changing the resolver after initialization, useful for:

  • Upgrading permissions after authentication
  • Switching resolvers for different contexts
  • Testing with different permission configurations

set_resolver(resolver: 'AbstractPermissionResolver') -> None

Parameter Type Default Description
resolver 'AbstractPermissionResolver' The new permission resolver to use.

Method ToolManager.set_execution_policy

Set the execution policy; this manager owns it from now on.

Every dispatch of a tool this policy matches resolves its route from it (:meth:_execution_route_for, FEAT-933). Already-registered tools get the registration-time fallback route that direct tool.execute() calls, and dispatches through managers without a matching rule, use (:meth:_apply_execution_policy). :meth:close_executors closes the policy's executors only on the manager that set it.

set_execution_policy(policy: Any) -> None

Parameter Type Default Description
policy Any An :class:~parrot.tools.executors.ExecutionPolicy instance or a dict coercible to one (e.g. {"rules": {"python_repl": "docker"}}).

Method ToolManager.close_executors

Close every executor the execution policy instantiated.

Called from the owning bot's shutdown path. Idempotent. A no-op on a :meth:clone: the policy is shared by reference and only the manager that set it (:meth:set_execution_policy) closes its executors (FEAT-933).

close_executors() -> None

Method ToolManager.set_broker

Set the credential broker that gates credentialed tool calls.

set_broker(broker: Any) -> None

Parameter Type Default Description
broker Any A :class:~parrot.auth.broker.CredentialBroker instance.

Method ToolManager.set_grant_guard

Set the grant guard for tool-level bounded approval windows.

When set, tools with routing_meta["requires_grant"] = True will require an active grant or HITL approval before execution. Tools without this flag are unaffected.

This is an additive change: without a guard configured, execute_tool behaves identically to its current behaviour.

set_grant_guard(guard: 'GrantGuard') -> None

Parameter Type Default Description
guard 'GrantGuard' The GrantGuard instance to use for authorization decisions.

Method ToolManager.set_confirmation_guard

Set the confirmation guard for per-call HITL tool-call review.

When set, tools with routing_meta["requires_confirmation"] = True will require human confirmation (approve / cancel / edit) before execution. Tools without this flag are unaffected.

The confirm check runs after the grant check (order: grant → confirm). This is purely additive: without a guard configured, execute_tool behaves identically to today.

set_confirmation_guard(guard: 'ConfirmationGuard') -> None

Parameter Type Default Description
guard 'ConfirmationGuard' The ConfirmationGuard instance to use for confirmation decisions.

Method ToolManager.set_toolkit_param_hook

Bind (or clear, with None) the host hook every toolkit this manager constructs goes through.

subject is the :class:~parrot.tools.tooling_policy.ToolingSubject handed to the hook; see :mod:parrot.tools.host_hooks for the hook contract.

set_toolkit_param_hook(hook: Optional[Callable[..., Any]], subject: Any = None) -> None

Parameter Type Default Description
hook Optional[Callable[..., Any]]
subject Any None

Method ToolManager.hooked_toolkit_params

(final constructor params, forced exclude_tools) of slug after the host hook.

Without a bound hook the params come back unchanged. Raises ToolParamRefused (a TenantToolingRefused) when the hook refuses; phase overrides the bound subject's phase (e.g. attach for a live assignment).

hooked_toolkit_params(slug: str, params: Dict[str, Any], *, phase: Optional[str] = None) -> tuple[Dict[str, Any], tuple[str, ...]]

Parameter Type Default Description
slug str
params Dict[str, Any]
phase Optional[str] None

Returns: tuple[Dict[str, Any], tuple[str, ...]]

Method ToolManager.set_server_param_source

Bind the mapping (the aiohttp app) every tool/toolkit this manager constructs gets its server-managed source="app" constructor params from (e.g. artifact_store), whichever path builds it.

set_server_param_source(source: Optional[Any]) -> None

Parameter Type Default Description
source Optional[Any]

Method ToolManager.server_filled_params

Constructor values the server owns for cls: source="app" params found in the bound source.

server_filled_params(cls: type) -> Dict[str, Any]

Parameter Type Default Description
cls type

Returns: Dict[str, Any]

Method ToolManager.build_toolkit

Construct cls(**params) for a toolkit OR a standalone tool: server-managed params filled, then the host hook (forced values applied, exclude_tools set on the instance). Identical to cls(**params) when neither a hook nor a server-param source is bound.

build_toolkit(cls: type, slug: str, params: Dict[str, Any], *, phase: Optional[str] = None) -> Any

Parameter Type Default Description
cls type
slug str
params Dict[str, Any]
phase Optional[str] None

Returns: Any

Method ToolManager.rank_tools

Rank registered tools by relevance to query, best first.

Replaces the substring-match + alphabetical-sort behaviour that search_tools() implemented inline; search_tools() now formats this method's output as JSON for LLM consumption. Scoring is purely lexical (token overlap over tool name + description); ties are broken deterministically by name so results are stable across calls and safe to cache.

rank_tools(query: str, limit: int = 15) -> list[tuple[float, Any]]

Parameter Type Default Description
query str Relevance query (e.g. the turn's prompt).
limit int 15 Maximum number of ranked tools to return.

Returns: list[tuple[float, Any]] — List of (score, tool) tuples, best score first. tool is the raw registered object (ToolDefinition or AbstractTool); internal tools (_INTERNAL_TOOL_NAMES — search_tools and read_omitted_content) are always excluded.

Method ToolManager.search_tools

Search for tools by name or description.

Thin JSON-formatting wrapper over rank_tools() (FEAT-434): results are now relevance-ordered instead of alphabetically ordered — flagged in the changelog — but the return type, JSON shape, and no-match message are unchanged.

search_tools(query: str, limit: int = 15) -> str

Parameter Type Default Description
query str Search query
limit int 15 Max results

Returns: str — JSON string list of matching tools with descriptions

Method ToolManager.default_tools

default_tools(tools: list = None) -> List[AbstractTool]

Parameter Type Default Description
tools list None

Returns: List[AbstractTool]

Method ToolManager.sync

Sync tools from another ToolManager instance.

sync(other_manager: 'ToolManager') -> None

Parameter Type Default Description
other_manager 'ToolManager' Another ToolManager instance to sync from

Method ToolManager.add_tool

Add a tool to the manager.

add_tool(tool: Union[ToolDefinition, AbstractTool], name: Optional[str] = None) -> None

Parameter Type Default Description
tool Union[ToolDefinition, AbstractTool] Tool instance (AbstractTool or ToolDefinition)
name Optional[str] None Optional custom name for the tool

Method ToolManager.register_tool

Register a tool in the unified format.

register_tool(tool: Union[dict, 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[dict, ToolDefinition, AbstractTool] None Tool instance (AbstractTool, ToolDefinition, or dict)
name str None Optional custom name for the tool
description str None
input_schema Dict[str, Any] None
function Callable None

Method ToolManager.register

Alias for register_tool with optional CapabilityRegistry auto-registration.

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

Parameter Type Default Description
tool Union[dict, ToolDefinition, AbstractTool] None Tool to register (dict, ToolDefinition, or AbstractTool).
name str None Optional name override.
description str None Optional description override.
input_schema Dict[str, Any] None Optional input schema override.
function Callable None Optional callable override.
capability_registry None Optional CapabilityRegistry. When provided, calls registry.register_from_tool(tool) after registration.

Method ToolManager.register_tools

Register multiple tools from list or dictionary.

register_tools(tools: List[Union[ToolDefinition, AbstractTool]]) -> None

Parameter Type Default Description
tools List[Union[ToolDefinition, AbstractTool]] List of tools or dictionary of tools

Method ToolManager.load_tool

Load a tool by name.

Resolution order:

  1. An already-registered tool with this name (no-op success).
  2. The discovered TOOL_REGISTRY (from ai-parrot-tools and plugins.tools), matched case-insensitively against the canonical tool name. This covers every individual tool shipped by parrot_tools — e.g. ibisworld, yfinance, web_scraping_tool — which the legacy import path below cannot resolve.
  3. The legacy parrot.tools.<name> module import, kept for backward compatibility with historically-named tools.

load_tool(tool_name: str, **kwargs) -> bool

Parameter Type Default Description
tool_name str Name of the tool to load.
**kwargs {} Arguments forwarded to the tool/toolkit constructor.

Returns: bool — True if a tool (or toolkit) was registered, False otherwise.

Method ToolManager.register_toolkit

Register all tools from a toolkit.

Re-registration is a no-op that keeps the FIRST registration: when a toolkit of the same exact class and the same tool_prefix is already registered, its registered tools are returned and nothing is mutated — a name or class is not even constructed. A name claimed by a DIFFERENT owner still raises ToolNameCollisionError.

This method supports multiple input types:

  • String: Looks up the toolkit by name in SUPPORTED_TOOLKITS registry
  • Class: Instantiates the toolkit class with provided kwargs
  • Instance: Uses the toolkit instance directly

register_toolkit(toolkit: Union[str, 'AbstractToolkit', type], **kwargs) -> List[AbstractTool]

Parameter Type Default Description
toolkit Union[str, 'AbstractToolkit', type] Toolkit name (str), toolkit class, or toolkit instance
**kwargs {} Arguments to pass to toolkit constructor if instantiating

Returns: List[AbstractTool] — List of registered AbstractTool instances

Raises:

  • ValueError — If toolkit name is not found or invalid type provided

Method ToolManager.get_tool_schemas

Get tool schemas formatted for specific LLM provider.

get_tool_schemas(provider_format: ToolFormat = ToolFormat.GENERIC) -> List[Dict[str, Any]]

Parameter Type Default Description
provider_format ToolFormat ToolFormat.GENERIC Target provider format

Returns: List[Dict[str, Any]] — List of tool schemas compatible with the provider

Method ToolManager.get_tool

Get tool instance by name.

get_tool(tool_name: str) -> Optional[Any]

Parameter Type Default Description
tool_name str Name of the tool

Returns: Optional[Any] — Tool instance or None

Method ToolManager.list_categories

List available tool categories.

list_categories() -> List[str]

Returns: List[str]

Method ToolManager.get_tools_by_category

Get tools by category.

get_tools_by_category(category: str) -> List[str]

Parameter Type Default Description
category str

Returns: List[str]

Method ToolManager.list_tools

Get list of registered tool names.

list_tools() -> List[str]

Returns: List[str]

Method ToolManager.get_tools

Get all registered tools.

get_tools() -> Dict[str, Any]

Returns: Dict[str, Any]

Method ToolManager.get_all_tools

Get all registered tool instances.

get_all_tools() -> List[Union[ToolDefinition, AbstractTool]]

Returns: List[Union[ToolDefinition, AbstractTool]]

Method ToolManager.all_tools

Get all registered tools with their schemas as a generator.

all_tools() -> Generator[Any, Any, Any]

Returns: Generator[Any, Any, Any] — List of tool schemas

Method ToolManager.unregister_tool

Unregister a tool by name.

unregister_tool(tool_name: str) -> bool

Parameter Type Default Description
tool_name str

Returns: bool

Method ToolManager.clear_tools

Clear all registered tools.

clear_tools() -> None

Method ToolManager.remove_tool

Remove a tool by name.

remove_tool(tool_name: str) -> None

Parameter Type Default Description
tool_name str Name of the tool to remove

Method ToolManager.build_tools_description

Build formatted tool descriptions for system prompts.

build_tools_description(format_style: str = 'compact', include_parameters: bool = True, include_examples: bool = False, max_tools: Optional[int] = None) -> str

Parameter Type Default Description
format_style str 'compact' Style of formatting ("detailed", "compact", "list", "markdown")
include_parameters bool True Whether to include parameter details
include_examples bool False Whether to include usage examples
max_tools Optional[int] None Maximum number of tools to include (None for all)

Returns: str — Formatted string describing all available tools

Method ToolManager.get_tools_summary

Get a summary of all registered tools.

get_tools_summary() -> Dict[str, Any]

Returns: Dict[str, Any] — Dictionary with tool count and basic information

Method ToolManager.set_invocation_observer

Install (or remove) the FEAT-538 invocation observer.

Opt-in and per-manager. A :meth:clone deliberately does NOT inherit it: clones share tool instances but own their mutable state, and a shared observer would let one clone's turn capture collect another clone's calls.

set_invocation_observer(observer: Optional[Any]) -> None

Parameter Type Default Description
observer Optional[Any] An observer exposing begin/finish/ cancelled/not_executed, or None to detach.

Method ToolManager.execute_tool

Execute a registered tool function.

Public entry point. Behaviour is defined by :meth:_execute_tool_impl; this wrapper only adds the optional FEAT-538 observer, and is a direct pass-through when none is installed.

The split exists so that dispatches which never reach a tool body — an unknown tool, a guardrail or grant denial, an authorization requirement — can be classified as unsuccessful dispatch outcomes with executed=False. They must never receive a fictitious tool_started: recording a start for a call that did not run would claim an execution that never happened and corrupt the journal's attempt counts.

execute_tool(tool_name: str, parameters: Dict[str, Any], permission_context: Optional['PermissionContext'] = None, *, return_tool_result: bool = False, request_tools: Optional[Mapping[str, Any]] = None) -> Any

Parameter Type Default Description
tool_name str Name of the tool to execute.
parameters Dict[str, Any] Tool parameters/arguments.
permission_context Optional['PermissionContext'] None Optional permission context (see :meth:_execute_tool_impl).
return_tool_result bool False Opt-in full-result mode (FEAT-536).
request_tools Optional[Mapping[str, Any]] None Optional request-local tools, which take precedence over persistent registrations without modifying the manager registry.

Returns: Any — Exactly what :meth:_execute_tool_impl returns.

Method ToolManager.register_a2a_agent

Register an A2A agent by its URL.

register_a2a_agent(url: str) -> RegisteredAgent

Parameter Type Default Description
url str The base URL of the A2A agent.

Returns: RegisteredAgent — The registered agent object.

Raises:

  • Exception — If registration fails or agent is unreachable.

Method ToolManager.get_a2a_agents

Get all registered A2A agents.

get_a2a_agents() -> List[RegisteredAgent]

Returns: List[RegisteredAgent]

Method ToolManager.get_by_skill

Get agents that have a specific skill (by ID or name substring).

get_by_skill(skill: str) -> List[RegisteredAgent]

Parameter Type Default Description
skill str

Returns: List[RegisteredAgent]

Method ToolManager.get_by_tag

Get agents that have a specific tag.

get_by_tag(tag: str) -> List[RegisteredAgent]

Parameter Type Default Description
tag str

Returns: List[RegisteredAgent]

Method ToolManager.search_a2a_agents

Search agents by name, description, tags, or skills.

search_a2a_agents(query: str) -> List[RegisteredAgent]

Parameter Type Default Description
query str

Returns: List[RegisteredAgent]

Method ToolManager.list_a2a_agents

List names of registered A2A agents.

list_a2a_agents() -> List[str]

Returns: List[str]

Method ToolManager.execute_tool_call

Execute a single tool call and return the result.

execute_tool_call(content_block: Dict[str, Any], permission_context: Optional['PermissionContext'] = None) -> Dict[str, Any]

Parameter Type Default Description
content_block Dict[str, Any] Tool-use content block with name, input, and id keys.
permission_context Optional['PermissionContext'] None Optional permission context, forwarded to execute_tool() for enforcement (FEAT-474 G7). Fail-open default preserved when omitted.

Returns: Dict[str, Any]

Method ToolManager.find_registered_toolkit

Return the first registered instance of toolkit_cls, or None.

Matches on the exact class and, when tool_prefix is given, on an equal prefix. A None prefix means that no prefix filter is applied.

find_registered_toolkit(toolkit_cls: type, *, tool_prefix: Optional[str] = None) -> Optional['AbstractToolkit']

Parameter Type Default Description
toolkit_cls type The toolkit class to find.
tool_prefix Optional[str] None Optional prefix filter.

Returns: Optional['AbstractToolkit'] — The first matching registered toolkit, or None.

Method ToolManager.tool_count

Get the number of registered tools.

tool_count() -> int

Returns: int

Method ToolManager.clone

Return a new ToolManager sharing this manager's tool registrations.

Designed for per-user session isolation (Telegram, MS Teams, Slack, HTTP) where every user must get their own manager so credential state cached on the manager cannot leak across concurrent users. The cloned manager reuses the same tool instances by reference so LLM schemas stay identical — credential isolation is expected to happen at the tool-invocation layer via CredentialResolver.

Not cloned (each user gets a fresh, independent copy): - _shared (dataframe registry) - _registered_agents (per-session agent bindings) - _result_hooks - _wired_toolkits (auto-wire tracking) - MCP state initialised by _init_mcp - FEAT-380 compression metrics/circuit-breaker state (_compression_router and _compression_stage's router): one user's degraded codec must never leak into another's session. The _compression_registry (parsed TOML config) IS shared by reference — schemas must stay identical across users, and re-parsing per clone would be wasted I/O. - FEAT-380 _compression_tee (TASK-1953): each clone gets its own tee (fresh retention/counters) from its own __init__, (re)bound to whatever WorkingMemoryToolkit THAT clone has registered — a shared tee would let one session's teed payloads evict another's.

Carried by reference (the owning bot's guardrail configuration — a clone must never be a way around it): - _tool_call_pipeline (PA-10, TOOL_CALL guardrails) - enable_redaction and _tool_output_pipeline (FEAT-932, TOOL_OUTPUT guards; applied per dispatch, never stamped onto the shared tool instances) - _execution_policy (FEAT-933, executor routing; resolved per dispatch, not owned by the clone, so its close_executors() leaves the bot's executors open)

clone(*, include_search_tool: bool = False) -> 'ToolManager'

Parameter Type Default Description
include_search_tool bool False Whether the clone should auto-register the search_tools meta-tool. Defaults to False so the copy inherits exactly the tools the original carries, avoiding a duplicate registration when the original already included it.

Returns: 'ToolManager' — A new ToolManager whose _tools dict holds the same references as this one but whose mutable state is independent.

Method ToolManager.share_dataframe

Store df in shared context and push into python_pandas if present.

FEAT-380 (TASK-1945): pushing into python_pandas here only updates the tool's host-side df_locals bookkeeping (via add_dataframe() -> _process_dataframes()) — the actual cross-process delivery into the worker's namespace (Arrow IPC/shm, pickle fallback) happens lazily, transparently, the next time that tool's worker is acquired (PythonPandasTool._get_worker_handle(), TASK-1944's diff-based seeding, upgraded to Arrow by TASK-1945). This method stays synchronous (its own call sites are), so it cannot await that round-trip directly.

share_dataframe(name: str, df: 'pd.DataFrame', meta: Dict[str, Any] = None) -> str

Parameter Type Default Description
name str
df 'pd.DataFrame'
meta Dict[str, Any] None

Returns: str

Method ToolManager.get_shared_dataframe

get_shared_dataframe(name: str) -> 'pd.DataFrame'

Parameter Type Default Description
name str

Returns: 'pd.DataFrame'

Method ToolManager.list_shared_dataframes

list_shared_dataframes() -> List[str]

Returns: List[str]

Method ToolManager.clear_shared

clear_shared() -> None

Method ToolManager.add_result_hook

Register a function(tool_name, result, metadata) -> None run after each tool.

add_result_hook(fn: Callable[[str, Any, Dict[str, Any]], None]) -> None

Parameter Type Default Description
fn Callable[[str, Any, Dict[str, Any]], None]

Method ToolManager.cleanup_toolkits

Close all registered toolkits that hold resources (DB pools, etc.).

Iterates the registered tools, finds unique parent toolkit instances (via ToolkitTool.bound_method.__self__), and calls cleanup() or stop() on each. Failures are logged and isolated so one misbehaving toolkit cannot block the rest.

FEAT-391: before the existing cleanup()/stop() call, releases any resources acquired via the _open()/_ensure_open() lazy lifecycle by calling _close() on every toolkit (Phase 1) and on every standalone (non-toolkit) tool (Phase 2) that has _opened set. _close() errors are caught and logged, matching the existing error-isolation pattern, so one broken toolkit/tool never blocks cleanup of the rest.

Resetting _opened is framework-enforced here, not merely left to each _close() override's discipline: this method always sets _opened = False after attempting _close() — whether it succeeded, raised, or was a subclass override that forgot to call super()._close() — so a forgetful override cannot permanently wedge the toolkit/tool into "always considered open".

cleanup_toolkits() -> None

Class ToolNameCollisionError

Raised when two toolkits try to register the same tool name.

Only raised for tools originating from toolkits that opted into namespacing via AbstractToolkit.tool_prefix. Legacy (unprefixed) tools fall back to the previous warn-and-skip behaviour to avoid breaking untouched toolkits during the migration.

Alias ToolOutputGuards

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

Alias ToolResult

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

Class ToolSchemaAdapter

Adapter class to convert tool schemas between different LLM provider formats.

Method ToolSchemaAdapter.clean_schema_for_provider

Clean and adapt tool schema for specific LLM provider requirements.

clean_schema_for_provider(schema: Dict[str, Any], provider: ToolFormat) -> Dict[str, Any]

Parameter Type Default Description
schema Dict[str, Any] Original tool schema
provider ToolFormat Target LLM provider format

Returns: Dict[str, Any] — Cleaned schema compatible with the provider

Alias capture_tool_attempt

Re-exported from parrot.memory.agent_memory.attribution.capture_tool_attempt.

Alias current_turn_tracker

Re-exported from parrot.auth.retry_safety.current_turn_tracker.

Function get_toolkit_owner

Return the toolkit that owns tool, or None.

A toolkit is reachable two ways: it is registered directly (tool IS an AbstractToolkit), or one of its methods is registered as a ToolkitTool whose bound_method.__self__ is the owner. Anything else (plain AbstractTool, ToolDefinition, None) has no owner.

get_toolkit_owner(tool: Any) -> Optional['AbstractToolkit']

Parameter Type Default Description
tool Any Any object a ToolManager iterable may yield.

Returns: Optional['AbstractToolkit'] — The owning AbstractToolkit instance, or None.

Alias record_auth_requirement

Re-exported from parrot.auth.pending.record_auth_requirement.

Alias tool_execution_route_scope

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

Alias tool_output_guards_scope

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

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