Calculator MCP Server
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Calculator MCP ServerWalk me through solving 2x + 5 = 15"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Calculator MCP Server
A Model Context Protocol (MCP) server built with FastMCP that exposes a
calculator as a set of tools, resources, and prompts for use by an LLM
client.
Tools
Basic:
add,subtract,multiply,divideAdvanced:
power,square_root,percentage
Each tool validates its inputs (division by zero, negative square roots, undefined powers, zero-denominator percentages) and returns a formatted string, and logs every successful calculation to an in-memory history.
Related MCP server: calculator-mcp-server
Resources
constants://math— pi, e, the golden ratio, and tauhistory://calculations— a chronological log of every calculation made during the current session
Prompts
solve_equation(problem)— walks a word problem step by step, directing the model to use the calculator tools for arithmeticcalculation_help(topic)— explains which tools/resources are relevant to a topic, with a worked example
Running it
uv sync
uv run python calculator_server.pyPoint an MCP client (e.g. Claude Desktop, or an MCP inspector) at that command over stdio.
Available Tools
7 toolsaddA
Add two numbers together.
Args: a: The first number. b: The second number.
Returns: A string with the sum of a and b.
| Name | Required | Description | Default |
|---|---|---|---|
| a | Yes | ||
| b | Yes |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
The description states a return value ('A string with the sum of a and b') and implies no side effects. However, the stated return type is suspicious for a numeric addition, so the behavioral disclosure is present but potentially inaccurate.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is extremely concise: one purpose sentence, two parameter lines, and one return line. No irrelevant information is included, and the structure makes each component easy to parse.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a simple two-number addition tool, the description provides the essential information needed to call it correctly. It omits edge cases and constraints, but those are not necessary for this level of complexity; the only notable gap is the questionable return type.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The schema only provides numeric types, but the description adds roles for both parameters: 'a: The first number' and 'b: The second number'. This compensates for the schema's lack of descriptions, though it adds no constraints or edge-case semantics.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description begins with 'Add two numbers together', a specific verb and resource that clearly identifies the operation. This distinguishes it from sibling arithmetic tools like subtract, multiply, divide, power, square_root, and percentage.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies use when an addition or sum is needed but does not explicitly contrast with sibling tools or state when not to use it. The name and operation are unambiguous enough for a simple arithmetic tool, so the guidance is adequate but implicit.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
divideA
Divide the first number by the second.
Args: a: The numerator. b: The denominator. Must not be zero.
Returns: A string with the result of a / b, or an error message if b is zero.
| Name | Required | Description | Default |
|---|---|---|---|
| a | Yes | ||
| b | Yes |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
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 explicitly states that b must not be zero, and that a zero denominator results in an error message rather than an exception. This covers the key behavioral edge case. It also mentions the return type (string), which is useful. While it does not discuss side effects (there are none) or permissions, these are not relevant for a pure arithmetic operation.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is concise and well-structured, with a clear opening statement followed by parameter explanations and a return specification. There is zero fluff; every sentence earns its place. The key operation is front-loaded, and the args/returns format is easy to parse.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a simple arithmetic tool, the description is complete. It explains the inputs, the output format (string), and the error condition (zero denominator). Even though an output schema exists, the description provides the essential information an agent needs to invoke the tool correctly. There are no hidden requirements or missing details.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 0%, so the description is the sole source of parameter meaning. It clearly defines a as 'the numerator' and b as 'the denominator', and adds the constraint that b must not be zero. This fully compensates for the schema's lack of descriptions and adds meaning beyond the raw numeric type.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description states a specific verb and resource ('Divide the first number by the second') that unambiguously identifies the operation. It naturally distinguishes from sibling tools like add, subtract, multiply, and power without any ambiguity. The purpose is immediately clear.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides clear context for when to use this tool: whenever division is needed. It does not explicitly mention alternatives or exclusions, but given the arithmetic sibling set, the intended use is obvious. There are no competing tools that could be confused with division, so the guidance is adequate without being explicit.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
multiplyA
Multiply two numbers together.
Args: a: The first number. b: The second number.
Returns: A string with the product of a and b.
| Name | Required | Description | Default |
|---|---|---|---|
| a | Yes | ||
| b | Yes |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Since no annotations are provided, the description carries full responsibility. It discloses that the return value is a string containing the product, which is a key behavioral detail. It does not mention side effects, but for a pure calculation tool, this is sufficient transparency.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is exceptionally concise, consisting of a single operation statement, a clear list of arguments, and a return type. Every sentence is necessary and no filler or redundancy exists.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a simple arithmetic tool, the description fully covers the operation, inputs, and output. There are no missing details that would prevent correct usage, and the scope is narrow enough that additional context would be superfluous.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The schema already defines both parameters as required numbers, achieving 100% coverage. The description adds minimal value by labeling them as 'the first number' and 'the second number,' which is a trivial restatement of positional intent and does not introduce new constraints or semantics.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the operation: 'Multiply two numbers together.' This is a specific verb with a clear resource, and it distinguishes itself from sibling tools like add, subtract, and divide by its unique function.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies usage when multiplication is needed, but it does not explicitly state when to use this tool versus alternatives. No mention of edge cases or conditions that would guide selection among the sibling arithmetic tools.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
percentageA
Compute what percentage 'part' is of 'whole'.
Args: part: The partial amount. whole: The total amount. Must not be zero.
Returns: A string with the percentage part is of whole, or an error message if whole is zero.
| Name | Required | Description | Default |
|---|---|---|---|
| part | Yes | ||
| whole | Yes |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the entire behavioral burden, and it does a good job for a pure calculation: it states the crucial whole-must-be-zero error condition and notes that the result is a string. It does not describe the exact exact formatting (e.g., decimal places or percent sign), but that can be supplied by the output schema.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is short and front-loaded: a single purpose sentence, preceded by a compact Args/Returns breakdown. Every sentence or chunk contributes to purpose, parameter interpretation, return behavior, or an edge case.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a two-number math operation, the description is adequately complete: it covers the core computation, parameter meanings, the error-on-zero case, and the return kind. The only notable missing detail is the exact textual format of the returned percentage (e.g., decimal precision, '%' sign), which the output schema may already communicate.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The schema has 0% description coverage, so the description is fully responsible for explaining both parameters. It defines part as 'the partial amount' and whole as 'the total amount', and it adds the necessary constraint that whole must not be zero. This adds real meaning that the bare number-typed schema does not provide.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the action—'Compute what percentage part is of whole'—with specific roles for both arguments. The operation is visually distinct from the sibling math tools (add, subtract, multiply, divide, power, square_root), so an agent can tell which tool to invoke.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Usage is only implied by the tool name and definition; the description does not say when to prefer it over, say, divide, or when not to use it. However, the phrase 'Compute what percentage' gives enough context that an agent can probably apply it correctly.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
powerA
Raise a number to a power.
Args: base: The base number. exponent: The exponent to raise the base to.
Returns: A string with the result of base ** exponent, or an error message if the operation is undefined (e.g. a negative base with a fractional exponent).
| Name | Required | Description | Default |
|---|---|---|---|
| base | Yes | ||
| exponent | Yes |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
The description discloses the return type (a string) and a specific edge case where an error may occur (e.g., negative base with fractional exponent). This provides useful behavioral context beyond the basic operation, though it does not enumerate all potential edge cases.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is brief and well-structured, with clear sections for the operation, arguments, and return value. Every sentence adds value and there is no redundant or extraneous information.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
The description is complete for the tool's complexity: it explains the operation, the arguments, the return format, and a notable error condition. An agent has sufficient information to invoke the tool correctly.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Both parameters (base and exponent) are described in plain language in the description, fully complementing the input schema. The schema coverage is 100%, and the descriptions add clear meaning about what each parameter represents.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool's purpose: 'Raise a number to a power.' This unambiguously distinguishes it from sibling tools like add, subtract, multiply, divide, square_root, and percentage.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description explains what the tool does but does not explicitly mention when to use it over alternatives or when not to use it. It is self-explanatory enough for a straightforward math operation, but it lacks explicit guidance on choosing it among siblings.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
square_rootA
Compute the square root of a number.
Args: value: The number to take the square root of. Must be non-negative.
Returns: A string with the square root of value, or an error message if value is negative.
| Name | Required | Description | Default |
|---|---|---|---|
| value | Yes |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations provided, so description carries full burden. It discloses that the return is a string, and that an error message is returned for negative input. This is transparent about the error handling and output format. Lacks detail on precision or rounding, but for a simple operation this is sufficient.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Concise, well-structured with Args and Returns sections. No unnecessary words. Front-loaded purpose.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a single-parameter math function, the description covers purpose, parameter constraint, and return behavior including errors. The output schema exists (per context), so the description need not explain return values in detail, but it does anyway. It could mention formatting but not critical.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema has zero description coverage, so the description compensates by explaining the parameter 'value' and its constraint (non-negative). This adds critical semantic meaning beyond the schema type.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
States a specific verb and resource: 'Compute the square root of a number.' Distinguishes from sibling arithmetic operations like add, subtract, etc. Clear and unambiguous.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Does not explicitly contrast with siblings, but the operation is self-explanatory as a distinct math function. Provides no explicit when-to-use guidance, but implies usage for square root calculations. Slight gap: no mention of alternatives for other operations, but that's obvious given the tool name and description.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
subtractA
Subtract the second number from the first.
Args: a: The number to subtract from. b: The number to subtract.
Returns: A string with the result of a - b.
| Name | Required | Description | Default |
|---|---|---|---|
| a | Yes | ||
| b | Yes |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the burden of explaining behavior. It clearly states that the operation subtracts b from a and that the result is returned as a string, which covers the primary behavioral contract. It does not mention potential edge cases, but for simple numeric subtraction this is acceptable.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is short, direct, and free of unnecessary wording. Every line serves a purpose, with argument details and return behavior clearly separated.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a simple arithmetic tool, the description provides all necessary context: what operation is performed, which argument is which, and what the return type is. No additional edge-case handling or output schema explanation is required for typical use.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The schema only provides types and titles for a and b, but the description adds crucial meaning: 'a' is the number to subtract from, and 'b' is the number to subtract. This clarifies the order-dependent semantics fully.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the operation: subtract the second number from the first. It uses a specific verb and resource, and the behavior is distinct from sibling arithmetic tools like add, multiply, divide, and power.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies when to use the tool—when a difference between two numbers is needed—but does not explicitly state when to prefer it over alternatives. There is no direct comparison or exclusion of sibling tools, leaving usage guidance somewhat implicit.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.
7 tool updates
v0.1.0- First observed
add - First observed
divide - First observed
multiply - First observed
percentage - First observed
power - First observed
square_root - First observed
subtract
TDQS
Each tool performs a unique arithmetic operation with no overlap or ambiguity. The names and descriptions clearly distinguish addition, subtraction, multiplication, division, exponentiation, square root, and percentage.
All tool names follow a consistent lowercase_with_underscores pattern (e.g., add, square_root, percentage). The naming is uniform and predictable across the set.
With 7 tools, the set covers the core arithmetic operations needed for a calculator server. The count is well within the typical 3-15 range and feels neither sparse nor bloated.
The tool set covers the essential operations (add, subtract, multiply, divide, power, square root, percentage). A modulo operation could be expected but its absence does not create a significant gap for standard calculator use.
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
Math.js MCP — wraps the mathjs.org API (free, no auth)
MCPCalc gives agents access to a comprehensive library of calculators spanning finance, math, health, construction, engineering, food, automotive, and more. It includes a full Computer Algebra System (CAS) and a grid-based Spreadsheet calculator.
Precision math engine for AI agents. 203 exact methods. Zero hallucination.
AI-callable calculators and engineering models with real formulas. No hallucinated math.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceProvides comprehensive mathematical capabilities including basic arithmetic, advanced functions, statistical tools, and access to mathematical constants. It allows users to perform computations and generate math-related prompts through a standardized MCP interface.MIT
- AlicenseNot gradedqualityDmaintenanceProvides a comprehensive set of mathematical functions as MCP tools, enabling language models to perform calculations including arithmetic, trigonometry, logarithms, and more.231MIT
- AlicenseAqualityBmaintenanceEnables advanced mathematics operations including linear algebra, vector math, symbolic computation, and calculus through MCP tools. Designed for use with Claude and other MCP-compatible LLMs.192MIT
- AlicenseAqualityBmaintenanceProvides basic arithmetic operations (add, subtract, multiply, divide) through MCP, enabling AI clients to perform calculations via natural language.423MIT
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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/JamaalDavis/calculator-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server