Skip to main content
Glama
hellstein-dev

fusion-mcp

execute_python

Executes Python code inside Fusion 360's main thread for custom API operations when no dedicated tool fits.

Instructions

Run Python code inside Fusion 360 on its main thread. Use it only when no dedicated tool can do the job.

In scope: adsk (adsk.core, adsk.fusion), app (adsk.core.Application), ui, design (active adsk.fusion.Design or None), root (design.rootComponent or None) and params (the params argument, default {}).

Units: the Fusion API itself works in CENTIMETRES and RADIANS. Convert yourself: 25 mm -> 2.5, 90 deg -> math.pi / 2. Strings passed to adsk.core.ValueInput.createByString are Fusion expressions ("25 mm", "width / 2").

Returns JSON {"result", "stdout", "stderr"}: result is the value of the variable result after the code runs (JSON as is, otherwise its repr); stdout/stderr are captured and cut at 64 KiB with a truncation marker. If the code raises, the result is an error FUSION_API_ERROR with the traceback in details, and timeline items the code added are rolled back (parametric designs only).

Example: code = "sk = root.sketches.add(root.xYConstructionPlane)\n" "sk.sketchCurves.sketchCircles.addByCenterRadius(" "adsk.core.Point3D.create(0, 0, 0), params['r_mm'] / 10)\n" "result = sk.name" params = {"r_mm": 12.5}

Input Schema

NameRequiredDescriptionDefault
codeYesPython source to run inside Fusion
paramsNoJSON values made available to the code as `params`
timeout_sNoSeconds to wait for the code to finish

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.9/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the full behavioral burden and does so thoroughly: main-thread execution, unit conversions, return shape, stdout/stderr truncation, and error handling with timeline rollback. These are exactly the operational details an agent needs before calling a powerful code-execution tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is front-loaded with purpose and usage guidance, then organized into scope, units, return behavior, and an example. Despite its length, every section carries actionable information for safely invoking the tool.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a complex code-execution tool with no annotations and no output schema, the description covers invocation context, execution semantics, return values, error behavior, and rollback behavior. It leaves no significant operational gap for an agent deciding whether and how to call it.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the baseline is 3, but the description adds real meaning beyond the schema by explaining how `params` is exposed to code and clarifying unit conventions for Fusion API values. It does not elaborate on `timeout_s` beyond the schema, which keeps it from a 5.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific action and environment: running Python inside Fusion 360 on its main thread. It explicitly distinguishes itself from the many dedicated sibling tools by saying to use it only when no dedicated tool can do the job.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives a clear when-to-use rule: only when no dedicated tool can handle the task. It also defines the available execution context (`adsk`, `app`, `ui`, `design`, `root`, `params`) so the agent knows what can be done before invoking it.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Deploy Server

Other Tools