Skip to main content
Glama
PyAEDT-MCP
by yuxuan6426

Run Python Script

run_python_script

Execute a PyAEDT script file with CPython asynchronously without opening a terminal, using the connected AEDT session and writing output and errors to a log file.

Instructions

Launch a PyAEDT script file with CPython without opening a terminal.

The script runs asynchronously using the MCP server's Python interpreter and inherits the connected AEDT session through the same environment variables used by the PyAEDT script launcher. Scripts must use PyAEDT; native globals such as oDesktop, oProject, and oDesign are not injected. Standard output and errors are written to the returned log file.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "script_path": "<script_path>"
    },
    "name": "run_python_script"
  }
}

Input Schema

NameRequiredDescriptionDefault
script_pathYesPath to the Python script file to execute.

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.8/5.0
Behavior4/5

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

With no annotations, the description does real work: it discloses asynchronous execution, the MCP server interpreter, env-var-based session inheritance, that native globals like oDesktop/oProject/oDesign are NOT injected, and that stdout/errors go to a returned log file. Missing pieces are timeouts, failure behavior, and whether the call returns before the script finishes (it says 'asynchronously' yet returns a log file, which is slightly ambiguous).

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?

Four tight sentences, purpose front-loaded, each adding distinct information: execution model, interpreter, session inheritance, globals caveat, output destination. No filler.

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

Completeness4/5

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

Output schema exists so return values needn't be explained, and the description covers the non-obvious execution semantics well. It stops short of stating whether the script is awaited, what happens on timeout, or that script side effects mutate the connected project.

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

Parameters3/5

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

One required parameter with 100% schema description coverage, so the schema already carries the meaning. The description adds only the implicit constraint that the file must be a PyAEDT script, not syntax, relative-path, or environment details.

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

Purpose4/5

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

States a concrete verb+resource: 'Launch a PyAEDT script file with CPython'. The file-based nature implicitly separates it from the inline-code sibling run_python_code, though that sibling is never named. Clear, but sibling differentiation is left to inference.

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

Usage Guidelines3/5

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

Usage is only implied by the mechanics (you need a script file path; the script must use PyAEDT). There is no explicit when-to-use versus run_python_code, and no stated preconditions such as requiring a connected AEDT session, even though session inheritance is described.

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