Skip to main content
Glama

Code Reasoning MCP Server

code-reasoning

Break down complex coding problems into structured, self-auditing thought steps. Enables branching, revising, and backtracking to explore solutions systematically before finalizing a response.

Instructions

🧠 Code Reasoning Tool (using sequential thinking)

Purpose → break complex problems into self-auditing, exploratory thought steps that can branch, revise, or back-track until a single, well-supported answer emerges.


WHEN TO CALL

• Multi-step planning, design, debugging, or open-ended analysis
• Whenever further private reasoning or hypothesis testing is required before replying to the user


ENCOURAGED PRACTICES

🔍 Question aggressively – ask "What am I missing?" after each step
🔄 Revise freely – mark is_revision=true even late in the chain
🌿 Branch often – explore plausible alternatives in parallel; you can merge or discard branches later
↩️ Back-track – if a path looks wrong, start a new branch from an earlier thought
Admit uncertainty – explicitly note unknowns and schedule extra thoughts to resolve them


MUST DO

✅ Put every private reasoning step in thought
✅ Keep thought_number correct; update total_thoughts when scope changes
✅ Use is_revision & branch_from_thought/branch_id precisely
✅ Set next_thought_needed=false only when all open questions are resolved
✅ Abort and summarise if thought_number > 20


DO NOT

⛔️ Reveal the content of thought to the end-user
⛔️ Continue thinking once next_thought_needed=false
⛔️ Assume thoughts must proceed strictly linearly – branching is first-class


PARAMETER CHEAT-SHEET

thought (string) – current reasoning step
next_thought_needed (boolean) – request further thinking?
thought_number (int ≥ 1) – 1-based counter
total_thoughts (int ≥ 1) – mutable estimate
is_revision, revises_thought (int) – mark corrections
branch_from_thought, branch_id – manage alternative paths
needs_more_thoughts (boolean) – optional hint that more thoughts may follow

All JSON keys must use lower_snake_case.


EXAMPLE ✔️

{ "thought": "List solution candidates and pick the most promising", "thought_number": 1, "total_thoughts": 4, "next_thought_needed": true }

EXAMPLE ✔️ (branching late)

{ "thought": "Alternative approach: treat it as a graph-search problem", "thought_number": 6, "total_thoughts": 8, "branch_from_thought": 3, "branch_id": "B1", "next_thought_needed": true }

Input Schema

NameRequiredDescriptionDefault
branch_from_thoughtNoBranching point thought number
branch_idNoIdentifier for the current branch
is_revisionNoWhether this is a revision of a previous thought
needs_more_thoughtsNoOptional hint that more thoughts may follow
next_thought_neededYesWhether another thought step is needed
revises_thoughtNoWhich thought is being revised
thoughtYesYour current reasoning step
thought_numberYesCurrent thought number (1-based)
total_thoughtsYesEstimated total thoughts needed (can be adjusted)

Input Schema (JSON Schema)

{ "properties": { "branch_from_thought": { "description": "Branching point thought number", "minimum": 1, "type": "integer" }, "branch_id": { "description": "Identifier for the current branch", "type": "string" }, "is_revision": { "description": "Whether this is a revision of a previous thought", "type": "boolean" }, "needs_more_thoughts": { "description": "Optional hint that more thoughts may follow", "type": "boolean" }, "next_thought_needed": { "description": "Whether another thought step is needed", "type": "boolean" }, "revises_thought": { "description": "Which thought is being revised", "minimum": 1, "type": "integer" }, "thought": { "description": "Your current reasoning step", "type": "string" }, "thought_number": { "description": "Current thought number (1-based)", "minimum": 1, "type": "integer" }, "total_thoughts": { "description": "Estimated total thoughts needed (can be adjusted)", "minimum": 1, "type": "integer" } }, "required": [ "thought", "next_thought_needed", "thought_number", "total_thoughts" ], "type": "object" }
Install Server

Other Tools from Code Reasoning MCP Server

Related Tools

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/mettamatt/code-reasoning'

If you have feedback or need assistance with the MCP directory API, please join our Discord server