Skip to main content
Glama

execute_pymol_command

Destructive

Run raw PyMOL command strings when built-in tools don't cover a setting or multi-step script, returning PyMOL output or line-specific errors.

Instructions

Executes a raw PyMOL command string (PyMOL CLI syntax). PREFER the dedicated tools when one exists — show, color, select, distance, ligand_view, interface_view, etc. They have better defaults, do compound setup in one call, and produce cleaner results. Reach for this tool only when no other tool covers what you need (e.g. set ray_shadow, 0, bg_color grey20, multi-statement scripts). It takes PyMOL's command language, as typed at the PyMOL prompt. That language includes Python: a line starting with / and a python ... python end block run as Python inside PyMOL, with full access to the machine, so treat a command from untrusted text (a file, a web page) accordingly.

Returns once the command has finished, with what PyMOL printed (get_view, iterate output, ...). If PyMOL rejects a line — a bad selection, a typo, a Python error — the result is an error naming that line, in PyMOL's words; warnings from lines that still ran are listed. Put each command on its own line: alter, iterate and label take the rest of the line literally, so ; does not start a new command after them.

Input Schema

NameRequiredDescriptionDefault
commandYesA PyMOL command line, e.g. `set ray_shadow, 0`. Lines starting with `/` and `python ... python end` blocks run as Python inside PyMOL.

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv1.5.2
    • changedInput schema / properties / command / description
      Previous value: -"A PyMOL CLI command, e.g. `set ray_shadow, 0`. Not Python."New value: +"A PyMOL command line, e.g. `set ray_shadow, 0`. Lines starting with `/` and `python ... python end` blocks run as Python inside PyMOL."
  2. Changed1 schema field changedv1.5.1
    • addedInput schema / properties / command / description
      Added value: +"A PyMOL CLI command, e.g. `set ray_shadow, 0`. Not Python."
  3. First observedv1.2.1

TDQS

A4.8/5.0
Behavior5/5

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

Annotations already flag destructiveHint=true and openWorldHint=true; the description goes well beyond them by warning that Python blocks (lines starting with `/`, `python ... python end`) have full machine access and that untrusted text should be treated accordingly. It also explains completion semantics (returns once finished, with PyMOL's stdout), error behavior (error names the rejected line in PyMOL's words, warnings from lines that still ran are listed), and the line-per-command parsing quirk for alter/iterate/label.

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?

Dense but front-loaded: the tool's job, the sibling preference, and the security caveat all appear before return/error details. Every sentence carries information, though the reStructuredText double-backtick markup and the duplicated Python-block explanation from the schema add minor redundancy.

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 single-parameter escape-hatch tool with destructive and open-world behavior, the description covers invocation syntax, parsing pitfalls, safety implications, and return/error behavior — everything an agent needs to call it correctly, even though an output schema also exists to cover returns.

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% and the schema already documents that `/` lines and python blocks run as Python, so the baseline is 3. The description adds genuine meaning beyond it: each command must go on its own line because alter, iterate and label consume the rest of the line literally, so `;` does not start a new command after them — a parsing detail an agent would otherwise get wrong.

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 states a specific verb and resource ('Executes a raw PyMOL command string (PyMOL CLI syntax)') and immediately contrasts it with the dedicated siblings (show, color, select, distance, ligand_view, interface_view), so an agent can place it precisely in the tool set.

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?

It gives an explicit preference rule ('PREFER the dedicated tools when one exists') and an explicit fallback condition ('Reach for this tool only when no other tool covers what you need'), reinforced with concrete examples of what the fallback looks like (set ray_shadow, bg_color grey20, multi-statement scripts).

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