Skip to main content
Glama

run_python

Execute Python snippets in PyMOL's cmd context to customize molecular visualization, analyze structures, and process MD trajectories.

Instructions

[opt-in] Execute a Python snippet with PyMOL cmd in scope. Requires PYMOL_MCP_ALLOW_CODE_EXEC=1.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
codeYesPython snippet; PyMOL `cmd` is in scope. Set a `result` variable to return a value.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior3/5

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

With no annotations provided, the description carries the burden of behavioral disclosure. It does reveal an important trait: the tool is opt-in and gated behind an environment variable. However, it doesn't warn about the broader implications of arbitrary Python execution—such as potential side effects on the PyMOL session or security risks—which would be valuable for a 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 two short sentences that are front-loaded with the opt-in marker and immediately state the action. Every word adds value: the opt-in tag, the execution purpose, the `cmd` scope, and the required environment variable. No wasted language or redundant elaboration.

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?

For a single-parameter tool with an output schema, the description is concise but sufficient for invocation: it says what the tool does, the required parameter, and the environment variable gate. It might benefit from a note about arbitrary code execution risks, but the presence of an output schema and detailed parameter description covers return values. Overall, it's reasonably complete for the tool's simplicity.

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?

The schema already documents the `code` parameter with 100% coverage, including the fact that PyMOL `cmd` is in scope and that setting a `result` variable returns a value. The description adds no extra parameter-specific meaning beyond reiterating 'with PyMOL `cmd` in scope', so it aligns with the baseline for high schema coverage.

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: 'Execute a Python snippet with PyMOL `cmd` in scope.' It uses a specific verb (execute), identifies the resource (PyMOL `cmd`), and distinguishes itself from sibling tools like run_pml (which likely runs PyMOL scripts, not arbitrary Python). The opt-in/requires note further clarifies its role.

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?

The description provides a clear prerequisite: 'Requires PYMOL_MCP_ALLOW_CODE_EXEC=1' and marks the tool as '[opt-in]'. However, it doesn't explicitly state when to prefer this tool over alternatives like run_pml, nor does it provide exclusions or comparisons. Usage context is implied rather than fully explicit.

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/wjgoarxiv/pymol-mcp'

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