Installation
Client Configuration
| Parameter | Type | Default | Description |
|---|---|---|---|
apiKey | string? | undefined | API key. Falls back to DATAGEN_API_KEY env var |
baseUrl | string | "https://api.datagen.dev" | DataGen API base URL |
timeout | number | 30000 | Request timeout in milliseconds |
retries | number | 0 | Number of retry attempts |
backoffSeconds | number | 0.5 | Initial backoff time for retries |
Tool Execution
executeTool
Execute an MCP tool by its alias name.
| Parameter | Type | Required | Description |
|---|---|---|---|
toolAliasName | string | Yes | Tool alias (e.g., "mcp_Gmail_gmail_send_email") |
parameters | Record<string, any> | No | Tool-specific parameters |
DatagenAuthError, DatagenToolError, DatagenHttpError
Custom Tool Deployment
deployCustomTool
Deploy a Python workflow as an API endpoint.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
name | string | Yes | — | API name for the tool |
code | string | Yes | — | Python code to deploy |
description | string | No | — | Tool description |
inputSchema | object | No | — | OpenAPI/JSON Schema for inputs |
outputVars | string[] | No | — | Output variable names |
expectedTools | string[] | No | — | Required MCP tools |
additionalImports | string[] | No | — | Python packages |
deploymentType | string | No | "private" | "private" or "public" |
defaultInputVars | object | No | — | Default input values |
mcpServerNames | string[] | No | — | MCP server names |
requiredSecrets | string[] | No | — | Required secret names |
deploymentUuid and deployment details.
Throws: DatagenDeploymentError
updateCustomTool
Update an existing custom tool. Only provided fields are updated.
getCustomTool
listCustomTools
Custom Tool Execution
runCustomTool
Run synchronously (blocks until complete).
runCustomToolAsync
Run asynchronously (returns immediately).
checkRunStatus
getRun
waitForRun
Poll until an async run completes.
Secret Management
listSecrets
setSecret
Error Types
| Exception | Description |
|---|---|
DatagenError | Base exception class |
DatagenAuthError | Authentication failed (401/403) |
DatagenToolError | Tool execution failed |
DatagenHttpError | HTTP-level errors |
DatagenDeploymentError | Deployment or run failed |
DatagenSecretError | Secret management errors |