Skip to main content
Glama
chadrik

maya-mcp-server

by chadrik

write_module

Create a virtual Python module in a Maya session, enabling custom functions and modules to be imported and used within Maya scripts.

Instructions

Create a virtual Python module in a Maya session.

Args: name: Module name. Can be a dotted path (e.g., 'mypackage.utils') in which case parent packages are created automatically. code: Python source code for the module. overwrite: If True, replace existing module. If False, raise error if module already exists. session_key: Session key (optional if only one session exists)

Returns: Success message

Example: write_module("mytools", ''' import maya.cmds as cmds

def create_cube(name="cube1"):
    return cmds.polyCube(name=name)[0]
''')

# Then use it:
execute_code("import mytools; mytools.create_cube('myCube')")

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
codeYes
nameYes
overwriteNo
session_keyNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior4/5

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

With no annotations provided, the description carries the full burden of disclosure. It transparently explains key behaviors: automatic creation of parent packages for dotted names, overwrite behavior (replace or error), and optional session key. It does not cover potential side effects on the Maya session or persistence, but what is disclosed is accurate and helpful.

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

Conciseness4/5

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

The description is well-structured with an Args, Returns, and Example section, but it is somewhat lengthy. It includes a multi-line example that takes space. The core purpose is front-loaded, but conciseness could be improved by trimming the example or combining sentences.

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 presence of an output schema (though not shown, context signals confirm), the description complements it well. It explains the return as a 'Success message' and covers parameters comprehensively. It lacks details on error conditions or scope of the virtual module, but overall it provides a complete picture for a tool of moderate complexity.

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?

The input schema has 0% description coverage, so the description must compensate, and it does excellently. Each parameter is explained in the Args section: 'name' can be a dotted path with auto-creation of parents, 'code' is Python source, 'overwrite' controls replacement behavior, 'session_key' is optional. The example demonstrates real usage, adding significant value beyond the 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's purpose: 'Create a virtual Python module in a Maya session.' It uses a specific verb ('Create') and identifies the resource ('virtual Python module'), making it easy to understand. This purpose is distinct from sibling tools like list_sessions, execute_code, and add_session.

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 an example that illustrates typical usage and implies that write_module is for creating reusable modules, while execute_code runs code directly. However, it does not explicitly state when to use this tool over alternatives or when not to use it, which would strengthen guidance.

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