Skip to main content
Glama
thinking.test.ts1.76 kB
import { describe, it, expect } from "vitest"; import { sequentialThinkingHandler } from "./thinking.js"; describe("Thinking Tools", () => { describe("sequential_thinking", () => { it("should record a simple thought", () => { const result = sequentialThinkingHandler({ thought: "This is step 1", step: 1, total_steps: 3, next_action: "CONTINUE", }); const text = result.content[0].text; const json = JSON.parse(text); expect(json.status).toBe("THOUGHT_RECORDED"); expect(json.thought_complexity).toBe("Low"); expect(json.assessment.quality).toBe("Low"); expect(json.assessment.suggestions).toContain("Proceed with next step."); }); it("should identify high complexity thought", () => { const longThought = "a".repeat(501); const result = sequentialThinkingHandler({ thought: longThought, step: 2, total_steps: 3, next_action: "CONTINUE", }); const json = JSON.parse(result.content[0].text); expect(json.thought_complexity).toBe("High"); expect(json.assessment.suggestions).toContain( "This step is complex. Consider breaking it down further or using REVISE to double-check key assumptions.", ); }); it("should suggest increasing steps if at end", () => { const result = sequentialThinkingHandler({ thought: "Wait, I need more time", step: 3, total_steps: 3, next_action: "CONTINUE", }); const json = JSON.parse(result.content[0].text); expect(json.assessment.warnings).toContain( "You are at the final step but chose CONTINUE. Did you mean to conclude or do you need more steps?", ); }); }); });

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/millsydotdev/Code-MCP'

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