How an agent gets its tools
1
Add credentials to a vault
Open Connection Vaults in the sidebar, open a vault, and add MCP servers and secrets on its Credentials tab. See Add an MCP server.
2
Create a tool bundle
On the vault’s Tool Bundles tab, create a bundle and choose its tools, or turn on Allow all tools in this vault. See Tool bundles.
3
Point the agent at them
In the builder’s Config tab (or the agent’s Settings tab, Vault & Tool Bundle), choose the Vault and Tool bundle. The bundle list only shows bundles in the selected vault.
4
Check the result
The agent’s Tools tab shows the bundle that actually applies, the vault its credentials come from, and every tool grouped as Default, MCP and Custom. Each MCP tool shows whether it authenticates with a shared or per-user credential.
Add an MCP server
MCP servers give agents access to external services such as Gmail, Linear, Slack and HubSpot. You connect a server once, as a credential in a vault, and every agent using that vault can reach it.From the MCP Registry
Open the vault, go to the MCP Registry tab, and click Connect on a server. OAuth servers open a sign-in popup; when you approve, the row shows as connected.Any MCP server by URL
1
Add credential
On the vault’s Credentials tab, click Add credential and choose MCP server.
2
Fill in the server
Enter a name, the server URL (for example
https://mcp.example.com/mcp) and the Auth method: OAuth, Bearer token, API key or No authentication.3
Choose shared or per-user
Shared with workspace: an admin provides one value and everyone uses it without seeing it. Per-user: each member connects their own account from the row’s Connect button. OAuth is always per-user.
4
Sync its tools
DataGen lists the server’s tools when you save. Use Refresh tools to re-sync the tool catalog for every MCP server in the vault.
Commonly used MCP servers
- Notion —
https://mcp.notion.com/mcp - Linear —
https://mcp.linear.app/sse - Neon —
https://mcp.neon.tech - Open-source servers — github.com/modelcontextprotocol/servers
- Your own systems — build a server with the MCP SDK and add it by URL
From Claude Code
With the DataGen plugin installed, run:"Add Linear MCP to DataGen: https://mcp.linear.app/sse", and it calls addRemoteMcpServer for you.
Tool bundles
A tool bundle is an allowlist of tools that authenticate with one vault’s credentials.- Click New tool bundle on the vault’s Tool Bundles tab and name it, for example
read-only. - Pick its members from the vault’s tools, grouped as Default, MCP and Custom.
- Or turn on Allow all tools in this vault: every default tool, MCP server tool and custom tool in the vault is included, and tools added later are included automatically.
DataGen MCP gateway
Turn on Enable DataGen MCP for this agent (builder Config, or the agent’s Settings tab) to attach the DataGen MCP gateway to the agent’s runs. The agent can then discover and call tools on demand withsearchTools, getToolDetails and executeToolCall. It is off by default, applies from the next turn, and does not change the other MCP servers the agent loads.
Workspace data tools
Enable workspace data tools for this agent (builder Config, or the agent’s Data access tab) lets the agent list, read and fetch the workspace’s raw files, its own earlier outputs and its connected knowledge bases on demand, beyond what is copied into the sandbox at run start. The tools are read-only: the agent can never write or delete through them, and other agents’ files and other members’ personal files stay private. They are on by default. If the agent has a Data scope, the tools only return raw data inside it; with the tools off, a scoped agent cannot read any raw data. See Build an agent.Calling other agents
On the Data access tab, Agents it can call lists agents this agent may start a turn on withdatagen-assets invoke. Each call runs as the person the agent is running for, needs that person to be allowed to run the target agent, and needs the target to be enabled. A called agent cannot call further agents.
Custom tools
Custom tools are deterministic Python workflows that help your agents with fast, reliable operations. Instead of letting the agent work out multi-step logic each time, you package it as a tool: same input, same output, every time. A deployed custom tool appears on the Tools page under Custom Tools, can be added to tool bundles, and is callable from agents, Claude conversations and the REST API.Write the code
Call MCP tools as Python functions with the DataGen SDK:Test and deploy
- Test the code in a sandbox first: ask Claude to run it, and it calls
executeCode. - Deploy it: ask
"Deploy this as a custom tool called 'analyze_campaign'", and Claude callscreateCustomToolwith your code, schema and dependencies. - Run the deployed tool:
"Run my analyze_campaign tool with campaign_id='abc123'"callssubmitCustomToolRun;checkRunStatusreturns the state and output.
updateCustomTool), or find your tools with searchCustomTools.
From the terminal:
Example: lead enrichment tool
Example: lead enrichment tool
input_domains (array of strings, required). Output variables: ["result", "total_enriched"]. MCP servers: ["Perplexity"].Best practices
Best practices
- Keep tools focused. One tool, one job.
- Use descriptive names.
enrich_company_data, nottool1; good descriptions help agents pick the right tool. - Handle errors. Catch
DatagenToolErroraround tool calls and return a clear message. - Test before deploying. Run with
executeCodefirst; deployed tools are harder to debug.
Code mode
Code mode means writing a Python or TypeScript script that calls MCP tools through the DataGen SDK, instead of calling them one at a time in a conversation. Use it for batch processing, complex logic and production jobs. Rule of thumb: fewer than 5 tool calls with small results, call the tools directly. More calls, large data or complex logic, write a script.- Python
- TypeScript
See Python SDK and TypeScript SDK for every method, including deploying a script as a custom tool.
Troubleshooting
A tool is missing from the agent's Tools tab
A tool is missing from the agent's Tools tab
- Check which bundle the Tools tab says applies; the agent may be on the workspace default.
- Open that bundle on the vault’s Tool Bundles tab and add the tool, or turn on Allow all tools in this vault.
- Click Refresh tools on the vault’s Credentials tab to re-sync the MCP server’s tool list.
OAuth fails or times out
OAuth fails or times out
- Allow popups for DataGen; the OAuth flow opens in a popup.
- Try a private window, or clear cookies for the provider.
- Check whether your organization blocks OAuth for the service.
- Click Connect on the credential row to run the flow again.
Permission denied from a tool
Permission denied from a tool
- Confirm you granted every scope the provider asked for during OAuth.
- Some services need admin approval for certain scopes.
- For a per-user credential, make sure the member who triggers the run has connected their own account.
Next
Trigger it
Run now, schedules and webhooks with automations
Channels
Slack, Teams, Discord, email, web chat and public chat links