Skip to main content
Glama
kylekanouse

Demo MCP Server

by kylekanouse

Division Tool

divide

Calculate division results by inputting dividend and divisor values to perform mathematical operations.

Instructions

Divide two numbers

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
aYesDividend
bYesDivisor

Implementation Reference

  • Handler function for the 'divide' tool that performs division of two numbers and handles division by zero error.
    async ({ a, b }) => {
      if (b === 0) {
        return {
          content: [
            {
              type: "text",
              text: "Error: Division by zero is not allowed"
            }
          ],
          isError: true
        };
      }
      
      return {
        content: [
          {
            type: "text",
            text: `${a} ÷ ${b} = ${a / b}`
          }
        ]
      };
    }
  • Input schema for the 'divide' tool defining 'a' as dividend and 'b' as divisor using Zod.
    inputSchema: {
      a: z.number().describe("Dividend"),
      b: z.number().describe("Divisor")
    }
  • Registration of the 'divide' tool on the MCP server, including title, description, schema, and handler.
      "divide",
      {
        title: "Division Tool",
        description: "Divide two numbers",
        inputSchema: {
          a: z.number().describe("Dividend"),
          b: z.number().describe("Divisor")
        }
      },
      async ({ a, b }) => {
        if (b === 0) {
          return {
            content: [
              {
                type: "text",
                text: "Error: Division by zero is not allowed"
              }
            ],
            isError: true
          };
        }
        
        return {
          content: [
            {
              type: "text",
              text: `${a} ÷ ${b} = ${a / b}`
            }
          ]
        };
      }
    );
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. 'Divide two numbers' reveals nothing about error handling (division by zero), return format (integer vs. float), precision, or side effects. The description doesn't mention whether this is a pure mathematical operation or has any system dependencies. For a tool with zero annotation coverage, this minimal description leaves critical behavioral aspects unspecified.

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 maximally concise at three words with zero wasted language. It's appropriately sized for a simple mathematical operation and gets straight to the point without unnecessary elaboration. Every word earns its place in communicating the core functionality.

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?

For a mathematical operation tool with no annotations and no output schema, the description is insufficiently complete. It doesn't address critical context like error conditions (division by zero), return value format, precision limitations, or mathematical domain constraints. While the operation is conceptually simple, the description leaves too many practical implementation questions unanswered for reliable agent usage.

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?

Schema description coverage is 100%, with both parameters clearly documented as 'Dividend' and 'Divisor' in the schema. The description adds no additional parameter information beyond what's already in the structured schema. According to scoring rules, when schema coverage is high (>80%), the baseline is 3 even with no param info in the description, which applies here.

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

Purpose3/5

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

The description 'Divide two numbers' clearly states the verb (divide) and resource (numbers), making the basic purpose understandable. However, it doesn't differentiate this tool from its sibling 'multiply' beyond the obvious mathematical operation difference, nor does it specify what kind of division is performed (integer vs. floating point, error handling for division by zero). The title 'Division Tool' adds no additional clarity beyond the description.

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 like 'multiply' or 'add'. While the mathematical context is obvious, there's no explicit mention of use cases, prerequisites, or limitations. The agent must infer usage purely from the tool name and mathematical knowledge, with no tool-specific guidance provided.

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/kylekanouse/Test-MCP---DEMO-MCP-Dev-1'

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