Skip to main content
Glama
yigitkonur

example-mcp-server-stdio

by yigitkonur

Explain Formula

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
NameRequiredDescriptionDefault
formulaYesThe formula to explain
examplesNoInclude examples

Implementation Reference

  • 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.`,
          },
        ],
      };
  • 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.`,
            },
          ],
        };
      },
    );
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. While 'explain' and 'interactively' imply a read-only, informative operation, the description doesn't clarify what 'interactively' entails (e.g., step-by-step guidance, visual aids, or user prompts), nor does it mention any limitations like formula complexity, supported notations, or potential errors. This leaves significant gaps in understanding the tool's behavior.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is extremely concise—a single sentence with no wasted words. It's front-loaded with the core purpose ('explain a mathematical formula') and includes the key behavioral trait ('interactively') efficiently. Every word earns its place, making it easy to parse quickly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the lack of annotations and output schema, the description is incomplete for a tool with two parameters and interactive behavior. It doesn't explain what the output looks like (e.g., text explanation, steps, or visual elements), how 'interactively' manifests, or any constraints on formula input. For a tool that likely involves complex processing, this leaves too much unspecified for effective agent use.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema description coverage is 100%, meaning both parameters ('formula' and 'examples') are fully documented in the schema. The description adds no additional semantic information about these parameters beyond what's in the schema, such as expected formula formats or what types of examples are included. With high schema coverage, the baseline score of 3 is appropriate as the description doesn't compensate but also doesn't detract.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose with a specific verb ('explain') and resource ('mathematical formula'), and the adverb 'interactively' adds useful context about the nature of the explanation. However, it doesn't explicitly differentiate this from sibling tools like 'solve_math_problem' or 'calculator_assistant', which likely have overlapping domains.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. With sibling tools like 'solve_math_problem' and 'calculator_assistant' available, there's no indication of whether this tool is for educational purposes, step-by-step breakdowns, or other specific contexts where it would be preferred over those alternatives.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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/yigitkonur/example-mcp-server-stdio'

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