Tool Interface Contract

Description

Core contract in src/Tool.ts (~29K LOC file combining tool types + permission system) that every tool must satisfy. Fields include name, description, inputSchema (Zod or JSON Schema), execute function, and permission hooks. ToolUseContext is the execution context object supplied to each tool invocation and carries session/permission/abort state. PermissionResult + needsPermission drive the per-tool authorization flow.

Key claims

Relations

Sources

src-20260420-b8c5e3b30a4f