Skip to main content
Glama
runwhen-contrib

RunWhen Platform MCP

commit_slx

Commit a tested script to a workspace Git repo as an SLX, creating a task runbook or SLI with configurable script sources and scheduling.

Instructions

Commit a tested script as an SLX to the workspace Git repo.

Skills:

  • runwhen-skill://build-runwhen-task (authoring workflow)

  • runwhen-skill://discover-secrets (secret_vars mapping)

  • runwhen-skill://discover-locations (location selection)

  • runwhen-skill://configure-hierarchy (hierarchy/resource_path)

Creates a new SLX with the script as a Task (runbook) and/or SLI. The script should already be tested via run_script or run_script_and_wait.

This writes slx.yaml + runbook.yaml (for tasks) or slx.yaml + sli.yaml (for SLIs) to the workspace repository.

Script-source parameter matrix (provide exactly one task variant; SLI variants mirror the names):

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 with base64 blob

stdio only

For very large scripts (combined task+SLI >~50KB) prefer publishing as a registry codebundle and using deploy_registry_codebundle.

To commit BOTH a task AND an SLI on the same SLX:

  1. Custom SLI script (preferred): set task_type="task" and provide a separate lightweight sli_script that emits ONE float between 0 and 1 (e.g. failing_pods / total_pods). The SLI script MUST be its own small probe — DO NOT duplicate the task body. The server rejects identical task+SLI content.

  2. Cron-scheduler SLI: set task_type="task" and provide cron_schedule with a cron expression (e.g. "0 */2 * * *"). The SLI will trigger the task's runbook on that schedule. No sli_script needed.

Output contracts (the two scripts are NOT interchangeable):

  • Task (interpreter, task_type='task'): returns/writes a List[Dict] of issues with keys 'issue title', 'issue description', 'issue severity' (1-4), 'issue next steps'.

  • SLI (sli_interpreter, implied task_type='sli'): returns/writes ONE float between 0 and 1.

Script-content footguns:

  • Bash scripts must NOT include main "$@" at the bottom. The runner sources the script and invokes main() itself with FD 3 wired to a run_output.json file. A trailing main "$@" triggers a preflight invocation with FD 3 read-only, producing misleading "Bad file descriptor" errors. Just define main() and stop there.

  • secret_vars entries are injected at runtime as env vars whose VALUE is a FILE PATH on the runner — not the secret value itself. Tools that read paths natively (kubectl/KUBECONFIG, gcloud/ GOOGLE_APPLICATION_CREDENTIALS) work unchanged. For tokens/passwords the script must cat "$VAR" (bash) or open(os.environ["VAR"]).read() (python) to get the actual value.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dataNo'logs-bulk', 'config', or 'logs-stacktrace'.logs-bulk
tagsNoResource tags ({name, value} dicts).
aliasYesHuman-readable display name (e.g. 'Pod Health Check').
accessNo'read-write' or 'read-only'.read-write
branchNoGit branch to commit to.main
ownersNoOwner emails (defaults to current user).
scriptNoThe full script source code (not base64).
env_varsNoEnvironment variables baked into the SLX config.
locationNoRunner location (use get_workspace_locations).
slx_nameYesShort SLX name (lowercase-kebab-case, e.g. 'k8s-pod-health').
hierarchyNoTag names for hierarchical grouping.
image_urlNoIcon URL for the SLX.
statementYesSLX statement (e.g. 'All pods should be running').
task_typeNo'task' (runbook) or 'sli' (indicator).task
sli_scriptNoOptional SLI script (returns float 0-1).
task_titleNoHuman-readable task title.
interpreterNo'bash' or 'python'.bash
script_pathNoLocal file path for main script. **stdio mode only.** Mutually exclusive with the other script_* params.
secret_varsNoSecret mappings baked into the SLX config.
runtime_varsNoPer-run task parameters that the END USER fills in when invoking the committed task (e.g. log queries, time windows, filters). Distinct from env_vars (set once by the task author — cluster, namespace, context) and secret_vars (credentials injected as file paths). Task-only — never valid for SLIs. Each entry requires: name (str), description (str), default (str), validation (dict with type='regex'+'pattern' or type='enum'+'values'). Names must be unique and must not overlap with env_vars or secret_vars.
cron_scheduleNoCron expression to schedule the task (e.g. '0 */2 * * *').
resource_pathNoResource path for search indexing.
script_base64NoUTF-8 main script as standard base64.
codebundle_refNoGit ref for the codebundle (auto-resolved if omitted).
commit_messageNoCustom commit message.
workspace_nameYesThe workspace to commit to (e.g. 't-oncall').
sli_interpreterNoInterpreter for the SLI script.
sli_script_pathNoLocal file path for SLI script. **stdio mode only.** Mutually exclusive with the other sli_script_* params.
interval_secondsNoFor SLIs, how often to run in seconds.
sli_script_base64NoUTF-8 SLI script as standard base64.
script_base64_pathNoLocal file path to a file containing the base64-encoded main script. **stdio mode only.**
script_gzip_base64NoUTF-8 main script as base64(gzip(...)). Best inline option for scripts >5KB — 3-5x denser than 'script_base64'.
sli_interval_secondsNoHow often the SLI runs in seconds.
sli_script_base64_pathNoLocal file path to a file containing the base64-encoded SLI script. **stdio mode only.**
sli_script_gzip_base64NoUTF-8 SLI script as base64(gzip(...)). Best inline option for SLI scripts that exceed simple-metric size.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior4/5

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

With no annotations, the description carries full burden. It discloses created files (slx.yaml + runbook.yaml or sli.yaml), output contracts for task vs SLI, and critical footguns (bash main() call, secret_vars file path injection). However, it does not explicitly state if the tool is idempotent or if it overwrites existing SLXs, nor mention permissions or rate limits. The disclosures are thorough but not exhaustive.

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 long but well-structured with tables, bullet points, and section headers. It front-loads the core purpose and usage. However, some details (e.g., footguns, output contracts) could be slightly more concise or moved to a separate section to improve scanability. Overall, every sentence serves a purpose.

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 (35 parameters, 4 required, multiple script variants, task/SLI duality, and output schema), the description is remarkably complete. It covers parameter selection, usage workflows, output expectations (task returns List[Dict], SLI returns float), and caveats. The presence of an output schema reduces the need to explain return values, and the description appropriately references it.

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?

Schema coverage is 100%, so baseline is 3, but the description adds significant value beyond schema per-parameter docs. It introduces a matrix explaining when to use each script variant (script, script_base64, etc.), mutual exclusivity rules, and footguns that affect parameter usage (e.g., bash main() constraint). This greatly aids parameter selection and avoids common mistakes.

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 verb 'Commit' and the resource 'a tested script as an SLX to the workspace Git repo'. It explicitly distinguishes from sibling tools by mentioning alternative for large scripts (deploy_registry_codebundle), making the purpose 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 Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides explicit when-to-use guidance (after testing with run_script/run_script_and_wait), when-not-to-use (for very large scripts, prefer deploy_registry_codebundle), and a detailed parameter matrix for script source variants. It also explains how to combine task and SLI, covering both custom and cron-scheduler approaches.

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