Skip to content

codegen: CLI-generated TS files omit @description in header JSDoc, causing skill to show uninformative tool names #94

@bug-ops

Description

@bug-ops

Description

When generate (CLI path, no LLM categorization) produces TypeScript tool files, the header JSDoc block only includes @tool and @server tags. The @description tag is conditionally rendered only when a short_description is provided via LLM categorization (generate_with_categories()). Without it, the skill parser cannot find a description for the tool.

As a result, the skill command generates SKILL.md with fallback descriptions of the form "{tool_name} tool" (e.g., "format_document tool") instead of the actual tool descriptions from the MCP server.

Reproduction Steps

  1. mcp-execution-cli generate --from-config mcpls
  2. mcp-execution-cli skill --server mcpls --overwrite
  3. View the generated SKILL.md at ~/.claude/skills/mcpls/SKILL.md
  4. Observe each tool listed as: formatDocument — format_document tool

Expected Behavior

SKILL.md tool entries should use actual tool descriptions from the MCP server, e.g.:

- `formatDocument` — Format document with language-specific rules. Returns text edits for indentation, spacing, and style.

Actual Behavior

SKILL.md shows:

- `formatDocument` — format_document tool
- `getCachedDiagnostics` — get_cached_diagnostics tool

Root Cause

In ProgressiveGenerator::create_tool_context() (crates/mcp-codegen/src/progressive/generator.rs, line 361):

short_description: categorization.map(|c| c.short_description.clone()),

short_description is None when no LLM categorization is provided. The template guard {{#if short_description}} * @description {{short_description}} {{/if}} then omits the @description tag from the header JSDoc. The description field (line 356) IS populated with the tool description but is only used in the function-level JSDoc, not the header.

The skill parser (crates/mcp-skill/src/parser.rs) only reads @description from the file header JSDoc, so it returns None for description and the context builder falls back to "{tool_name} tool".

Fix: When categorization is None, fall back to description (from tool.description) for short_description in create_tool_context().

Environment

  • Version: 0.7.0 (HEAD c7c5e1b)
  • CI-004 live testing session
  • Tested with mcpls server (16 tools)

Logs / Evidence

Generated header JSDoc (actual):

/**
 * @tool format_document
 * @server mcpls
 */

Expected header JSDoc:

/**
 * @tool format_document
 * @server mcpls
 * @description Format document with language-specific rules. Returns text edits for indentation, spacing, and style.
 */

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: codegenCode generationbugSomething isn't workingcrate: mcp-codegenChanges to mcp-codegen crate (TypeScript code generation)priority: mediumMedium priority

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions