explain_formula
Understand mathematical formulas with interactive explanations and optional examples to clarify complex calculations.
Instructions
Explain a mathematical formula interactively
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| formula | Yes | The formula to explain | |
| examples | No | Include examples |
Implementation Reference
- src/server.ts:764-779 (handler)Handler function for 'explain_formula' tool: logs the execution, increments request count, and returns a markdown-formatted explanation of the provided formula, optionally including example placeholders.async ({ formula, examples }) => { log.info('Explaining formula'); requestCount++; return { content: [ { type: 'text', text: `## Formula Explanation: ${formula}\n\n` + `This tool provides interactive explanations of mathematical formulas.\n` + `${examples ? '\n### Examples:\n- Example calculations would be shown here\n- Visual representations might be included\n' : ''}\n` + `**Note**: This tool may use elicitInput for interactive learning.`, }, ], };
- src/server.ts:752-755 (schema)Zod input schema for 'explain_formula' tool defining required 'formula' string and optional 'examples' boolean.const explainFormulaInputSchema = { formula: z.string().describe('The formula to explain'), examples: z.boolean().optional().describe('Include examples'), };
- src/server.ts:757-781 (registration)Registration of the 'explain_formula' MCP tool, specifying title, description, input schema, and inline handler function.server.registerTool( 'explain_formula', { title: 'Explain Formula', description: 'Explain a mathematical formula interactively', inputSchema: explainFormulaInputSchema, }, async ({ formula, examples }) => { log.info('Explaining formula'); requestCount++; return { content: [ { type: 'text', text: `## Formula Explanation: ${formula}\n\n` + `This tool provides interactive explanations of mathematical formulas.\n` + `${examples ? '\n### Examples:\n- Example calculations would be shown here\n- Visual representations might be included\n' : ''}\n` + `**Note**: This tool may use elicitInput for interactive learning.`, }, ], }; }, );