Skip to main content
Glama

Run IDE Script

run_ide_script
Destructive

Executes custom Xojo IDE scripts for advanced IDE automation when dedicated tools do not fit, returning Print output or a ran-status when nothing is printed.

Instructions

Executes an arbitrary Xojo IDE script. Use Print to return a value, once: with several Prints the first that says something is returned, and an error outranks output. A script that prints nothing reports that it ran. Do not leave the script early with Return: xmcp appends a final line that tells it the script finished, and a script that never reaches it is waited on until the timeout. Powerful escape hatch — IDE scripting can quit Xojo, close/reopen projects, create or delete items, write files, and invoke shell commands via DoShellCommand. Prefer a dedicated tool when one fits (list_project_items, get_code, build_project, etc.); use this only when nothing else does, and pause before running anything that quits the IDE or touches the shell. It cannot delete project items: IDE scripting has no command for that (see create_project_item). A runtime error comes back with no message or line number. Needs the Xojo IDE running.

Input Schema

NameRequiredDescriptionDefault
scriptYesIDE script code (XojoScript syntax). Use Print for output.
timeoutNoMilliseconds to wait for the answer. Default 10000. A script that runs longer is not stopped: xmcp keeps the connection open and refuses other requests until it answers, so set this high enough up front.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv3.7.1
    • changedInput schema / properties / timeout / description
      Previous value: -"Timeout in milliseconds (default 10000)"New value: +"Milliseconds to wait for the answer. Default 10000. A script that runs longer is not stopped: xmcp keeps the connection open and refuses other requests until it answers, so set this high enough up front."
  2. First observed

TDQS

A4.9/5.0
Behavior5/5

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

Annotations already declare destructive=true and openWorld=true, but the description goes well beyond them: it enumerates concrete destructive capabilities (quitting Xojo, closing/reopening projects, creating or deleting items, writing files, DoShellCommand), documents the output protocol (first Print wins, errors outrank output, silent scripts report success), warns that Return prevents the completion signal and leads to waiting until timeout, and notes runtime errors arrive with no message or line number. It also states the IDE must be running.

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?

Purpose is front-loaded in the first clause, followed by output contract, then hazards, then routing guidance — a sensible escalation order. Every sentence carries either a behavioral fact or a decision rule; there is no filler despite the length.

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?

With no output schema, the description supplies the full return-value contract, error behavior, timeout risk, destructive capability list, and the prerequisite that the IDE be running. For a destructive, open-world escape hatch with only two parameters, nothing an agent needs before invoking it is missing.

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%, so the baseline is 3, and the description adds real semantics on top: the return-value convention for the 'script' parameter (Print, first non-empty Print wins, error precedence, silent = success) and the consequence of an early Return. It does not restate the timeout parameter's blocking behavior, which the schema already covers in detail.

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?

States a specific verb and resource ('Executes an arbitrary Xojo IDE script') and immediately frames its position in the toolset as an escape hatch rather than a general-purpose tool. The explicit routing sentence naming list_project_items, get_code, and build_project makes it distinguishable from every relevant sibling without opening another schema.

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?

Gives an explicit when-to-use rule ('use this only when nothing else does'), an explicit when-not rule (prefer a dedicated tool when one fits), a caution threshold ('pause before running anything that quits the IDE or touches the shell'), and a hard boundary with a pointer to the correct alternative ('It cannot delete project items... see create_project_item'). This is about as complete as usage guidance gets.

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