Every export of agentc:tools for TypeScript tools.
import { Schema, Tool, type ToolInput, type ToolOutput } from "agentc:tools";agentc:tools provides the classes and types used to define and invoke a tool. See
tools for the lifecycle shared by every tool.
Validate a tool's parameter schema.
The abstract base class for a tool.
The arguments, state, and optional activity emitter for an invocation.
The result and optional state update from an invocation.
An activity update sent while a tool runs.
new Schema(schema: Record<string, unknown>)Validates a JSON Schema draft 2020-12 document for a tool's parameters.
The schema document.
abstract class Tool<Args, Result, State = unknown> {
static readonly description?: string
static readonly parameters: Schema
abstract execute(input: ToolInput<Args, State>): Promise<ToolOutput<Result>>
}The abstract base class for every tool. Export a subclass and select it with the manifest's export
field. Its optional static description is the tool's description when the manifest's
description is unset. Its static parameters supplies
the model-facing input schema.
A subclass that does not implement execute rejects with a Tool subclass must implement execute.
execute must return a promise.
class ToolInput<Args, State = unknown> {
readonly args: Args
readonly state: State
readonly emit?: (delta: ActivityDelta) => void
}The runtime creates one input for each invocation. Tool code cannot construct it.
The tool arguments.
The current graph state.
Sends a stateless activity update while the tool runs.
type ToolOutput<Result> = {
output: Result
state_update?: PatchDocument
}The value returned by execute. output is required. state_update is optional and contains
RFC 6902 JSON Patch operations. For ReAct state
updates, see state.
type ActivityDelta = {
activity_type: string
patch: PatchDocument
}The value passed to input.emit?.(...). Its patch contains
RFC 6902 JSON Patch operations.
© 2026 pogue.dev. All rights reserved.
CC BY 4.0