CtrlK
BlogDocsLog inGet started
Tessl Logo

mcp-schema-enum-regression

Keep generated MCP schemas strict-client compatible by avoiding nullable enum signatures.

61

Quality

52%

Does it follow best practices?

Impact

Pending

No eval scenarios have been run

SecuritybySnyk

Passed

No known issues

Optimize this skill with Tessl

npx tessl skill review --optimize ./.squad/skills/mcp-schema-enum-regression/SKILL.md
SKILL.md
Quality
Evals
Security

Context

Use this when an MCP client rejects tool schemas because enum arrays include invalid sentinel members (often surfaced as null or empty strings).

Patterns

  • Test the published contract with ListToolsAsync() and recurse every schema node that contains an enum array.
  • Treat nullable enum parameters in MCP tool signatures as the hazard point; strict clients do not tolerate the SDK's sentinel output for them.
  • Keep the primary action parameter as a required enum when you want discoverable action lists.
  • Emit other action-specific enum inputs as optional strings, then parse them in generated MCP code before routing.
  • For [FromString] enum paths, keep the string transport shape and let the existing service-side parser do the enum conversion.

Examples

  • src/ExcelMcp.Generators.Mcp/McpToolGenerator.cs: required action enum, optional enum-like inputs as strings, local parse for direct enum parameters.
  • tests/ExcelMcp.McpServer.Tests/Integration/Tools/GeneratedToolSchemaEnumRegressionTests.cs: recursive schema regression plus focused optional-parameter check.

Anti-Patterns

  • Do not patch one generated .g.cs output by hand.
  • Do not leave nullable enums in published MCP signatures and hope clients normalize them.
  • Do not fix only action; scan every enum-bearing property across the tool catalog.
Repository
sbroenne/mcp-server-excel
Last updated
Created

Is this your skill?

If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.