Import
Examples
Basic tool
Use with an agent
API
tool(config)
Create typed tool (Zod-validated)
| Property | Type | Description |
|---|---|---|
id? | string | Tool identifier (optional, inferred from filename) |
description | string | Tool description for the AI model |
inputSchema | z.ZodSchema<TInput> | Input schema (Zod schema) |
allowUnknownSchema? | boolean | Allow unknown/non-Zod schemas to fall back to a permissive JSON schema. |
execute | (input: TInput, context?: ToolExecutionContext) => Promise<TOutput> | TOutput | Tool execution function |
mcp? | { enabled?: boolean; requiresAuth?: boolean; cachePolicy?: “no-cache” | “cache” | “cache-first” } | MCP configuration |
Tool<TInput, TOutput>
Exports
Functions
| Name | Description |
|---|---|
dynamicTool | Create tool with runtime schema |
executeTool | Execute tool by ID |
tool | Create typed tool (Zod-validated) |
Types
| Name | Description |
|---|---|
DynamicToolConfig | dynamicTool() config |
JsonSchema | JSON Schema for tool input |
Tool | Tool instance (returned by tool() function) |
ToolConfig | Tool configuration options |
ToolDefinition | Provider-facing tool definition used for model/tool registration. |
ToolExecutionContext | Context passed to tool execution |
Constants
| Name | Description |
|---|---|
toolRegistry | Global tool registry |
Related
veryfront/agent: Agents that use toolsveryfront/mcp: Expose tools via MCP