Skip to content

Stale schema examples in consts.ts still reference type: 'command' / 'pipeline' #16

@bananabot9000

Description

@bananabot9000

Problem

packages/mcp-exec/src/consts.ts still contains examples using the old discriminated union format (type: "command", type: "pipeline") from before PR #10 unified the schema to commands: [].

These stale examples are likely surfaced via .describe() or .meta() on the schema, which means Claude (and ToolSearch) sees the old format as example usage — even though the schema itself no longer accepts type.

Impact

  • Claude uses examples to guide tool calls. Old examples → old format → validation errors on first attempt
  • SDK caches tools/list results per session, so the stale examples persist until session restart
  • Discovered during mid-session MCP version switching test — Claude kept using type: "command" because the examples told it to

Fix

Update all examples in consts.ts to use the unified commands: [] format. No type field.

Broader question

Should examples live in consts.ts at all, or should they be inline with the schema definitions (.describe() / .meta())? Centralised consts can drift from the schema they describe. Inline examples are co-located with the schema they reference — harder to forget to update.

🤖 Generated with Claude Code

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions