Skip to content

Tool Reference

The RunWhen Platform MCP server exposes tools in three groups: workspace intelligence, chat rules and commands, and task authoring (Tool Builder).

Workspace intelligence

These tools let you query your RunWhen workspace for issues, tasks, run sessions, and resources — or ask the AI assistant directly.

ToolDescription
workspace_chatAsk the RunWhen AI assistant about your infrastructure. The assistant can search issues, tasks, run sessions, resources, and the knowledge base. Supports graphs and Mermaid diagrams. Use persona_name to select an Engineering Assistant.
list_workspacesList all workspaces you have access to.
get_workspace_chat_configGet resolved chat rules and commands for a workspace (metadata only). Optional persona_name.
get_workspace_issuesGet current issues. Optional severity filter (1=critical, 2=high, 3=medium, 4=low).
get_workspace_slxsList SLXs (health checks and automation tasks) in the workspace.
get_run_sessionsGet recent run session results.
get_workspace_config_indexGet the full workspace configuration — resources, SLXs, and their relationships.
get_issue_detailsGet details for a specific issue by ID.
get_slx_runbookGet the runbook definition for an SLX, including tasks, configuration, and what it checks.
search_workspaceSearch tasks, resources, and configuration by keyword.

workspace_chat

This is the most powerful tool. It talks to the RunWhen AI assistant, which has access to 25+ internal tools. Use it for natural language questions about your infrastructure:

Using workspace chat, what's unhealthy in my production namespace?
Using workspace chat, show me a diagram of how my services connect.

The optional persona_name parameter selects which Engineering Assistant handles the request (e.g. eager-edgar, cautious-cathy). This matters for workspaces where your role is readandrunwithassistant — the persona determines which tasks the assistant can run.

Chat rules and commands

These tools manage the rules and slash-commands that customize your Engineering Assistants’ behavior.

ToolDescription
list_chat_rulesList chat rules. Filter by scope_type, scope_id, is_active.
get_chat_ruleGet a chat rule by ID (full content).
create_chat_ruleCreate a new chat rule.
update_chat_ruleUpdate an existing chat rule by ID.
list_chat_commandsList chat commands (slash-commands).
get_chat_commandGet a chat command by ID (full content).
create_chat_commandCreate a new chat command.
update_chat_commandUpdate an existing chat command by ID.

Scope types

Rules and commands can be scoped to different levels:

ScopeApplies to
platformAll workspaces across the platform
orgAll workspaces in an organization
workspaceA specific workspace
personaA specific Engineering Assistant
userA specific user

Task authoring — Tool Builder

These tools let you write, test, and deploy automation scripts as SLXs directly from your IDE.

ToolDescription
get_workspace_contextLoad the project’s RUNWHEN.md file with infrastructure conventions, naming patterns, and constraints. Call this before writing scripts.
validate_scriptCheck that a script follows the RunWhen contract (correct main() function, output format, etc.).
run_scriptSend a script to a RunWhen runner for execution. Returns a run_id for polling.
get_run_statusPoll the status of a script run (RUNNING, SUCCEEDED, FAILED).
get_run_outputGet parsed output from a completed run — issues, stdout, stderr.
run_script_and_waitConvenience tool that combines run_script + get_run_status + get_run_output in one call.
commit_slxCommit a tested script as an SLX to the workspace. Supports task-only, task + custom SLI, or task + cron-scheduled SLI.
delete_slxRemove an SLX from the workspace Git repo.
get_workspace_secretsList available secret key names (e.g. kubeconfig, api-token).
get_workspace_locationsList runner locations where scripts can execute.

Key parameters

run_script / run_script_and_wait:

ParameterTypeDescription
scriptstringFull script source code
locationstringRunner location (from get_workspace_locations)
interpreterstringbash or python
run_typestringtask or sli
env_varsobjectEnvironment variables (e.g. {"NAMESPACE": "default"})
secret_varsobjectSecret mappings — env var name to workspace secret key (e.g. {"kubeconfig": "kubeconfig"})

commit_slx:

ParameterTypeDescription
slx_namestringShort name in kebab-case (e.g. k8s-pod-health)
aliasstringHuman-readable display name
statementstringWhat should be true (e.g. “All pods should be running”)
scriptstringThe task script source code
task_titlestringHuman-readable task title
locationstringRunner location
interpreterstringbash or python
sli_scriptstringOptional custom SLI script (returns 0-1)
cron_schedulestringOptional cron expression to schedule the task
accessstringread-write or read-only
datastringlogs-bulk, config, or logs-stacktrace

See Tool Builder for the full authoring workflow and script contract.