Skip to main content
Glama

explain_formula

Understand Excel formulas by translating them into plain English explanations. Enter any formula to get a clear breakdown of its function and purpose.

Instructions

Explain what an Excel formula does in plain English

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
formulaYesExcel formula to explain (e.g., "=VLOOKUP(A2,B:C,2,FALSE)")
providerNoPreferred AI provider: anthropic, openai, deepseek, gemini, or local (optional)

Implementation Reference

  • src/index.ts:1261-1263 (registration)
    Dispatch registration in the CallToolRequestSchema handler that routes 'explain_formula' tool calls to AIOperationsHandler.explainFormula
    case 'explain_formula': return await this.aiOpsHandler.explainFormula(toolArgs); case 'ai_provider_status':
  • Tool schema definition including input schema with required 'formula' parameter and optional AI 'provider'
    name: 'explain_formula', description: 'Explain what an Excel formula does in plain English', inputSchema: { type: 'object', properties: { formula: { type: 'string', description: 'Excel formula to explain (e.g., "=VLOOKUP(A2,B:C,2,FALSE)")', }, provider: { type: 'string', description: 'Preferred AI provider: anthropic, openai, deepseek, gemini, or local (optional)', enum: ['anthropic', 'openai', 'deepseek', 'gemini', 'local'], }, }, required: ['formula'], }, },
  • Main handler function that extracts arguments, delegates to NLPProcessor.explainFormula, formats response as MCP ToolResponse
    async explainFormula(args: ToolArgs): Promise<ToolResponse> { const { formula, provider } = args; try { const explanation = await this.nlpProcessor.explainFormula(formula, provider); return { content: [ { type: 'text', text: JSON.stringify({ formula, explanation, success: true, provider: this.nlpProcessor.getActiveProvider()?.name || 'Local' }, null, 2), }, ], }; } catch (error) { return { content: [ { type: 'text', text: JSON.stringify({ formula, error: error instanceof Error ? error.message : 'Unknown error', success: false }, null, 2), }, ], }; } }
  • Core helper function in NLPProcessor that generates AI prompt for formula explanation, calls AIManager for completion, with fallback explainer
    async explainFormula(formula: string, preferredProvider?: ProviderType): Promise<string> { const prompt = `Explain this Excel formula in simple terms: ${formula}`; try { const response = await this.aiManager.createCompletion([ { role: 'user', content: prompt } ], { maxTokens: 300, temperature: 0, preferredProvider }); return response.content; } catch (error) { // console.error('Error explaining formula:', error); return this.fallbackFormulaExplainer(formula); } }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/ishayoyo/excel-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server