Tool Interface Contract
- Entity ID:
ent-20260420-b01a0000000d - Type:
concept - Scope:
shared - Status:
active - Aliases: Tool type, Tool interface, ToolUseContext 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
- Approximately 40 tools live under src/tools/ with a consistent per-directory layout
- Tool.ts is a ~29K-line consolidated types + permission module
Relations
- Tool Interface Contract --[defined_in]--> Tool.ts