Skip to main content
Glama
runwhen-contrib

RunWhen Platform MCP

run_script

Execute a script on a RunWhen runner for testing. Returns a run ID to monitor execution and retrieve results.

Instructions

Execute a script on a RunWhen runner for testing.

Sends the script to the workspace's runner at the specified location. Returns a run ID that can be used with get_run_status and get_run_output to monitor execution and retrieve results.

The script must follow the RunWhen contract:

  • Python task: define main() returning List[Dict] with keys 'issue title', 'issue description', 'issue severity' (1-4), 'issue next steps'.

  • Python SLI: define main() returning a float 0-1.

  • Bash task: define main() writing issue JSON array to FD 3 (>&3).

  • Bash SLI: define main() writing a metric float to FD 3.

Provide exactly one of: script | script_base64 | script_gzip_base64 | script_path (stdio) | script_base64_path (stdio). Use script_gzip_base64 for scripts >5KB to maximise transport headroom.

Use validate_script first to check compliance.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
scriptNoThe full script source code (raw text).
env_varsNoEnvironment variables (e.g. {'NAMESPACE': 'default'}).
locationNoRunner location (use get_workspace_locations).
run_typeNo'task' or 'sli'.task
interpreterNo'bash' or 'python'.bash
script_pathNoLocal file path to read the script from. **stdio mode only.** Mutually exclusive with the other script_* params.
secret_varsNoSecret mappings (e.g. {'kubeconfig': 'kubeconfig'}).
script_base64NoUTF-8 script as standard base64. Prefer over inline 'script' when JSON-escaping multiline content is error-prone.
workspace_nameYesThe workspace to run in (e.g. 't-oncall').
script_base64_pathNoLocal file path to a file containing the base64-encoded script. **stdio mode only.**
script_gzip_base64NoUTF-8 script as base64(gzip(...)). Best inline option for scripts >5KB — 3-5x denser than 'script_base64'. Encode with: base64.b64encode(gzip.compress(script.encode())).decode().

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior4/5

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

No annotations are provided, so the description carries the full burden. It discloses that the tool returns a run ID, sends the script to a runner, and requires compliance with the RunWhen contract. It also explains encoding trade-offs and the need for a valid workspace. It does not mention potential side effects or rate limits, but for a script execution tool, the behavioral context is largely adequate.

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: starts with purpose, then output, then contract details, then parameter selection guidance, ending with a validation tip. It is slightly long but every sentence adds necessary information. No filler or 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?

Given the tool's complexity (11 parameters, 1 required, with encoding variants and script contracts) and the availability of an output schema, the description is thorough. It covers the script contract in detail, explains when to use each encoding, and suggests a prerequisite step (validate_script). No critical gaps remain.

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 description coverage is 100%, so baseline is 3. The description adds significant value by explaining the script contract (Python vs Bash, task vs SLI), encoding recommendations (script_gzip_base64 for >5KB), and the mutual exclusivity of script_* parameters. This goes beyond the schema's field descriptions.

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 a script for testing on a RunWhen runner, directly distinguishing it from similar tools like run_script_and_wait (which blocks) and validate_script (which only checks compliance). The verb-resource-action is specific and unambiguous.

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 strong usage context: it recommends using validate_script first and explains how to monitor execution with get_run_status/get_run_output. However, it does not explicitly contrast with run_script_and_wait or list conditions where one should prefer this tool over siblings, which would improve 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/runwhen-contrib/runwhen-platform-mcp'

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