Skip to main content
Glama
by fmangot

get_thought_sequence

Retrieve complete step-by-step reasoning sequences for complex problem solving, allowing review of structured thought processes and alternative reasoning paths.

Instructions

Retrieves the complete sequence of thoughts for the current or specified session

Input Schema

NameRequiredDescriptionDefault
sessionIdNoOptional session ID to retrieve (defaults to current session)

Input Schema (JSON Schema)

{ "properties": { "sessionId": { "description": "Optional session ID to retrieve (defaults to current session)", "type": "string" } }, "type": "object" }

Implementation Reference

  • The main handler function for the 'get_thought_sequence' tool. It extracts the sessionId from arguments, calls thinkingManager.getSequence(sessionId), formats the result with session info and thought count as JSON, and returns it in the MCP content format.
    case 'get_thought_sequence': { const { sessionId } = args as { sessionId?: string }; const sequence = thinkingManager.getSequence(sessionId); return { content: [ { type: 'text', text: JSON.stringify( { sessionId: sessionId || thinkingManager.getCurrentSessionId(), thoughtCount: sequence.length, thoughts: sequence, }, null, 2 ), }, ], }; }
  • The tool schema definition for 'get_thought_sequence', specifying the name, description, and input schema with optional sessionId.
    export const GET_SEQUENCE_TOOL: Tool = { name: 'get_thought_sequence', description: 'Retrieves the complete sequence of thoughts for the current or specified session', inputSchema: { type: 'object', properties: { sessionId: { type: 'string', description: 'Optional session ID to retrieve (defaults to current session)', }, }, }, };
  • Registration of the tool call handler in the HTTP MCP server, which routes calls to handleToolCall including 'get_thought_sequence'.
    server.setRequestHandler(CallToolRequestSchema, async (request) => { return handleToolCall(request.params, manager); });
  • Registration for listing tools in HTTP server; ALL_TOOLS includes the 'get_thought_sequence' schema.
    const server = new Server( { name: 'sequential-thinking-mvp-server',
  • Core helper method in SequentialThinkingManager that retrieves the thought sequence for a given session ID, used by the tool handler.
    public getSequence(sessionId?: string): StoredThought[] { const sid = sessionId || this.currentSessionId; const session = this.sessions.get(sid); return session ? session.thoughts : []; }

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/fmangot/Mcp'

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