Skip to content

API Reference parrot.cli.tool_worker

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

parrot.cli.tool_worker

View source

Worker-side entrypoint for remote tool execution.

This module is what the parrot-tools Docker image invokes: python -m parrot.cli.tool_worker --envelope - reads a :class:~parrot.tools.executors.ToolExecutionEnvelope (JSON) from stdin (or from a file when --envelope is a path) and prints the resulting :class:~parrot.tools.abstract.ToolResult (JSON) to stdout between sentinel markers so the executor that owns the worker can extract the payload from the surrounding logs.

The worker is intentionally minimal:

  • Permission checks have already happened on the caller side. We do not re-enforce them here — the envelope is treated as authoritative.
  • Lifecycle events fire on the caller, not in the worker.
  • The exit code is 0 on a well-formed ToolResult (even one with status="error") and non-zero only when the worker itself fails (invalid envelope, import error, unhandled exception).

Attribute RESULT_BEGIN_MARKER

Attribute RESULT_END_MARKER

Function main

main(argv: list[str] | None = None) -> int

Parameter Type Default Description
argv list[str] | None None

Returns: int

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