Skip to main content
Glama
tanishra

Mathematics MCP Server

by tanishra

gcd

Calculate the greatest common divisor of two integers. Get the largest number that divides both inputs without a remainder.

Instructions

Calculate the Greatest Common Divisor (GCD) of two numbers. Args: data (TwoNumberOperation): An object containing two numbers, a and b. Returns: Dict[str, Any]: A dictionary containing the operation result or an error message. Raises: ValueError: If inputs are not integers. Notes: - Both numbers must be integers. - Returns the largest number that divides both inputs. - Logs the operation and result.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dataYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. First observedv0.1.0

TDQS

A4.4/5.0
Behavior4/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It reveals that the operation logs activity, returns a dictionary with either a result or an error message, and raises ValueError for non-integer inputs. These are meaningful behavioral traits beyond the bare operation, though it does not specify whether the operation has side effects beyond logging.

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 well-structured with Args, Returns, Raises, and Notes sections, making it scannable. The main purpose is front-loaded, and each section adds useful information. There is minor redundancy between the Raises section and the Notes bullet about integers, but overall the length is justified.

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

Completeness5/5

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

For a simple mathematical operation, the description is complete: it covers the operation, input constraints, error behavior, return format, and side-effect logging. An output schema exists, so return-value details need no further explanation. An agent has everything needed to invoke the tool correctly and interpret its outcome.

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

Parameters4/5

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

Schema description coverage is reported as 0%, so the description must compensate. It explains that `data` is a TwoNumberOperation object containing `a` and `b`, and adds the critical constraint that both must be integers. It also clarifies that the operation produces the largest dividing number, giving semantic meaning to the parameters beyond the schema's minimal 'First number' and 'Second number' labels.

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

Purpose5/5

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

The description opens with a specific verb and resource: 'Calculate the Greatest Common Divisor (GCD) of two numbers.' It later defines the result as 'the largest number that divides both inputs,' which precisely distinguishes it from sibling tools like lcm, since LCM is the least common multiple. This leaves no ambiguity about what the tool does.

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

Usage Guidelines4/5

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

The description gives clear context for use: it is for computing the GCD of two integers. It states the prerequisite that both numbers must be integers, and it notes that a ValueError is raised if they are not, which guides the agent on input preparation. However, it does not explicitly mention alternatives like lcm or when to prefer one over the other, so it stops short of a 5.

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

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/tanishra/math-mcp-server'

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