Commit graph servers/src/sequentialthinking/index.ts
Author SHA1 Message Date
Niels Kaspers
1cdf806d21
fix(sequential-thinking): use z.coerce for number and boolean params (#3533)
fix(sequential-thinking): use z.coerce for number and safe preprocess for boolean params

Uses z.coerce.number() for number fields and a z.preprocess() helper for boolean fields to handle string-typed parameters from LLM clients. The preprocess approach correctly handles "false" → false, avoiding the z.coerce.boolean() footgun where Boolean("false") === true.

Fixes #3428
2026-03-15 10:09:04 -07:00
Niels Kaspers
c2ee97e792
feat(sequential-thinking): add tool annotations (#3534)
feat(sequential-thinking): add tool annotations

Adds MCP ToolAnnotations (readOnlyHint, destructiveHint, idempotentHint, openWorldHint) to the sequential-thinking tool, bringing it in line with the annotation pattern established by the filesystem server.

Fixes #3403
2026-03-15 08:50:08 -07:00
Koichi ITO
902eed6fbf
fix(sequential-thinking): Fix a typo for nextThoughtNeeded (#3010)
This PR fixes the `nextThoughtNeeded` parameter that was missed in #3004.
2025-11-25 21:04:30 +00:00
adam jones
88a2ac4360
fix(sequential-thinking): convert to modern TypeScript SDK APIs (#3014)
* fix(sequential-thinking): convert to modern TypeScript SDK APIs

Convert the sequential-thinking server to use the modern McpServer API
instead of the low-level Server API.

Key changes:
- Replace Server with McpServer from @modelcontextprotocol/sdk/server/mcp.js
- Use registerTool() method instead of manual request handlers
- Use Zod schemas directly in inputSchema/outputSchema
- Add structuredContent to tool responses
- Fix type literals to use 'as const' assertions

The modern API provides:
- Less boilerplate code
- Better type safety with Zod
- More declarative tool registration
- Cleaner, more maintainable code

* fix: exclude test files from TypeScript build

Add exclude for test files and vitest.config.ts to tsconfig

* refactor: remove redundant validation now handled by Zod

Zod schema already validates all required fields and types. Removed
validateThoughtData() method and kept only business logic validation
(adjusting totalThoughts if needed).

* fix(sequentialthinking): add Zod validation to processThought method

The modern API migration removed manual validation from processThought(),
but tests call this method directly, bypassing the Zod validation in the
tool registration layer. This commit adds Zod validation directly in the
processThought() method to ensure validation works both when called via
MCP and when called directly (e.g., in tests).

Also improves error message formatting to match the expected error
messages in the tests.

* refactor: simplify by removing redundant validation

Since processThought() is only called through the tool registration in
production, validation always happens via Zod schemas at that layer.
Removed redundant validation logic from processThought() and updated
tests to reflect this architectural decision.

Changes:
- Remove Zod validation from processThought() method
- Accept ThoughtData type instead of unknown
- Remove 10 validation tests that are now handled at tool registration
- Add comment explaining validation approach
2025-11-20 19:05:30 +00:00
jnick26
6dda92b77b
fix(sequential-thinking): Keep case of json params and description same
Models are confused about the case of the variables, which results into random validation errors. Keeping them the same helps to remove back and forth.
2025-11-15 12:58:40 +02:00
olaservo
0b5f7e17ec Merge branch 'main' of https://github.com/olaservo/servers 2025-10-07 23:06:25 -07:00
olaservo
072e53322b Add tests for sequential thinking and update typescript sdk versions 2025-10-07 23:01:42 -07:00
claude[bot]
ec91421265 Improve parameter descriptions in sequential-thinking for better LLM type safety
Update thoughtNumber and totalThoughts parameter descriptions to use positive-only examples that guide LLMs toward correct numeric type usage. This addresses the issue where LLMs sometimes generate string values (e.g. "1") instead of numeric values (e.g. 1) for integer parameters.

Co-authored-by: Ola Hungerford <olaservo@users.noreply.github.com>
2025-08-24 03:27:40 +00:00
Benjamin Bartels
921f08287e
Update index.ts 2025-06-23 17:36:05 +01:00
Benjamin Bartels
ba97644240
Update index.ts 2025-06-23 16:24:57 +01:00
Benjamin Bartels
e35fd67efd
Adds ability to disable thought logging 2025-06-23 16:22:34 +01:00
Skirano
91f1a0ac6e updated version 2024-11-30 10:35:37 -05:00
Skirano
9d88abff0d Everart and thinking server 2024-11-27 16:03:04 -05:00