Every export of agentc_tools for Python tools.
from agentc_tools import Schema, Tool, ToolInput, ToolOutputagentc_tools provides the classes used to define and invoke a tool. See
tools for the lifecycle shared by every tool.
Validate a tool's parameter schema.
The base class for a tool.
The arguments, state, and optional activity emitter for an invocation.
The output and optional state update from an invocation.
Schema(schema: dict[str, object] | bool)Validates a JSON Schema draft 2020-12 document for a tool's parameters. Construct it in the class body, so an invalid schema fails the module import.
A copy of the schema document.
class Tool[Args, Result, State = Any]:
description: ClassVar[str | None] = None
parameters: ClassVar[Schema]
async def execute(self, input: ToolInput[Args, State], /) -> ToolOutput[Result]The base class for every tool. Export a subclass and select it with the manifest's export field.
The type arguments declare the argument type, the result type and the state type, read from the
subclass's own Tool[...] base. Omit the state type when its Any default is sufficient.
description is optional and is the tool's description when the manifest's
description is unset. parameters is required and
supplies the model-facing input schema.
A subclass that does not implement execute raises NotImplementedError: a Tool subclass must implement execute. execute must be async. A subclass that defines __init__ must call
super().__init__().
class ToolInput[Args, State = Any]:
args: Args
state: State
emit: Callable[[str, list[dict]], None] | NoneThe runtime creates one input for each invocation. Tool code cannot construct it.
An instance of Args when it is a dataclass, built from the invocation's arguments with fields
the dataclass does not declare dropped. Otherwise the JSON value, as a dict. Only the top level
is converted, so a nested object arrives as a dict.
A copy of the current graph state, converted like args when State is declared. None when
the invocation has no state.
Sends a stateless activity update while the tool runs. Takes activity_type and patch, a list
of RFC 6902 JSON Patch operations. None when
the invocation has no emitter. Updates sent after the invocation ends are dropped.
ToolOutput(output: Result, *, state_update: list[dict] | None = None)The value returned by execute. A dataclass output is converted with dataclasses.asdict, and
any other output must already be JSON data. state_update contains
RFC 6902 JSON Patch operations. For ReAct state
updates, see state.
© 2026 pogue.dev. All rights reserved.
CC BY 4.0