think
Facilitate structured reasoning and step-by-step analysis during complex problem-solving. Append thoughts to logs for policy verification, decision-making chains, and enhanced sequential reasoning processes without altering external states.
Instructions
Use this tool to think about something. It will not obtain new information or change anything, but just append the thought to the log. Use it when complex reasoning or cache memory is needed, especially during long chains of tool calls, policy adherence scenarios, or sequential decision making.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| thought | Yes | A thought to think about. This can be structured reasoning, step-by-step analysis, policy verification, or any other mental process that helps with problem-solving. |
Implementation Reference
- src/index.ts:34-51 (handler)The handler function for the "think" tool. It logs the input thought with a timestamp to the thoughtsLog array and returns a confirmation message in the MCP format.async ({ thought }) => { // Log the thought with a timestamp const timestamp = new Date().toISOString(); this.thoughtsLog.push({ timestamp, thought }); console.error(`[${timestamp}] Thought recorded: ${thought.substring(0, 50)}${thought.length > 50 ? '...' : ''}`); // Return a confirmation return { content: [{ type: "text", text: `Thought recorded: ${thought.length > 50 ? thought.substring(0, 50) + '...' : thought}` }] }; }
- src/index.ts:33-33 (schema)The input schema for the "think" tool, defining a single string parameter 'thought' using Zod validation.{ thought: z.string().describe("A thought to think about. This can be structured reasoning, step-by-step analysis, policy verification, or any other mental process that helps with problem-solving.") },
- src/index.ts:31-52 (registration)The registration of the "think" tool using the McpServer.tool() method, including name, description, schema, and handler function."think", "Use this tool to think about something. It will not obtain new information or change anything, but just append the thought to the log. Use it when complex reasoning or cache memory is needed, especially during long chains of tool calls, policy adherence scenarios, or sequential decision making.", { thought: z.string().describe("A thought to think about. This can be structured reasoning, step-by-step analysis, policy verification, or any other mental process that helps with problem-solving.") }, async ({ thought }) => { // Log the thought with a timestamp const timestamp = new Date().toISOString(); this.thoughtsLog.push({ timestamp, thought }); console.error(`[${timestamp}] Thought recorded: ${thought.substring(0, 50)}${thought.length > 50 ? '...' : ''}`); // Return a confirmation return { content: [{ type: "text", text: `Thought recorded: ${thought.length > 50 ? thought.substring(0, 50) + '...' : thought}` }] }; } );