Skip to main content
Custom Tools are deterministic Python workflows that assist your agents with fast, reliable operations. Instead of letting the agent figure out multi-step logic each time, you package it as a custom tool — predictable, testable, and reusable. Once deployed, custom tools become REST API endpoints and MCP tools — callable from agents, Claude conversations, external systems, or scheduled jobs.
Custom Tools are separate from agents. Agents are autonomous and use reasoning. Custom Tools are deterministic — same input, same output, every time.
Using Claude Code? Run /datagen:create-custom-tool for a guided workflow that handles schema design, implementation, testing, and deployment.

Create via Claude Code

Ask Claude to build and deploy your tool:
Or use the guided workflow:
This walks you through:
  1. Plan — Define the tool’s purpose and input/output schema
  2. Implement — Write the Python logic using the DataGen SDK
  3. Test — Run in a sandbox with executeCode
  4. Deploy — Deploy as a reusable API endpoint

Writing the Code

Use the DataGen SDK to call MCP tools as Python functions:

Input Schema

Define what parameters your tool accepts using JSON Schema:

Output Variables

List the variables your code produces. These become the tool’s return values:

Dependencies


Testing

Test with executeCode

Before deploying, test your code interactively:
Claude calls executeCode to run your code in a sandbox and return results immediately.

Test a Deployed Tool

After deployment, test with submitCustomToolRun:

Deploying

Ask Claude to deploy using natural language:
Or with more detail:
Claude calls createCustomTool with your code, schema, and configuration.

Using Your Deployed Tool

Once deployed, your tool is available as:
  • MCP tool — Callable from Claude conversations via submitCustomToolRun
  • REST API — HTTP endpoint for external integrations
  • Scheduled job — Run automatically via schedules

Managing Custom Tools

Find Your Tools

Claude calls searchCustomTools to list your deployed tools.

Update a Tool

Claude calls updateCustomTool to modify the code, schema, or dependencies.

Check Run Status

Claude calls checkRunStatus to show the current state and output.

CLI Management


Example: Lead Enrichment Tool

Input Schema:
Dependencies: MCP Servers: ["Perplexity", "LinkedIn"] | Output Variables: ["result", "total_enriched"]

Best Practices

Each tool should do one thing well. Create separate tools for different tasks rather than one massive tool.
Name tools clearly: enrich_company_data not tool1. Good descriptions help Claude understand when to use your tool.
Always test with executeCode first. Deployed tools are harder to debug.