---
name: ai-eng/create-tool
description: Create a new OpenCode custom tool with AI assistance. Uses tool-creator for intelligent TypeScript tool generation.
agent: tool-creator
subtask: true
---

Default output: return only the result, blockers, and required evidence. Omit preambles, process narration, repeated context, confidence scores, and follow-up offers. Use at most five bullets unless a required artifact or schema needs more.

# Create Tool Command

Create a new OpenCode custom tool using AI assistance.

 implement tool systematically, ensuring proper TypeScript types, robust validation, and comprehensive error handling.

## Process
1. **Understand Requirements**: What functionality should the tool provide?
2. **Generate Tool**: Use @tool-creator to create properly formatted TypeScript tool
3. **Save Tool**: Write to appropriate location
4. **Validate**: Run basic validation checks

## Usage

```bash
/ai-eng/create-tool "database query executor with connection pooling"
```

## Output Location

Tool will be saved to:
- Project-local: `.opencode/tool/[name].ts`
- Global: `~/.config/opencode/tool/[name].ts`
- Canonical content: `content/tools/[name].ts`

## Examples

### Database Tool
```bash
/ai-eng/create-tool "PostgreSQL query builder with parameter binding"
```

### File Processing Tool
```bash
/ai-eng/create-tool "CSV processor with validation and transformation"
```

### API Client Tool
```bash
/ai-eng/create-tool "REST API client with retry logic and authentication"
```

### System Integration Tool
```bash
/ai-eng/create-tool "Docker container management with status monitoring"
```

The tool-creator will handle TypeScript compilation, Zod validation, error handling, and OpenCode tool integration patterns.
