Create tools and run tool calls without a model.
Level: Basics · Concept: Tools
flowchart LR
M([assistant message with tool_calls]) --> I[ToolInvoker] --> T([tool messages])
createTool(name, description, fn, schema)turns a function into a tool.ToolInvokerruns every call in a message. An unknown tool becomes an error message, not an exception.
# Once, from the repository root
pnpm install && pnpm build
pnpm --filter @astack-examples/tools startThe full program is index.ts.
Next: Chat