-
Notifications
You must be signed in to change notification settings - Fork 7.6k
Open
Description
Problem
LLMs sometimes generate string values (e.g., "1"
) instead of numeric values (e.g., 1
) for integer parameters in the sequential-thinking MCP
server, causing validation errors.
Current Implementation
The server correctly validates types with strict checking:
if (!data.thoughtNumber || typeof data.thoughtNumber !== 'number') {
throw new Error('Invalid thoughtNumber: must be a number');
}
However, the current schema descriptions are minimal:
thoughtNumber: {
type: "integer",
description: "Current thought number",
minimum: 1
},
totalThoughts: {
type: "integer",
description: "Estimated total thoughts needed",
minimum: 1
},
Enhance parameter descriptions to explicitly guide LLMs toward correct type usage:
{
thoughtNumber: {
type: "integer",
description: "Current thought number (numeric value only, e.g. 1, 2, 3 - NOT "1","2","3")
minimum: 1
},
totalThoughts: {
type: "integer",
description: "Estimated total thoughts needed (numeric value only, e.g. 5,10 - NOT "5","10")
minimum: 1
}
}
I'm not very familiar with MCP development, so please excuse me if I say something stupid!
Metadata
Metadata
Assignees
Labels
No labels