Skip to content

Improve parameter descriptions in sequential-thinking for better LLM type safety #2598

@AokiSeita-enlinks

Description

@AokiSeita-enlinks

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

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions