Tutorials
Extend with Tools
This tutorial walks through building a custom tool for Autohand Code. The tool queries an internal API and returns structured JSON that the agent can reason about.
What you will build
- A custom tool definition with a JSON Schema.
- A TypeScript handler that calls an internal API.
- An Autohand agent configured to use the tool.
Prerequisites
- Node.js 20 or later.
- The
@autohandai/agent-sdkpackage. - An internal API endpoint and an API key.
Step 1: define the tool
Step 2: register the tool
Step 3: test the agent
Run the script and verify the agent calls the tool and returns the correct email. If the API is unavailable, the agent should report the error from the handler.
Next steps
Add more tools, expose them through MCP, or deploy the agent as a service.