From e656b52f9543efdd0dabfa6452949113b2bd5fcb Mon Sep 17 00:00:00 2001 From: Fini Date: Mon, 27 Apr 2026 09:45:00 +0800 Subject: [PATCH] fix(mcp): describe section enum by parameter name, not invented schema path --- .../src/__tests__/__snapshots__/d0-parity-spike.test.ts.snap | 2 +- packages/pen-mcp/src/routes/design-routes.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/pen-mcp/src/__tests__/__snapshots__/d0-parity-spike.test.ts.snap b/packages/pen-mcp/src/__tests__/__snapshots__/d0-parity-spike.test.ts.snap index bfd2dfdf9..0302e0013 100644 --- a/packages/pen-mcp/src/__tests__/__snapshots__/d0-parity-spike.test.ts.snap +++ b/packages/pen-mcp/src/__tests__/__snapshots__/d0-parity-spike.test.ts.snap @@ -3,7 +3,7 @@ exports[`D0 parity spike — additive & gated tool registration > pre-D0 production design tool DEFINITIONS are unchanged (snapshot) > pre-d0-design-tool-definitions 1`] = ` [ { - "description": "Get design knowledge prompt. Pass \`section\` to retrieve a focused subset instead of the full prompt; the available section names are published in \`inputSchema.section.enum\` (derived at server-start from the implementation registry, so this description never drifts as sections are added). Omit \`section\` for the full prompt. The "style" and "design-md" sections are derived from the active document's design.md so the response never leaks another file's design system.", + "description": "Get design knowledge prompt. Pass \`section\` to retrieve a focused subset instead of the full prompt; the accepted section names are the enum on the \`section\` parameter below (derived at server-start from the implementation registry, so this description never drifts as sections are added). Omit \`section\` for the full prompt. The "style" and "design-md" sections are derived from the active document's design.md so the response never leaks another file's design system.", "inputSchema": { "properties": { "filePath": { diff --git a/packages/pen-mcp/src/routes/design-routes.ts b/packages/pen-mcp/src/routes/design-routes.ts index 1124caee1..e521ff9d7 100644 --- a/packages/pen-mcp/src/routes/design-routes.ts +++ b/packages/pen-mcp/src/routes/design-routes.ts @@ -26,7 +26,7 @@ const CORE_DESIGN_TOOL_DEFINITIONS = [ name: 'get_design_prompt', description: 'Get design knowledge prompt. Pass `section` to retrieve a focused subset instead of the ' + - 'full prompt; the available section names are published in `inputSchema.section.enum` ' + + 'full prompt; the accepted section names are the enum on the `section` parameter below ' + '(derived at server-start from the implementation registry, so this description never ' + 'drifts as sections are added). Omit `section` for the full prompt. The "style" and ' + '"design-md" sections are derived from the active document\'s design.md so the response ' +