explain_formula
Interpret and clarify mathematical formulas by providing detailed explanations and optional examples to enhance understanding and application.
Instructions
Explain a mathematical formula interactively
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| examples | No | Include examples | |
| formula | Yes | The formula to explain |
Implementation Reference
- src/server.ts:764-780 (handler)The asynchronous handler function that executes the 'explain_formula' tool. It takes formula and optional examples parameters, logs the action, increments a request counter, and returns a markdown-formatted text response explaining the formula with optional examples section.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 schema defining the input parameters for the 'explain_formula' tool: a required 'formula' string and an 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)The server.registerTool invocation that registers the 'explain_formula' tool with its title, description, input schema, and inline handler function. This occurs within the registerExtendedTools 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.`, }, ], }; }, );