Skip to main content
Glama
runwhen-contrib

RunWhen Platform MCP

Render Codecollection Skill

render_codecollection_skill

Render a tested tool-builder task as a private Custom Discovery CodeCollection. Emits generation rules, Jinja templates, and decoded scripts for review.

Instructions

Render a tested tool-builder task as a private Custom Discovery CodeCollection.

Skills:

  • runwhen-skill://commit-to-codecollection (GitOps workflow)

  • runwhen-skill://build-runwhen-task (authoring + testing first)

Emits the standard codecollection layout (generation rule + Jinja templates) for workspace-builder discovery. Templates delegate runtime to rw-generic-codecollection/codebundles/tool-builder with base64 GEN_CMD.

Also writes .runwhen/SKILL_TEMPLATE.md with the decoded script summary and .runwhen/raw_script.{py,sh} with the full decoded script so PR reviewers and automated systems never need to base64-decode TaskSet templates.

This tool does not push to git or mutate the workspace — it renders files locally (or returns them inline) for you to git add / commit / push.

Default generation rule uses platform: runwhen and resourceTypes: [workspace]. For cloud/Kubernetes discovery, set platform to kubernetes, azure, aws, or gcp and pass resource_types / match_rules / slx_qualifiers from the bundled indexer catalogs (list_indexed_resource_types). Discovery SLX templates include the platform tag/hierarchy includes (e.g. kubernetes-tags.yaml).

Requires runwhen-local with the matching platform indexer enabled.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dataNo'logs-bulk', 'config', or 'logs-stacktrace'.logs-bulk
tagsNoResource tags ({name, value} dicts).
aliasYesHuman-readable SLX display name.
accessNo'read-write' or 'read-only'.read-write
ownersNoOwner emails for the review file (defaults to current user).
scriptNoThe full script source code (not base64).
env_varsNoEnvironment variables baked into the TaskSet config.
platformNoGeneration rule platform: runwhen (one SLX per workspace), kubernetes, azure, aws, or gcp (per-resource discovery). Call list_discovery_platforms() before choosing — agents must confirm the user's target platform and scope.runwhen
base_nameNoShort SLX suffix in generation rule (<15 chars). Default: bundle_name.
hierarchyNoTag names for hierarchical grouping.
image_urlNoIcon URL for the SLX.
statementYesSLX statement describing what should be true.
output_dirNoWrite rendered files to this directory (stdio mode). When omitted, files are returned in the tool response only.
sli_scriptNoOptional separate SLI script (defaults to main script if include_sli).
task_titleNoHuman-readable task title (static literal).
bundle_nameYesCodebundle directory name (kebab-case, e.g. 'azure-function-cold-start').
include_sliNoAlso emit an SLI template (tool-builder SLI).
interpreterNo'python' or 'bash'.python
match_rulesNoMatch predicates forwarded into the generation rule YAML.
script_pathNoLocal file path for script. **stdio mode only.**
secret_varsNoSecret name → workspace secret key mappings.
runtime_varsNoPer-run runtime variables (task-only).
resource_pathNoResource path for search indexing.
script_base64NoUTF-8 script as standard base64.
resource_typesNoResource types for the generation rule (default: ['workspace']).
slx_qualifiersNoSLX name qualifiers (default: ['workspace']).
workspace_nameYesWorkspace used during tool-builder testing (provenance in review file).
sli_interpreterNoInterpreter for SLI script.
source_slx_nameNoOriginal inline SLX short name (provenance in review file).
timeout_secondsNoTask timeout passed to tool-builder runbook.
script_base64_pathNoLocal path to base64-encoded script file. **stdio mode only.**
script_gzip_base64NoUTF-8 script as base64(gzip(...)).
generic_runtime_refNoGit ref for rw-generic-codecollection pinned in templates.main
sli_interval_secondsNoSLI interval when include_sli is true.
generic_runtime_repo_urlNoOverride rw-generic-codecollection repo URL in templates.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.1.3
    • changedInput schema / properties / platform / description
      Previous value: -"Generation rule platform. Use 'runwhen' for workspace-scoped tool-builder."New value: +"Generation rule platform: runwhen (one SLX per workspace), kubernetes, azure, aws, or gcp (per-resource discovery). Call list_discovery_platforms() before choosing — agents must confirm the user's target platform and scope."
  2. Addedv0.1.1

TDQS

A4.5/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does well: it explicitly disclaims git push and workspace mutation, discloses the side-effect of writing .runwhen files to disk, and states the environment precondition. It stops short of covering failure modes, whether rendering is idempotent, or how output_dir behaves on invalid input, so it is strong 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?

Front-loaded with the one-line purpose, then segmented into skills, emitted layout, non-goals, platform defaults, and preconditions using bold and short paragraphs. Slightly long for a tool definition and repeats the git non-goal mildly, but every block carries distinct routing or behavioral information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given 35 parameters and an existing output schema (so return values need no explanation), the description covers the pieces an agent cannot infer: the emitted file layout, the platform-dependent generation rule, required runtime environment, and the git hand-off boundary. Remaining gaps — error handling, idempotency, and any limits on repeated rendering — are minor rather than blocking.

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 coverage is 100%, so the baseline is 3; the description adds genuine meaning by grouping the discovery-related parameters — platform default 'runwhen' vs kubernetes/azure/aws/gcp per-resource discovery, and the paired resource_types/match_rules/slx_qualifiers sourced from the bundled indexer catalogs. It explains base_name (<15 chars, defaults to bundle_name) and the base64 GEN_CMD delegation, going beyond the schema text.

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?

States a specific verb and resource ('Render a tested tool-builder task as a private Custom Discovery CodeCollection') and immediately enumerates the concrete artifacts emitted (generation rule + Jinja templates, .runwhen/SKILL_TEMPLATE.md, raw_script files). This clearly separates it from siblings like commit_slx or deploy_registry_codebundle, which the agent can rule out without opening a schema.

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?

Names the prerequisite workflow explicitly via the runwhen-skill URIs ('build-runwhen-task (authoring + testing first)') and draws the boundary against git operations: 'does not push to git or mutate the workspace — it renders files locally ... for you to git add / commit / push.' It also routes platform selection to list_discovery_platforms/list_indexed_resource_types and states the 'Requires runwhen-local with the matching platform indexer enabled' precondition.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.