Skip to content

feat(mcp): discovery/validate/dry-run/run meta-tools + Glama metadata - #44

Merged
orieg merged 2 commits into
mainfrom
mcp-meta-tools
Aug 17, 2026
Merged

orieg merged 2 commits into
mainfrom
mcp-meta-tools

Conversation

@orieg

@orieg orieg commented Aug 17, 2026

Copy link
Copy Markdown
Owner

Summary

Makes the MCP server a first-class agent surface — and prepares it for a Glama A-grade (the awesome-mcp-servers badge gate) by ensuring tools/list is non-empty and every tool is well-described with correct annotations.

Previously the server exposed only one tool per workflow file, so:

Changes

  • Four always-present meta-tools with rich, Glama-graded descriptions and correct MCP annotations:

    Tool Annotation
    list_workflows read-only discover workflows + their params
    validate_workflow read-only structured validation of a file
    dry_run_workflow read-only preview steps without executing
    run_workflow destructive execute by name/path with params

    Descriptions and readOnlyHint/destructiveHint agree (no contradictions — a Glama scoring axis).

  • Latent bug fixed: per-workflow execution called engine.run(**arguments), but the signature is run(params=...) — any parameterized workflow would have raised TypeError. Now passes params correctly.

  • stdio safety: engine stdout (e.g. the dry-run preview) is captured so it can't corrupt the JSON-RPC stream; returned as preview for dry runs.

  • Per-workflow convenience tools kept (additive — no behavior removed).

  • glama.json at repo root (maintainer orieg) for Glama server verification.

  • Docs (mcp.md) document the tool model; new tests cover the resolve/validate/execute helpers.

Verification

  • 731 tests pass (7 benchmarks deselected); black/isort/mypy clean.
  • End-to-end over MCP stdio: 4 meta-tools list with an empty directory, unauthenticated; run_workflow {who: Alice}hi Alice; per-workflow tool → hi Bob.

Follow-up (needs maintainer's Glama login — Part 2/3 of the playbook)

After this merges + a release: claim the server on glama.ai, sync, configure the build (point --dir at an empty dir so only the four polished meta-tools are graded), build + publish a release to get the score, then append the Glama score badge to the awesome-mcp-servers PR entry (held pending the badge).

…data

The MCP server previously exposed only one tool per workflow file, so an empty
directory produced zero tools (nothing to introspect or grade) and an agent
could run a workflow but not discover, validate, or preview one.

- Add four always-present, well-described meta-tools with correct MCP
  annotations: list_workflows, validate_workflow, dry_run_workflow (all
  read-only) and run_workflow (destructive). tools/list is now non-empty even
  with an empty directory.
- Fix a latent bug: per-workflow execution called engine.run(**arguments),
  but run()'s signature is run(params=...); parameterized workflows would have
  raised TypeError. Now passes params correctly.
- Capture engine stdout (e.g. the dry-run preview) so it cannot corrupt the
  stdio JSON-RPC stream; return it as 'preview' for dry runs.
- Keep the per-workflow convenience tools (additive).
- Add glama.json (maintainer: orieg) for Glama server verification.
- Docs: document the tool model; tests for resolve/validate/execute helpers.

Verified end-to-end over MCP stdio: 4 meta-tools list with an empty dir;
run_workflow and per-workflow tools execute with params.
Copilot AI lite review requested due to automatic review settings August 17, 2026 07:43

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR expands the MCP server surface so agents can discover, validate, preview (dry-run), and run workflows via four always-present “meta-tools”, while preserving the existing per-workflow convenience tools. It also adds Glama metadata and updates docs/tests to reflect and verify the new tool model.

Changes:

  • Add four meta-tools (list_workflows, validate_workflow, dry_run_workflow, run_workflow) with MCP annotations and richer descriptions.
  • Fix workflow execution parameter passing (engine run(params=...)) and capture stdout to protect the JSON-RPC stream (returning dry-run output as preview).
  • Add glama.json, document the tool model, and add tests for workflow resolution/validation/execution helpers.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

File Description
src/yaml_workflow/mcp_server.py Introduces meta-tools, workflow resolution/validation/execute helpers, annotations, and updated dispatch logic.
tests/test_mcp_server.py Adds unit tests for the new helper functions and dry-run preview behavior.
docs/guide/mcp.md Updates documentation to describe the meta-tools + per-workflow tool model and MCP annotations.
glama.json Adds Glama server metadata for verification/scoring.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/yaml_workflow/mcp_server.py
Comment thread src/yaml_workflow/mcp_server.py
Comment thread docs/guide/mcp.md
- list_workflows description now says it returns an object with {count,
  workflows} (matching the actual return), not an array
- dry_run_workflow no longer claims 'no files are written': it does not
  execute tasks or cause the workflow's side effects, but writes ephemeral
  logs to a temporary workspace — description + docs corrected to match the
  read-only annotation without contradiction
@orieg

orieg commented Aug 17, 2026

Copy link
Copy Markdown
Owner Author

Addressed all three in df6ecb4: list_workflows description now matches its {count, workflows} return; dry_run_workflow no longer claims 'no files written' — it doesn't execute tasks or cause workflow side effects but writes ephemeral logs to a temp workspace, and the description/docs now say so consistent with the read-only annotation.

@orieg
orieg merged commit e612152 into main Aug 17, 2026
16 checks passed
@orieg
orieg deleted the mcp-meta-tools branch August 17, 2026 07:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants