Skip to main content
Glama
yigitkonur

example-mcp-server-stdio

by yigitkonur

Calculator Assistant

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
NameRequiredDescriptionDefault
queryYesThe user query or question
contextNoAdditional context

Implementation Reference

  • 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.`,
          },
        ],
      };
    },
  • 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.`,
            },
          ],
        };
      },
    );
Behavior1/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. However, it only states 'Interactive calculator assistance with context-aware help', which is too vague to convey any behavioral traits. It doesn't specify whether this is a read-only or mutative operation, what kind of help is provided (e.g., explanations, calculations, or troubleshooting), or any constraints like rate limits or authentication needs. This lack of detail makes the tool's behavior opaque.

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

Conciseness4/5

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

The description is concise and front-loaded, consisting of a single phrase 'Interactive calculator assistance with context-aware help'. It wastes no words, though it could be more informative. However, its brevity is appropriate for a simple tool, and it doesn't include unnecessary details, earning a high score for efficiency.

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 2 parameters and multiple sibling tools. It doesn't explain what the tool returns, how it interacts with the provided parameters, or its role relative to other calculator tools. While the schema covers parameters, the overall context is insufficient for an AI agent to fully understand the tool's function and application.

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 input schema has 100% description coverage, with parameters 'query' and 'context' clearly documented in the schema itself. The description adds no additional meaning beyond what the schema provides, as it doesn't elaborate on what constitutes a valid 'query' or how 'context' should be used. Given the high schema coverage, the baseline score of 3 is appropriate, as the schema handles the parameter documentation adequately.

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

Purpose2/5

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

The description 'Interactive calculator assistance with context-aware help' is vague and tautological, essentially restating the tool name 'calculator_assistant' with minor elaboration. It doesn't specify what the tool actually does (e.g., answer math questions, provide step-by-step solutions, or offer usage tips), nor does it distinguish it from sibling tools like 'calculate', 'solve_ath_problem', or 'explain_formula'. This leaves the purpose unclear beyond a generic calculator-related function.

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

Usage Guidelines1/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. It doesn't mention any specific contexts, prerequisites, or exclusions, and fails to differentiate it from sibling tools such as 'calculate' or 'solve_ath_problem'. This absence of usage instructions makes it difficult for an AI agent to select this tool appropriately among the available options.

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