Skip to content

fix(opencode-plugin): enrich workflow parameter description from YAML metadata#277

Merged
mrsimpson merged 1 commit into
mainfrom
fix/wrap-mcp-tools-in-plugin
May 7, 2026
Merged

fix(opencode-plugin): enrich workflow parameter description from YAML metadata#277
mrsimpson merged 1 commit into
mainfrom
fix/wrap-mcp-tools-in-plugin

Conversation

@mrsimpson
Copy link
Copy Markdown
Collaborator

Summary

The OpenCode plugin's start-development tool previously showed only "Workflow name" as the workflow parameter description, missing the rich metadata (complexity, bestFor, examples) defined in each workflow YAML file. This meant LLMs using the plugin had no context about which workflow to choose.

Root Cause

generateWorkflowDescription() and buildWorkflowEnum() in @codemcp/workflows-server (MCP server) were not re-exported from the package's index.ts, making them unavailable to external consumers like the OpenCode plugin.

Fix

  1. Export helpers from MCP server package (packages/mcp-server/src/index.ts): Added re-export of generateWorkflowDescription() and buildWorkflowEnum() from ./server-helpers.js

  2. Update plugin to use rich descriptions (packages/opencode-plugin/src/tool-handlers/start-development.ts):

    • Changed z.string().describe('Workflow name') to z.enum(buildWorkflowEnum(workflowNames)).describe(generateWorkflowDescription(availableWorkflows))
    • This provides both an enum constraint (valid workflow choices) and a rich description with per-workflow metadata

Before/After

Before: workflow: z.string().describe('Workflow name')

After: The workflow parameter now shows for each workflow its displayName, description, complexity, bestFor, and examples from the YAML definition. For example, the epcc workflow description includes:

• **epcc**: epcc - Explore, Plan, Code, Commit - ideal for features and iterative development
  Complexity: medium
  Best for: Medium-sized features, Iterative development, Research-heavy tasks, Exploratory coding
  Examples: Add user profile management, Implement search functionality, and 1 more

Testing

  • All 836 tests pass across 4 packages (Core: 385, MCP server: 286, Plugin: 64, CLI: 101)
  • No regressions
  • Build succeeds across all packages
  • Pre-commit hooks (lint-staged, oxlint, prettier, build) pass cleanly

… metadata

The OpenCode plugin's start-development tool previously showed only
"Workflow name" as the workflow parameter description, missing rich
metadata (complexity, bestFor, examples) from workflow YAML files.

Root cause: generateWorkflowDescription() and buildWorkflowEnum() in
@codemcp/workflows-server were not exported, making them unavailable
to external consumers like the OpenCode plugin.

Fix:
- Export generateWorkflowDescription() and buildWorkflowEnum() from
  @codemcp/workflows-server package index.ts
- Update opencode-plugin to use z.enum(buildWorkflowEnum()) with
  .describe(generateWorkflowDescription()) instead of plain
  z.string().describe("Workflow name")
@mrsimpson mrsimpson merged commit f8c6c72 into main May 7, 2026
3 checks passed
@mrsimpson mrsimpson deleted the fix/wrap-mcp-tools-in-plugin branch May 7, 2026 10:14
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.

1 participant