Skip to main content
Glama
chadrik

maya-mcp-server

by chadrik

execute_code

Execute Python code in Autodesk Maya sessions, capturing results as JSON or raw text, with real-time output streaming via MCP resources.

Instructions

Execute Python code in a Maya session.

Args: code: Python code to execute. result_type: How to handle the result: - "NONE": Execute statements, don't capture result - "JSON": Evaluate expression, JSON encode result - "RAW": Evaluate expression, return string representation session_key: Session key (optional if only one session exists)

Returns: Captured result (None if result_type is NONE)

Note: stdout and stderr are delivered in real-time via MCP Resource subscriptions (maya://sessions/{session_key}/stdout and /stderr). Call get_output() to retrieve buffered output.

Example: # Execute statements execute_code("import maya.cmds as cmds; cmds.polyCube()")

# Get JSON result
execute_code("cmds.ls(type='mesh')", result_type="JSON")

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
codeYes
result_typeNoNONE
session_keyNo
Behavior3/5

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

With no annotations, the description carries the full burden. It explains result handling, real-time stdout/stderr via resource subscriptions, and return values. However, it does not disclose potential side effects or destructive actions (e.g., modifying scene state) beyond the general notion of code execution.

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 well-structured with a clear title, Args/Returns sections, a Note, and an Example. It is front-loaded with the purpose, and every sentence serves a purpose without redundancy.

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?

Given the tool has 3 parameters, no output schema, and no annotations, the description covers parameter semantics, return values, and side effects (real-time output). It lacks error handling or session existence checks, but is largely complete for the intended use.

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

Parameters5/5

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

Schema coverage is 0%, so the description must provide full meaning. It does so by detailing each parameter: 'code' (Python code), 'result_type' (with three modes explained), and 'session_key' (optional). This adds substantial value beyond the raw schema.

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?

The description clearly states the tool executes Python code in a Maya session. This verb-resource pair is distinct from sibling tools (list_sessions, write_module, add_session) which do not involve code execution.

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

Usage Guidelines4/5

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

The description provides context on when to use (for executing code in Maya) with parameter explanations and examples. However, it does not explicitly exclude alternatives or state when not to use, leaving room for clearer differentiation.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/chadrik/maya-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server