Skip to main content
Glama
runwhen-contrib

RunWhen Platform MCP

validate_script

Validates scripts against RunWhen contract, checking main function, output format, and extracting environment variables to prevent runtime errors.

Instructions

Validate a script against the RunWhen contract before running it.

Checks that the script follows the required structure (main function, correct output format, etc.) and extracts referenced environment variables.

Task scripts must return/write issues with keys: 'issue title', 'issue description', 'issue severity' (1-4), 'issue next steps', and optionally 'issue observed at'.

Script-source parameter matrix (provide exactly one):

Variant

Best for

Mode

script

Small scripts <~5KB, readable

any

script_base64

Any size; safe JSON escaping

any

script_gzip_base64

>5KB; 3-5x denser than b64

any

script_path

Local file, raw text

stdio only

script_base64_path

Local file containing base64 blob

stdio only

Skill: runwhen-skill://build-runwhen-task (full authoring workflow).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
scriptNoThe full script source code (raw text).
task_typeNo'task' (returns issues) or 'sli' (returns 0-1 metric).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.
script_base64NoUTF-8 script as standard base64. Prefer over inline 'script' when JSON-escaping multiline content is error-prone. Mutually exclusive with the other script_* params.
script_base64_pathNoLocal file path to a file containing the base64-encoded script. **stdio mode only.** Convenient when the agent has already written the encoded script to a scratch file. Mutually exclusive with the other script_* params.
script_gzip_base64NoUTF-8 script as base64(gzip(...)). Best inline option for scripts >5KB — typically 3-5x denser than 'script_base64'. Encode with: base64.b64encode(gzip.compress(script.encode())).decode(). Mutually exclusive with the other script_* params.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior3/5

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

The description explains the validation checks (structure, output format, env vars) and required issue keys, but does not disclose potential error behavior, side effects, or prerequisites. With no annotations, the description carries the burden but leaves gaps.

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 well-structured with a clear opening, validation details, output format, and a helpful table. Every sentence provides essential information without redundancy. It is appropriately sized for the complexity of the tool.

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 presence of an output schema, the description covers input variants thoroughly, explains output format for task-type scripts, and references a skill for the full authoring workflow. It is complete for a validation tool.

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 parameter matrix adds significant value beyond the input schema by grouping parameters into variants, explaining best use cases, mode restrictions, and encoding instructions (e.g., for gzip_base64). This enriches understanding of parameter selection and usage.

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 'Validate a script against the RunWhen contract before running it,' specifying the verb 'validate' and the resource 'script against RunWhen contract.' It distinguishes itself from sibling tools like run_script by focusing on validation before execution.

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 a detailed parameter matrix with 'best for' and 'mode' columns, guiding selection based on script size and context. It also explains the required output format for task scripts. However, it does not explicitly compare when to use this tool versus alternatives like run_script.

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