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.Documentation Index
Fetch the complete documentation index at: https://datagen.dev/llms.txt
Use this file to discover all available pages before exploring further.
Custom Tools are separate from agents. Agents are autonomous and use reasoning. Custom Tools are deterministic — same input, same output, every time.
Create via Claude Code
Ask Claude to build and deploy your tool:- Plan — Define the tool’s purpose and input/output schema
- Implement — Write the Python logic using the DataGen SDK
- Test — Run in a sandbox with
executeCode - 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
| Type | Description | Example |
|---|---|---|
| MCP Servers | Which MCP servers to connect | ["Linear", "Gmail"] |
| Secrets | Environment variables needed | ["OPENAI_API_KEY"] |
| Imports | Python packages to import | ["pandas", "httpx"] |
Testing
Test with executeCode
Before deploying, test your code interactively:executeCode to run your code in a sandbox and return results immediately.
Test a Deployed Tool
After deployment, test withsubmitCustomToolRun:
Deploying
Ask Claude to deploy using natural language: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
searchCustomTools to list your deployed tools.
Update a Tool
updateCustomTool to modify the code, schema, or dependencies.
Check Run Status
checkRunStatus to show the current state and output.
CLI Management
Example: Lead Enrichment Tool
["Perplexity", "LinkedIn"] | Output Variables: ["result", "total_enriched"]
Best Practices
Keep tools focused
Keep tools focused
Each tool should do one thing well. Create separate tools for different tasks rather than one massive tool.
Handle errors gracefully
Handle errors gracefully
Use descriptive names
Use descriptive names
Name tools clearly:
enrich_company_data not tool1. Good descriptions help Claude understand when to use your tool.Test before deploying
Test before deploying
Always test with
executeCode first. Deployed tools are harder to debug.