Deploys working Python code as a DataGen standalone deployment. This tool orchestrates the complete workflow: takes your Python code, tests it, and creates a standalone deployment as an API endpoint with default values. Perfect for converting working code into a production-ready depl...
Accepts freeform code/query input (script); High parameter count (12 properties)
Part of the DataGen MCP server. Enforce policies on this tool with Intercept, the open-source MCP proxy.
AI agents invoke deployCode to trigger processes or run actions in DataGen. Execute operations can have side effects beyond the immediate call -- triggering builds, sending notifications, or starting workflows. Rate limits and argument validation are essential to prevent runaway execution.
deployCode can trigger processes with real-world consequences. An uncontrolled agent might start dozens of builds, send mass notifications, or kick off expensive compute jobs. Intercept enforces rate limits and validates arguments to keep execution within safe bounds.
Execute tools trigger processes. Rate-limit and validate arguments to prevent unintended side effects.
tools:
deployCode:
rules:
- action: allow
rate_limit:
max: 10
window: 60
validate:
required_args: true See the full DataGen policy for all 20 tools.
Agents calling execute-class tools like deployCode have been implicated in these attack patterns. Read the full case and prevention policy for each:
Other tools in the Execute risk category across the catalogue. The same policy patterns (rate-limit, validate) apply to each.
deployCode is one of the high-risk operations in DataGen. For the full severity-focused view — only the high-risk tools with their recommended policies — see the breakdown for this server, or browse all high-risk tools across every MCP server.
Deploys working Python code as a DataGen standalone deployment. This tool orchestrates the complete workflow: takes your Python code, tests it, and creates a standalone deployment as an API endpoint with default values. Perfect for converting working code into a production-ready deployment without flows. Uses OpenAPI/JSON Schema for rich input and output validation with descriptions, type constraints, default values, and comprehensive documentation. **Schema Example:** input_schema: { 'type': 'object', 'properties': { 'name': {'type': 'string', 'description': 'User name'}, 'count': {'type': 'integer', 'minimum': 1, 'default': 10}, 'data': {'type': 'array', 'items': {'type': 'string'}} }, 'required': ['name'] } **Do not use any local() or global() in the code.** you can assume the input variables are already defined in the global scope. and you can use them directly with data type defined in the input_schema. **Do Not Return anthing for Output** Deploy code use the globa variable to reference the input and output variables. so do not return in main script. otherwise it would trigger ReturnException. To return output, just reference the global variable. for example: if I need to return the output variable "result" in the main script, I can do this: result = "Hello, World!" and in the output_variables, I can do this: output_variables: ['result'] just simply reference the global variable in the output_variables. **No Async in the code** Do not use any async in the code. it will cause the code to not work. **Steps to take before deploying code** <step0> Try to briefly explain the code or plan to the user. </step0> <step1> Come up with right input_schema and output_schema to define the input and output variables </step1> <step2> Confirm with user if the input and output are correct. modify if needed. </step2> <step3> Run submitDeploymentRun tool to test the code is working on Datagen after the deployment is created. </step3> . It is categorised as a Execute tool in the DataGen MCP Server, which means it can trigger actions or run processes. Use rate limits and argument validation.
Add a rule in your Intercept YAML policy under the tools section for deployCode. You can allow, deny, rate-limit, or validate arguments. Then run Intercept as a proxy in front of the DataGen MCP server.
deployCode is a Execute tool with high risk. Execute tools should be rate-limited and have argument validation enabled.
Yes. Add a rate_limit block to the deployCode rule in your Intercept policy. For example, setting max: 10 and window: 60 limits the tool to 10 calls per minute. Rate limits are tracked per agent session and reset automatically.
Set action: deny in the Intercept policy for deployCode. The AI agent will receive a policy violation error and cannot call the tool. You can also include a reason field to explain why the tool is blocked.
deployCode is provided by the DataGen MCP server (kuoyusheng/datagendev). Intercept sits as a proxy in front of this server to enforce policies before tool calls reach the server.
Open source. One binary. Zero dependencies.
npx -y @policylayer/intercept