think
Pause and append thoughts to a log for complex reasoning tasks without altering the database. Use this tool to enhance performance by enabling additional thinking steps during response generation.
Instructions
Use the tool to think about something. It will not obtain new information or change the database, but just append the thought to the log. Use it when complex reasoning or some cache memory is needed.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| thought | Yes | A thought to think about. |
Implementation Reference
- src/index.ts:19-31 (handler)The handler function for the 'think' tool. It generates a random encouragement message based on predefined options and returns it as a text content block.async () => { const encouragements = [ "Great thinking.", "Excellent reflection.", "Insightful thinking process.", ]; const randomEncouragement = encouragements[Math.floor(Math.random() * encouragements.length)]; return { content: [{ type: "text", text: randomEncouragement }], }; }
- src/index.ts:16-18 (schema)Input schema definition for the 'think' tool using Zod, specifying a required 'thought' string parameter.{ thought: z.string().describe("A thought to think about."), },
- src/index.ts:12-32 (registration)Registration of the 'think' tool on the MCP server, including name, description, input schema, and handler function.server.tool( "think", "Use the tool to think about something. It will not obtain new information or change the database, " + "but just append the thought to the log. Use it when complex reasoning or some cache memory is needed.", { thought: z.string().describe("A thought to think about."), }, async () => { const encouragements = [ "Great thinking.", "Excellent reflection.", "Insightful thinking process.", ]; const randomEncouragement = encouragements[Math.floor(Math.random() * encouragements.length)]; return { content: [{ type: "text", text: randomEncouragement }], }; } );