Skip to main content

Using Templates

Templates give you a working agent in seconds. Start from a proven foundation, then customize.

Available Templates

TemplateDescriptionBest For
defaultCoding agent with file/bash toolsGeneral purpose, coding tasks
research-agentWeb search and document synthesisResearch, reports, analysis
support-agentTicket handling and escalationCustomer support workflows
mcp-toolsCustom tool integration exampleLearning MCP patterns

Using cast init

cast init my-agent
Interactive prompt:
? Select a template:
❯ default — Coding agent with file and bash tools (like Claude Code)
  research-agent — Deep research with web search and document synthesis
  support-agent — Customer support with ticket handling and escalation
  mcp-tools — Agent with example MCP server integration

Skip the prompt

cast init my-agent --template research-agent

Template Structure

Every template includes:
my-agent/
├── castari.json      # Agent configuration
├── package.json      # Dependencies
├── tsconfig.json     # TypeScript config
├── src/
│   └── index.ts      # Agent entry point with tools
├── CLAUDE.md         # Agent instructions
└── README.md         # Documentation

Template: default

A Claude Code-style agent with file and bash tools. Tools included:
ToolDescription
read_fileRead file contents
write_fileCreate/update files
bashExecute shell commands
list_filesList directory contents
Example invocations:
cast invoke my-agent "What files are here?"
cast invoke my-agent "Create a hello.py that prints Hello World"
cast invoke my-agent "Run the tests"
Best for: General-purpose coding assistance, file manipulation, automation.

Template: research-agent

Deep research with web search and document synthesis. Tools included:
ToolDescription
web_searchSearch the web
read_urlFetch and read web pages
save_reportSave findings to file
read_fileRead local documents
Example invocations:
cast invoke my-agent "Research the current state of AI agents in 2026"
cast invoke my-agent "Compare AWS, GCP, and Azure for serverless"
The research-agent template includes a mock web search. For production, integrate with SerpAPI, Tavily, or similar.
Best for: Research tasks, report generation, competitive analysis.

Template: support-agent

Customer support with ticket handling. Tools included:
ToolDescription
lookup_userFind user by email/ID
lookup_orderFind order details
create_ticketEscalate to human
send_responseReply to customer
Example invocations:
cast invoke my-agent "I need help with order #12345"
cast invoke my-agent "How do I reset my password?"
Best for: Customer support automation, help desk, FAQ handling.

Template: mcp-tools

Example of custom MCP tool integration. Tools included:
ToolDescription
calculateMath calculations
get_weatherWeather lookup (mock)
query_databaseDatabase queries (mock)
send_notificationSend alerts
Use this to learn:
  • How to define tool schemas
  • How to implement tool handlers
  • How to integrate external services
Best for: Learning tool development, prototyping custom integrations.

Customizing Templates

1. Edit CLAUDE.md

The CLAUDE.md file contains agent instructions:
# My Agent

You are a helpful assistant that...

## Guidelines
- Be concise
- Always explain before acting
- Ask for clarification when unsure

2. Modify Tools

Edit src/index.ts to add, remove, or modify tools:
const tools: Anthropic.Tool[] = [
  {
    name: "my_custom_tool",
    description: "Does something useful",
    input_schema: {
      type: "object",
      properties: {
        input: { type: "string" }
      },
      required: ["input"]
    }
  }
];

3. Add Dependencies

npm install axios  # Example: add HTTP client
Then use in your agent:
import axios from 'axios';

// In your tool handler
const response = await axios.get('https://api.example.com/data');

4. Redeploy

After changes:
cast deploy

See Also