calculator_assistant
Perform calculations and get context-aware help for math problems using this interactive assistant tool.
Instructions
Interactive calculator assistance with context-aware help
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | The user query or question | |
| context | No | Additional context |
Implementation Reference
- src/server.ts:798-819 (handler)The handler function for the 'calculator_assistant' tool. It logs activation, increments request count, and returns a structured text response offering calculator assistance features including basic arithmetic, advanced calculations, formula explanations, and step-by-step solving.async ({ query, context }) => { log.info('Calculator assistant activated'); requestCount++; return { content: [ { type: 'text', text: `## Calculator Assistant\n\n` + `**Query**: ${query}\n` + `${context ? `**Context**: ${context}\n` : ''}\n` + `I can help you with:\n` + `- Basic arithmetic operations\n` + `- Advanced calculations (factorials, logarithms, etc.)\n` + `- Formula explanations\n` + `- Step-by-step problem solving\n\n` + `**Note**: This assistant may use elicitInput for clarification.`, }, ], }; },
- src/server.ts:786-789 (schema)Zod input schema defining 'query' as required string and 'context' as optional string for the calculator_assistant tool.const calculatorAssistantInputSchema = { query: z.string().describe('The user query or question'), context: z.string().optional().describe('Additional context'), };
- src/server.ts:791-820 (registration)Registration of the calculator_assistant tool via server.registerTool, specifying title, description, input schema, and inline handler.server.registerTool( 'calculator_assistant', { title: 'Calculator Assistant', description: 'Interactive calculator assistance with context-aware help', inputSchema: calculatorAssistantInputSchema, }, async ({ query, context }) => { log.info('Calculator assistant activated'); requestCount++; return { content: [ { type: 'text', text: `## Calculator Assistant\n\n` + `**Query**: ${query}\n` + `${context ? `**Context**: ${context}\n` : ''}\n` + `I can help you with:\n` + `- Basic arithmetic operations\n` + `- Advanced calculations (factorials, logarithms, etc.)\n` + `- Formula explanations\n` + `- Step-by-step problem solving\n\n` + `**Note**: This assistant may use elicitInput for clarification.`, }, ], }; }, );