Skip to content

API Reference parrot.tools.resolver

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

parrot.tools.resolver

View source

Single slug → class authority for toolkits and tools (FEAT-622 M1).

Merges, in order: built-in explicit entries, parrot_tools.TOOL_REGISTRY and the host's declared plugins.tools.TOOL_REGISTRY (prefixed by HOST_TOOL_PREFIX). Never mutates any registry.

Alias AbstractToolkit

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

Class ToolkitEntry

One resolvable slug.

Fields:

Field Type Default Description
slug str
dotted_path str | None
source Literal['builtin', 'parrot_tools', 'host', 'walk']

Attributes:

Attribute Type Description
is_host bool Host code: a declared plugins.tools entry or one found by the deprecated walk fallback.

Class ToolkitResolver

Process-wide, lazily built, read-only resolver (spec §2 "Resolution rules").

Method ToolkitResolver.entries

Every entry, sorted by slug (catalogue and policy use this).

entries() -> list[ToolkitEntry]

Returns: list[ToolkitEntry]

Method ToolkitResolver.entry

Case-insensitive lookup by slug or class-name alias; returns entries whose class cannot be imported too.

entry(slug: str) -> ToolkitEntry | None

Parameter Type Default Description
slug str

Returns: ToolkitEntry | None

Method ToolkitResolver.canonical_slug

Declared slug for a slug or class-name alias ("JiraToolkit" → "jira"); None when unknown.

canonical_slug(name: str) -> str | None

Parameter Type Default Description
name str

Returns: str | None

Method ToolkitResolver.is_host_class

True iff cls is the class of a host entry (declared host or walked), never stamped on the class.

is_host_class(cls: type) -> bool

Parameter Type Default Description
cls type

Returns: bool

Method ToolkitResolver.resolve

Case-insensitive slug (or class-name alias) → class; None when unknown or unimportable.

resolve(slug: str) -> type | None

Parameter Type Default Description
slug str

Returns: type | None

Method ToolkitResolver.registry_paths

Slug → dotted path of every non-host entry (built-ins from their class) (host paths are never listed).

registry_paths() -> dict[str, str]

Returns: dict[str, str]

Method ToolkitResolver.reload

Drop the cache (tests / hot reload only).

reload() -> None

Alias discover_from_walk

Re-exported from parrot.tools.discovery.discover_from_walk.

Function get_toolkit_resolver

Return the process-wide resolver, building it lazily on first use.

get_toolkit_resolver() -> ToolkitResolver

Returns: ToolkitResolver

Attribute logger

Alias resolve_class

Re-exported from parrot.tools.discovery.resolve_class.

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