Skip to main content
Glama
tanishra

Mathematics MCP Server

by tanishra

factorial

Find the product of all positive integers from 1 to a given non-negative integer. Accepts only non-negative integers and returns an error for invalid inputs.

Instructions

Calculate the factorial of a given number. Args: data (SingleNumberOperation): An object containing the input number a. Returns: Dict[str, Any]: A dictionary containing the operation result or an error message. Raises: ValueError: If the input is negative or not an integer. Notes: - Only works with non-negative integers. - 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?

There are no annotations, so the description carries the behavioral disclosure burden. It discloses error behavior (ValueError on negative/non-integer), valid input domain, that it 'Logs the operation and result,' and that it returns a dictionary with result or error. It does not describe output key names, but the presence of an output schema reduces the need for that detail.

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 core purpose is front-loaded in the first sentence, and the rest is a compact docstring organized into Args, Returns, Raises, and Notes. There is minor redundancy between the Raises section and the first Note, but every section adds useful information and there is no filler.

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 single-parameter mathematical tool, the description provides everything needed: purpose, parameter structure, valid input domain, error conditions, side effects, and return container. Since an output schema exists, return-value details are already covered. An agent can confidently select and invoke this tool without additional context.

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 0%, so the description needs to compensate. It explains that `data` is a `SingleNumberOperation` object containing the input number `a`, and clarifies the valid domain as non-negative integers. This is sufficient for constructing the argument, though the exact nested JSON shape is left to the schema.

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 states a specific verb and resource: 'Calculate the factorial of a given number.' This unambiguously identifies the operation and distinguishes it from sibling math tools like add, power, sqrt, and logarithm. There is no vague or misleading language.

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 provides clear usage constraints: 'Only works with non-negative integers' and raises ValueError for negative or non-integer input. This tells the agent when the tool can be used and what inputs are invalid. It does not explicitly name alternatives for non-factorial operations, but the operation itself is unique among the siblings.

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