Skip to content

API Reference parrot.tools.execution_plan.catalog

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

parrot.tools.execution_plan.catalog

View source

Tool catalog + allowlist validation layering (spec §3 Module 5).

An ExecutionPlan is code written by a model that may share its ToolManager with writers, so the explicit allowed_tools allowlist is both the security boundary — a plan naming a non-allowlisted tool fails validation before any tool runs — and the planner's tool catalog (the planner only ever sees allowlisted tools). The frozen parrot.bots.flows.plan.validator module knows nothing about allowlists; the tool_not_allowed check is layered on top here, never patched into it.

Class ArgSummary

Compact rendering of one tool argument — never the full JSON schema.

Fields:

Field Type Default Description
name str
type str
required bool
description str ''

Class ToolCatalogEntry

One tool the planner (and the allowlist) may reference.

Fields:

Field Type Default Description
name str Registered tool name.
description str Tool description, bounded to :data:_MAX_DESCRIPTION_CHARS.
args_summary List[ArgSummary] Compact per-argument summaries; empty for a tool with no declared args_schema (or the default AbstractToolArgsSchema).

Function build_catalog

Build the catalog = allowed_tools ∩ tool_manager.list_tools().

build_catalog(tool_manager: Any, allowed_tools: Optional[Sequence[str]] = None) -> List[ToolCatalogEntry]

Parameter Type Default Description
tool_manager Any Live manager exposing list_tools()/get_tool().
allowed_tools Optional[Sequence[str]] None Explicit allowlist. None means every manager tool is allowed.

Returns: List[ToolCatalogEntry] — Catalog entries, in tool_manager.list_tools() order (stable — never re-sorted by allowlist order or set iteration).

Raises:

  • ValueError — If allowed_tools names a tool the manager does not have registered — a misconfigured allowlist must not fail silently.

Function check_allowlist

Return one tool_not_allowed issue per node outside allowed_tools.

check_allowlist(plan: ExecutionPlan, allowed_tools: Optional[Sequence[str]]) -> List[ValidationIssue]

Parameter Type Default Description
plan ExecutionPlan The plan being validated.
allowed_tools Optional[Sequence[str]] Explicit allowlist. None means every tool is allowed (no issues raised).

Returns: List[ValidationIssue] — Error-severity :class:ValidationIssues, phrased so a planner model can correct the plan directly.

Function validate_with_allowlist

Run validate_plan and append allowlist issues into the same report.

validate_with_allowlist(plan: ExecutionPlan, tool_manager: Optional[Any], allowed_tools: Optional[Sequence[str]] = None, *, check_guards: bool = True, delegates: Optional[Sequence[Any]] = None, allow_delegate_side_effects: bool = False) -> ValidationReport

Parameter Type Default Description
plan ExecutionPlan The plan to validate.
tool_manager Optional[Any] Live manager, forwarded to validate_plan.
allowed_tools Optional[Sequence[str]] None Explicit allowlist forwarded to :func:check_allowlist.
check_guards bool True Forwarded to validate_plan.
delegates Optional[Sequence[Any]] None Delegate chain forwarded to validate_plan.
allow_delegate_side_effects bool False Host delegate side-effect policy forwarded to validate_plan.

Returns: ValidationReport — The single, combined :class:ValidationReport — validator issues and allowlist issues in one pass, one list.

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