Skip to main content
Glama

revise_thought

Update and refine existing thoughts within structured thinking workflows to improve clarity, accuracy, and progression through problem-solving stages.

Instructions

Revises a thought in memory and in the thought history.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
thoughtNoThe content of the current thought
thought_numberNoCurrent position in the sequence
total_thoughtsNoExpected total number of thoughts
next_thought_neededNoWhether another thought should follow
stageNoCurrent thinking stage (e.g., 'Problem Definition', 'Analysis')
is_revisionNoWhether this revises a previous thought
revises_thoughtNoNumber of thought being revised
branch_from_thoughtNoStarting point for a new thought branch
branch_idNoIdentifier for the current branch
needs_more_thoughtsNoWhether additional thoughts are needed
scoreNoQuality score (0.0 to 1.0)
tagsNoCategories or labels for the thought
thought_idYesThe ID of the thought to revise

Implementation Reference

  • Core handler function implementing the revise_thought tool: locates thought by ID, applies updates to specified fields, flags as revision, persists changes to history, and returns formatted response.
    reviseThought(input: { 
      thought_id: number;
      thought?: string;
      thought_number?: number;
      total_thoughts?: number;
      next_thought_needed?: boolean;
      stage?: string;
      is_revision?: boolean;
      revises_thought?: number;
      branch_from_thought?: number;
      branch_id?: string;
      needs_more_thoughts?: boolean;
      score?: number;
      tags?: string[];
    }): any {
      try {
        // Find the thought to revise
        const thought = this.findThoughtById(input.thought_id);
        if (!thought) {
          throw new Error(`Thought with ID ${input.thought_id} not found`);
        }
        
        // Update thought properties with any provided values
        if (input.thought !== undefined) thought.thought = input.thought;
        if (input.next_thought_needed !== undefined) thought.nextThoughtNeeded = input.next_thought_needed;
        if (input.stage !== undefined) thought.stage = thoughtStageFromString(input.stage);
        if (input.is_revision !== undefined) thought.isRevision = input.is_revision;
        if (input.revises_thought !== undefined) thought.revisesThought = input.revises_thought;
        if (input.branch_from_thought !== undefined) thought.branchFromThought = input.branch_from_thought;
        if (input.branch_id !== undefined) thought.branchId = input.branch_id;
        if (input.needs_more_thoughts !== undefined) thought.needsMoreThoughts = input.needs_more_thoughts;
        if (input.score !== undefined) thought.score = input.score;
        if (input.tags !== undefined) thought.tags = input.tags;
        
        // Set revision flag
        thought.isRevision = true;
        
        // Update thought in history
        this.updateThought(thought);
        
        return {
          content: [{
            type: "text",
            text: JSON.stringify({
              status: "success",
              revision: {
                thoughtNumber: thought.thoughtNumber,
                stage: thought.stage,
                updated: true,
                timestamp: DateTime.now().toISO()
              }
            }, null, 2)
          }]
        };
        
      } catch (e) {
        return this.handleError(e);
      }
    }
  • Zod schema for revise_thought tool inputs, extending captureThoughtSchema with required thought_id and optional other fields.
    export const reviseThoughtSchema = captureThoughtSchema.extend({
      thought_id: z.number().int().positive().describe("The ID of the thought to revise")
    }).partial().required({ thought_id: true });
  • src/tools.ts:52-57 (registration)
    MCP Tool object registration defining name, description, parameters schema, and input schema for revise_thought.
    export const reviseThoughtTool: Tool = {
      name: "revise_thought",
      description: "Revises a thought in memory and in the thought history.",
      parameters: reviseThoughtSchema,
      inputSchema: zodToInputSchema(reviseThoughtSchema)
    };
  • src/tools.ts:85-85 (registration)
    Inclusion of reviseThoughtTool in the exported toolDefinitions array used for listing available tools.
    reviseThoughtTool,
  • index.ts:99-118 (handler)
    Dispatch handler in MCP server that routes revise_thought calls to the SequentialThinkingServer.reviseThought method.
    case "revise_thought": {        
      if (!params.arguments) {
        console.error("ERROR: params.arguments object is undefined in revise_thought request");
        return {
          content: [{
            type: "text",
            text: JSON.stringify({
              error: "Invalid request: params.arguments object is undefined",
              status: "failed"
            })
          }],
          isError: true
        };
      }
      
      // Cast the arguments to match reviseThoughtSchema
      const reviseParams = params.arguments as z.infer<typeof reviseThoughtSchema>;
      
      return thinkingServer.reviseThought(reviseParams);
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the tool revises a thought in memory and history, implying a mutation, but doesn't clarify permissions, side effects, or what 'revise' entails (e.g., overwriting, updating). For a mutation tool with zero annotation coverage, this leaves significant gaps in understanding its behavior and impact.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that directly states the tool's action. It's front-loaded and wastes no words, making it easy to parse. However, it could be more structured by including key details like the required 'thought_id' parameter, but overall, it's appropriately concise for its purpose.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity of 13 parameters, no annotations, and no output schema, the description is inadequate. It doesn't explain the revision process, return values, or how parameters like 'thought_id' and 'revises_thought' interact. For a mutation tool with rich input schema but no behavioral context, this leaves the agent under-informed about critical aspects of tool usage.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema description coverage is 100%, with all 13 parameters well-documented in the input schema. The description doesn't add any meaning beyond the schema, such as explaining parameter interactions or usage examples. Given the high coverage, a baseline score of 3 is appropriate, as the schema does the heavy lifting without extra value from the description.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states the tool 'revises a thought in memory and in the thought history,' which provides a clear verb ('revises') and resource ('a thought'). However, it doesn't differentiate from sibling tools like 'capture_thought' or 'clear_thinking_history' beyond the basic action. The purpose is understandable but lacks specificity about what revision entails compared to other thought-related operations.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description offers no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites, such as needing an existing thought to revise, or compare it to siblings like 'capture_thought' for new thoughts. Without any context on usage scenarios or exclusions, the agent must infer when this tool is appropriate.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

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/Promptly-Technologies-LLC/mcp-structured-thinking'

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