RunWhen Platform MCP
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| RW_API_URL | Yes | RunWhen API base URL (e.g. https://papi.beta.runwhen.com) | |
| RUNWHEN_TOKEN | Yes | RunWhen API token (JWT or Personal Access Token) | |
| MCP_SERVER_LABEL | No | Human-readable label for this server instance (e.g. prod, beta) | |
| DEFAULT_WORKSPACE | No | Default workspace so tools don’t need workspace_name every time | |
| RUNWHEN_CONTEXT_FILE | No | Override path to RUNWHEN.md; otherwise auto-discovered from cwd | |
| RUNWHEN_REGISTRY_URL | No | CodeBundle Registry URL (default: https://registry.runwhen.com) |
Instructions
Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.
Server identity: environment=beta, api=https://papi.beta.runwhen.com. When multiple RunWhen MCP servers are configured, use THIS server's tools for operations targeting the environment and workspace above.
RunWhen Platform MCP server — workspace intelligence, task authoring, and infrastructure automation.
IMPORTANT: Most tools require a workspace_name parameter. ALWAYS provide it — do NOT omit it or pass null. Use list_workspaces first if you don't know the workspace name.
TOOL ROUTING — when to use workspace_chat vs direct tools:
PREFER workspace_chat for:
Questions about specific topics (e.g. 'issues related to neo4j')
Investigations that need to search across issues, resources, SLXs, or run sessions
Multi-step analysis or correlation (e.g. 'what's wrong in the watcher namespace?')
Any question where a knowledgeable human would need to search, filter, and interpret results
workspace_chatcan search, navigate and correlate across resources, SLXs, issues, run sessions, and the knowledge base, and return rich reports, diagrams, and tables — producing materially better answers than combining multiple direct API calls. Responses include achatUrlfor the user to continue in the RunWhen UI.
PREFER direct tools for:
run_slx— EXECUTE a task (workspace_chat CANNOT run tasks)Task authoring —
validate_script,run_script_and_wait,commit_slx,delete_slxRegistry —
search_registry,get_registry_codebundle,deploy_registry_codebundleChat configuration —
list_chat_rules,create_chat_rule, etc.KB mutations —
create_knowledge_base_article,update_knowledge_base_article,delete_knowledge_base_articleWorkspace discovery —
list_workspacesRunner config —
get_workspace_secrets,get_workspace_locationsLocal context —
get_workspace_context(reads RUNWHEN.md)
The remaining read/query tools (get_workspace_issues, get_workspace_slxs, get_run_sessions, get_issue_details, get_slx_runbook, list_knowledge_base_articles) overlap with what workspace_chat can do internally. Use them ONLY when you need raw structured JSON for programmatic processing (e.g. counting, filtering by field, feeding into code). For user-facing answers, prefer workspace_chat.
REGISTRY (search before build): search_registry — find reusable automation; get_registry_codebundle — full details; deploy_registry_codebundle — deploy a registry codebundle as an SLX (different from commit_slx which embeds inline scripts).
TASK AUTHORING WORKFLOW:
0. search_registry — check for existing codebundles first
get_workspace_context— load RUNWHEN.md rules (ALWAYS call first)get_workspace_secrets+get_workspace_locations— discover configvalidate_script— check contract compliancerun_script_and_wait— test against live infrastructurecommit_slx— save as SLX (supports task + SLI together)
SCRIPT CONTRACT:
Python task:
main()returns List[Dict] with keys: 'issue title', 'issue description', 'issue severity' (1-4), 'issue next steps'Bash task:
main()writes issue JSON array to FD 3 (>&3)Python/Bash SLI:
main()returns/writes float 0-1
REQUIRED TAGS for commit_slx: access='read-write'|'read-only', data='logs-bulk'|'config'|'logs-stacktrace'
SKILLS (progressive disclosure for any MCP client):
This server exposes 15 SKILL.md guides as MCP resources under the
runwhen-skill://URI scheme. Each skill has a short description in the resource list and a full body fetchable on demand — the standards-correct way to keep your context lean.Cross-vendor clients can also use the
list_skillsandget_skill(name)tool shims to discover and load skills without touching MCP resources.Available skills:
author-generation-rules,build-operational-context,build-runwhen-task,commit-to-codecollection,configure-hierarchy,configure-resource-path,create-ai-assistant,discover-locations,discover-secrets,find-and-deploy-codebundle,manage-commands,manage-knowledge,manage-rules,run-existing-slx,verify-mcp-setup.ALWAYS prefer reading the relevant skill over guessing — tool docstrings cross-link to the skills they pair with.
Capabilities
Features and capabilities supported by this server
Protocol revision2025-11-25
| Capability | Details |
|---|---|
| tools | {
"listChanged": true
} |
| logging | {} |
| prompts | {
"listChanged": true
} |
| resources | {
"subscribe": false,
"listChanged": true
} |
Tools
Functions exposed to the LLM to take actions
| Name | Description | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| workspace_chatA | Ask the RunWhen AI assistant about your infrastructure. This is the PRIMARY tool for investigating infrastructure. It sends your message to the RunWhen workspace AI agent, which searches, navigates and correlates across resources, SLXs, issues, run sessions, and the knowledge base, and returns rich markdown reports, diagrams, and tables. PREFER THIS TOOL over direct read/query tools (get_workspace_issues, get_workspace_slxs, get_run_sessions, etc.) for any question that involves searching by topic, keyword, or context — e.g. "issues related to neo4j", "what's failing in namespace X?", "health of the watcher cluster". workspace_chat produces materially better answers because it can search, filter, and correlate across all workspace data internally. Use direct tools instead ONLY for: executing tasks ( | ||||||||||||||||||
| list_workspacesA | List all workspaces you have access to. Returns workspace names, display names, and basic metadata. | ||||||||||||||||||
| get_workspace_chat_configA | Get resolved chat rules and commands for a workspace. Returns the list of rules and commands that apply to the workspace (and optional persona). These are the same rules and commands the workspace chat assistant sees. Response includes metadata only (id, name, scope); full rule/command content is not included in this endpoint. | ||||||||||||||||||
| list_chat_rulesC | List chat rules (workspace chat rules). Uses AgentFarm internal API; may require network access. | ||||||||||||||||||
| get_chat_ruleA | Get a single chat rule by ID (full content). | ||||||||||||||||||
| create_chat_ruleC | Create a chat rule. Uses AgentFarm internal API. Skill: runwhen-skill://manage-rules (scoping + wording guidance). | ||||||||||||||||||
| update_chat_ruleC | Update an existing chat rule by ID. | ||||||||||||||||||
| list_chat_commandsC | List chat commands (slash-command instructions). | ||||||||||||||||||
| get_chat_commandB | Get a single chat command by ID (full content). | ||||||||||||||||||
| create_chat_commandA | Create a chat command (slash-command). Name must be alphanumeric, underscore, or hyphen only. Skill: runwhen-skill://manage-commands (scoping, scheduling, sinks). Commands are invoked in chat as /label. To run a command on a schedule, set | ||||||||||||||||||
| update_chat_commandA | Update an existing chat command by ID. Omitted fields are left unchanged. Schedule fields ( | ||||||||||||||||||
| list_assistantsA | List AI assistants (personas) configured in a workspace. An assistant is a persona — its | ||||||||||||||||||
| get_assistantB | Get a single AI assistant (persona) by its short name (full config). | ||||||||||||||||||
| create_assistantA | Create a new AI assistant (persona) in a workspace. Skill: runwhen-skill://create-ai-assistant (full setup workflow). An assistant is a persona that tailors how the RunWhen AI investigates and
acts — e.g. an "Azure DevOps Helper" focused on a specific tech stack. The
After creating the assistant, shape its behavior by attaching persona-scoped rules and commands: This is an UPSERT — calling it again with an existing short_name REPLACES
the assistant's full configuration (omitted fields reset to defaults). To
change a few fields on an existing assistant, use | ||||||||||||||||||
| update_assistantA | Partially update an existing AI assistant (persona). Fetches the current configuration, applies only the fields you provide
(leaving everything else intact), then writes the merged result back.
Use this instead of | ||||||||||||||||||
| delete_assistantA | Delete (soft-delete) an AI assistant (persona) from a workspace. Persona-scoped rules and commands attached to this assistant are not removed automatically — clean them up separately if no longer needed. | ||||||||||||||||||
| get_workspace_issuesA | Get current issues for a workspace (structured JSON). Issues represent detected problems in your infrastructure that RunWhen has identified through automated health checks. NOTE: For questions like "issues related to neo4j" or "what's failing
in namespace X", prefer | ||||||||||||||||||
| get_workspace_slxsA | List ALL SLXs in a workspace (structured JSON). No filtering. SLXs are the fundamental unit of work in RunWhen — each represents a health check, task, or automation runbook for a piece of infrastructure. The underlying PAPI endpoint is paginated (100 SLXs per page); this tool
auto-paginates internally, following It accepts only For other shapes:
Use this raw-list tool only when you need to enumerate every SLX for programmatic processing (counting, batch operations, etc). | ||||||||||||||||||
| get_run_sessionsA | Get recent run sessions for a workspace (structured JSON). Run sessions are executions of SLX runbooks — they contain the output of health checks, troubleshooting tasks, and automation runs. NOTE: For investigative questions like "what ran recently for service X?"
or "show me recent failures", prefer | ||||||||||||||||||
| get_issue_detailsA | Get detailed information about a specific issue (structured JSON). NOTE: Prefer | ||||||||||||||||||
| get_slx_runbookA | Get the runbook for a specific SLX (structured JSON). Returns the runbook definition including what tasks it runs, how they're configured, and what they check. NOTE: For questions like "what does this SLX do?" or "what tasks does it
run?", prefer | ||||||||||||||||||
| list_knowledge_base_articlesA | List Knowledge Base articles (notes) in a workspace (structured JSON). Returns KB articles that feed the workspace's Knowledge Overlay Graph. Articles can contain operational knowledge, runbook context, architecture notes, or any information useful for troubleshooting. NOTE: For questions like "what do we know about service X?", prefer
| ||||||||||||||||||
| get_knowledge_base_articleB | Get a specific Knowledge Base article by ID. | ||||||||||||||||||
| create_knowledge_base_articleA | Create a new Knowledge Base article in a workspace. Skill: runwhen-skill://manage-knowledge (article scoping + lifecycle). KB articles are indexed into the Knowledge Overlay Graph and become searchable by the workspace AI assistant and other tools. Content should be informative operational knowledge — architecture notes, troubleshooting guides, runbook context, dependency documentation, etc. | ||||||||||||||||||
| update_knowledge_base_articleA | Update an existing Knowledge Base article. Only provided fields are updated; omitted fields remain unchanged. | ||||||||||||||||||
| delete_knowledge_base_articleB | Delete a Knowledge Base article. Removes the article from the workspace and the Knowledge Overlay Graph index. | ||||||||||||||||||
| search_registryA | Search the RunWhen CodeBundle Registry for reusable automation. Skill: runwhen-skill://find-and-deploy-codebundle (search → deploy workflow). Use this BEFORE writing a custom script — there may already be a production-ready codebundle for the task. Returns codebundles with their tasks, SLIs, required env vars, and deployment metadata. | ||||||||||||||||||
| get_registry_codebundleA | Get full details of a specific codebundle from the registry. Use after search_registry to get complete information including configuration templates, environment variables, and deployment instructions. | ||||||||||||||||||
| deploy_registry_codebundleA | Deploy a registry codebundle as an SLX to a workspace. Unlike commit_slx (which embeds inline scripts via the Tool Builder codebundle), this deploys a pre-built codebundle from its own codecollection repository. The runbook.robot / sli.robot live in the codebundle's git repo — no inline script is needed. Use search_registry + get_registry_codebundle to find the right codebundle, then call this tool with the values from the registry. | ||||||||||||||||||
| get_workspace_contextA | Get domain-specific context for building RunWhen tasks. Reads the project's RUNWHEN.md file, which contains infrastructure conventions, database access rules, naming patterns, architectural knowledge, and other constraints that scripts must follow. The file is auto-discovered by walking up from the current working directory. Override with the RUNWHEN_CONTEXT_FILE env var if needed. IMPORTANT: Call this BEFORE writing any task or script to understand the target environment's rules and relationships. | ||||||||||||||||||
| list_skillsA | List every progressive-disclosure skill the server exposes. Returns Cross-vendor note: this is the same information that | ||||||||||||||||||
| get_skillB | Return the full body of a skill by name. Returns | ||||||||||||||||||
| get_workspace_secretsA | List available secret keys with platform grouping and mapping guidance. Returns a structured payload that helps agents pick the right
Response shape:: { "workspace": "", "secrets": [], "platform_groups": { "kubernetes": ["kubeconfig"], "azure": [...], ... }, "recommended_secret_vars": { "kubernetes": { "kubeconfig": "kubeconfig" }, "azure": { "AZURE_CLIENT_ID": "...", ... }, ... }, "runtime_semantics": "", "skill_reference": "runwhen-skill://discover-secrets", } Critical for agents: workspace secrets are injected into scripts as
FILE PATHS, not literal values. See the | ||||||||||||||||||
| get_workspace_locationsA | List runner locations with auto-resolution guidance and recommendations. Returns a structured payload that tells the agent which location to
use (or to omit the parameter entirely when auto-resolution can pick).
The raw list is preserved in Response shape:: { "workspace": "", "count": , "locations": [], "private": [], # workspace-type runners (preferred) "public": [], # shared runners (fallback) "recommended": "<name|null>", "auto_resolves": , # True when run_*/commit_slx can pick alone "disambiguation_hint": "...", "skill_reference": "runwhen-skill://discover-locations", }
| ||||||||||||||||||
| validate_scriptA | 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):
Skill: runwhen-skill://build-runwhen-task (full authoring workflow). | ||||||||||||||||||
| run_scriptA | 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:
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. | ||||||||||||||||||
| get_run_statusA | Check the status of a script run. Poll this after run_script to check if execution has completed. Status values: RUNNING, SUCCEEDED, FAILED. | ||||||||||||||||||
| get_run_outputA | Get the output artifacts from a completed script run. Returns parsed, human-readable results including:
| ||||||||||||||||||
| run_script_and_waitA | Execute a script and wait for results (combines run + poll + output). This is a convenience tool that runs a script, polls until completion, and returns the full output — all in one call. Use this instead of calling run_script + get_run_status + get_run_output separately. The script must follow the RunWhen contract:
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. Bash scripts must NOT include
| ||||||||||||||||||
| run_slxA | Run an existing SLX's runbook tasks on the workspace runner. Skill: runwhen-skill://run-existing-slx — and default This triggers execution of a previously committed SLX (not an ad-hoc script). Use this when you want to run a health check, troubleshooting task, or automation that already exists in the workspace. IMPORTANT: This is different from run_script / run_script_and_wait, which execute ad-hoc scripts. Use run_slx to trigger SLXs that are already committed and configured in the workspace. NOTE: workspace_chat CANNOT run tasks directly — it can only search for and describe them. Use this tool to actually execute an SLX. The tool creates a RunSession with the run request, polls until completion, and returns the results including pass/fail status and any issues found. | ||||||||||||||||||
| commit_slxA | Commit a tested script as an SLX to the workspace Git repo. Skills:
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):
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:
Output contracts (the two scripts are NOT interchangeable):
Script-content footguns:
| ||||||||||||||||||
| delete_slxA | Soft-delete an SLX from the workspace via the v4 short-name endpoint. Uses Deletion is workspace-global — it is not scoped to a Git branch.
The v4 endpoint tombstones the SLX row in PAPI; there is no per-branch
variant. Callers previously wired to a Git-oriented delete path should
stop passing | ||||||||||||||||||
| list_discovery_platformsA | List supported generation-rule platforms and default render settings. Skills:
Call this before | ||||||||||||||||||
| list_indexed_resource_typesA | Search bundled indexer catalogs for valid generation-rule resourceTypes. Skills:
Fully offline — reads For azure/aws/gcp, | ||||||||||||||||||
| render_codecollection_skillA | Render a tested tool-builder task as a private Custom Discovery CodeCollection. Skills:
Emits the standard codecollection layout (generation rule + Jinja templates) for
workspace-builder discovery. Templates delegate runtime to
Also writes This tool does not push to git or mutate the workspace — it renders files locally
(or returns them inline) for you to Default generation rule uses Requires runwhen-local with the matching platform indexer enabled. |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
No prompts | |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
| skill:author-generation-rules | Write Custom Discovery generation rules using bundled runwhen-local reference (airgap-safe, no network). Use when: (1) Authoring .runwhen/generation-rules/*.yaml, (2) Choosing resourceTypes or matchRules, (3) Looking up indexer resource types, (4) Fixing legacy generation-rule YAML, or (5) Validating against the bundled schema. |
| skill:build-operational-context | Build operational context in a RunWhen workspace by adding Rules, Commands, and Knowledge Base articles. Use when: (1) The user wants to improve assistant investigation quality or tune workspace behavior, (2) Onboarding engineers or teams to a workspace, (3) Adding institutional knowledge, architecture docs, or ownership details, (4) Following the operational context maturity model, or (5) The user asks about improving workspace chat quality or adding context. |
| skill:build-runwhen-task | Build, test, and commit a RunWhen automation task (SLX). Use when: (1) Creating a new health check or monitoring task, (2) Building a troubleshooting runbook or diagnostic script, (3) Writing and testing a bash or python script for RunWhen runners, (4) Committing an SLX with commit_slx, (5) Running run_script_and_wait or run_script to test automation, or (6) The user asks to create, build, write, or test any RunWhen task or SLX. |
| skill:commit-to-codecollection | Render a tested tool-builder task as a private Custom Discovery CodeCollection for GitOps. Use when: (1) The user wants version-controlled storage instead of commit_slx to a workspace, (2) Publishing tool-builder output to a private git repo shaped like simple-private-codecollection, (3) After run_script_and_wait succeeds and the user chooses GitOps over inline workspace SLX, (4) The user asks to commit to a codecollection, private codecollection, or generation-rule repo, or (5) You need to confirm secrets, env vars, and runtime repo URL before baking them into TaskSet templates. |
| skill:configure-hierarchy | Set the hierarchy on an SLX to define UI grouping and path construction from tags. Use when: (1) Committing an SLX and need to set its hierarchy parameter, (2) Organizing SLXs into groups for the map view, (3) The user asks about hierarchy, SLX grouping, additionalContext, or map view organization, or (4) Configuring how SLXs appear in the workspace UI tree. |
| skill:configure-resource-path | Set the resourcePath on an SLX for workspace-chat indexing and search. Use when: (1) Committing an SLX and need to set its resource_path parameter, (2) Configuring SLX metadata for search and indexing, (3) The user asks about resourcePath, additionalContext, or how SLXs are found by workspace chat, or (4) Improving SLX discoverability in search results. |
| skill:create-ai-assistant | Create and tailor a new AI Assistant (Agent / persona) in a RunWhen workspace. Use when: (1) The user wants a dedicated assistant for a tech stack, team, or domain (e.g. 'Azure DevOps', 'Postgres on-call'), (2) Creating, updating, or deleting an assistant via create_assistant / update_assistant / delete_assistant, (3) Tailoring an assistant's behavior with persona-scoped rules and commands, or (4) The user asks to build an agent, assistant, or persona. |
| skill:discover-locations | Discover and select runner locations for RunWhen scripts. Use when: (1) Choosing where to execute a task or script, (2) The user asks about runner locations or execution environments, (3) Multiple locations exist and you need to pick the right one, or (4) Building a task that needs a specific cluster or region for execution. |
| skill:discover-secrets | Discover and configure secrets for RunWhen SLX scripts. Use when: (1) Choosing which secrets to map for a task via secret_vars, (2) The user asks about secret configuration, authentication, or credentials, (3) Building a task that needs API tokens, kubeconfigs, or service account keys, or (4) Understanding how secrets are injected as file paths on runners. |
| skill:find-and-deploy-codebundle | Search the RunWhen CodeBundle Registry for production-ready automation and deploy it as an SLX. Use when: (1) Adding monitoring or health checks for Kubernetes, databases, or cloud services, (2) The user asks to create a health check and a registry codebundle may already exist, (3) Deploying pre-built automation instead of writing custom scripts, or (4) Searching for existing codebundles by keyword or platform. |
| skill:manage-commands | Create, update, and manage workspace chat commands (slash-commands) that package reusable investigation procedures. Use when: (1) The user wants to create repeatable diagnostic workflows or slash-commands, (2) Building onboarding flows or standardized investigation patterns, (3) Creating or editing commands via create_chat_command or update_chat_command, or (4) The user asks about chat commands, slash-commands, or /commands. |
| skill:manage-knowledge | Create, update, and manage Knowledge Base articles that provide operational context to AI assistants. Use when: (1) The user wants to add institutional knowledge, architecture notes, or ownership details, (2) Creating or updating KB articles via create_knowledge_base_article or update_knowledge_base_article, (3) Adding operational context that improves investigation quality, or (4) The user asks about knowledge base, KB articles, or documentation for the workspace. |
| skill:manage-rules | Create, update, and manage workspace chat rules that shape how AI assistants interpret infrastructure findings. Use when: (1) The user wants to suppress noise or adjust investigation priorities, (2) Adding operational context or tuning assistant behavior, (3) Creating or editing chat rules via create_chat_rule or update_chat_rule, or (4) The user asks about rules, assistant behavior, or investigation tuning. |
| skill:run-existing-slx | Run an existing SLX (health check, task, or automation) that is already committed to a workspace. Use when: (1) The user asks to execute, trigger, or run an existing task, (2) Running a health check or diagnostic on demand, (3) Calling run_slx to execute a previously committed SLX, or (4) The user references a specific SLX name to run. |
| skill:verify-mcp-setup | Validate a RunWhen MCP server installation is working end-to-end. Use when: (1) First connecting to a new MCP server, (2) After deployment, upgrade, or config change, (3) The user asks to verify, validate, check, or test the MCP setup, (4) Troubleshooting connectivity or permission issues, or (5) The user says 'checklist', 'smoke test', or 'health check' about the MCP server itself. |
TDQS
Scored across 45 tools
Most tool families are distinct, but the broad workspace_chat tool deliberately overlaps with raw read tools for issues, SLXs, run sessions, and KB articles. Convenience pairs like run_script/run_script_and_wait and get_workspace_chat_config/list_chat_rules add further selection ambiguity, though descriptions provide helpful guidance.
Names are overwhelmingly snake_case and follow a verb_noun pattern (list_*, get_*, create_*, update_*, delete_*). The main deviation is workspace_chat, which is not a verb_noun action, and there is minor inconsistent prefixing such as get_workspace_slxs versus get_slx_runbook.
45 tools is far above the well-scoped 3-15 range and exceeds the 25+ threshold for 'too many'. The domain is broad, but the surface still feels heavy and could be consolidated into fewer, more task-oriented tools.
Core lifecycles are well covered: KB and assistant CRUD are complete, and script, SLX, registry, and discovery flows have create/read/execute/delete paths. However, chat rules and chat commands lack delete operations despite assistant deletion requiring cleanup, and SLX/workspace management is only partially covered.