Skip to main content
Glama
halfords-pro

@halfords-pro/calculator

by halfords-pro

@halfords-pro/calculator

An MCP (Model Context Protocol) server providing calculator tools with precise decimal arithmetic, suitable for accounting and tax calculations.

Features

  • Precise decimal arithmetic — uses decimal.js to avoid floating-point errors

  • Excel-style rounding — round half away from zero (ROUND_HALF_UP), the standard for accounting and tax

  • MCP protocol — integrates with any MCP-compatible client (Claude Desktop, Claude Code, etc.)

Related MCP server: mcp-abacus

Installation

npm install -g @halfords-pro/calculator

Usage

Claude Desktop

Add to your Claude Desktop configuration (claude_desktop_config.json):

{
  "mcpServers": {
    "calculator": {
      "command": "npx",
      "args": ["-y", "@halfords-pro/calculator"]
    }
  }
}

Claude Code

claude mcp add calculator -- npx -y @halfords-pro/calculator

Tools

sum

Sum an array of signed decimal numbers and round the result to a specified number of decimal places.

Parameters:

Name

Type

Required

Description

values

number[]

Yes

Array of signed decimal numbers to sum

decimalPlaces

number

Yes

Number of decimal places to round the result to

Examples:

sum({ values: [1.00, -2.50, 3.89], decimalPlaces: 2 })
→ "2.39"

sum({ values: [1.00, -2.50, 3.89283829, -539.38390293], decimalPlaces: 4 })
→ "-536.9911"

sum({ values: [0.1, 0.2], decimalPlaces: 2 })
→ "0.30"  (not 0.30000000000000004)

Rounding behaviour:

Uses "round half away from zero" (equivalent to Excel ROUND()):

Value

Rounded to 2dp

2.125

2.13

-2.125

-2.13

2.124

2.12

Development

# Install dependencies
npm install

# Build
npm run build

# Run tests
npm test

# Run tests with coverage
npm run test:coverage

# Launch MCP Inspector
npm run inspector

License

ISC

Available Tools

1 tool
sumA

Sum an array of signed decimal numbers and round the result to a specified number of decimal places. Uses precise decimal arithmetic suitable for accounting and tax calculations. Rounding uses the 'round half away from zero' strategy (equivalent to Excel ROUND).

ParametersJSON Schema
NameRequiredDescriptionDefault
valuesYesArray of signed decimal numbers to sum (e.g. [1.00, -2.50, 3.89])
decimalPlacesYesNumber of decimal places to round the result to (e.g. 2 for 2 decimal places)

TDQS

A4.4/5.0
Behavior5/5

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

With no annotations, the description carries the full burden of behavioral disclosure. It reveals that arithmetic is precise decimal, that rounding uses 'round half away from zero', and that the rounding applies to the result. These are meaningful behavioral details beyond the basic sum operation, so an agent can predict the tool's output and limitations.

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?

Three sentences, no filler. The primary operation and rounding behavior are front-loaded, followed by precision context and a concrete Excel comparison. Every sentence earns its place.

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

Completeness4/5

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

For a simple two-parameter math tool, the description covers the operation, precision model, rounding strategy, and typical use case. It does not mention return value or parameter constraints like decimalPlaces being a non-negative integer, but those are inferable and low risk. The description is effectively complete for this complexity level.

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 already covers 100% of parameters with descriptions and examples. The tool description reinforces these semantics by mentioning signed decimal numbers and rounding the result, but adds no constraints or edge-case handling beyond the schema. Baseline 3 is appropriate.

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 ('Sum'), the exact resource (an array of signed decimal numbers), and an additional transformation (rounding to a specified number of decimal places). It is unambiguous and fully describes the tool's core function even with no sibling tools to differentiate from.

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?

There are no sibling tools to compare against, but the description provides strong usage context by noting it is 'suitable for accounting and tax calculations' and equivalent to Excel ROUND. This implicitly tells the agent when to prefer it, though it does not explicitly state exclusions or alternatives.

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.

  1. 1 tool updatev0.1.1
    • First observedsum

TDQS

A4.1/5.0
Disambiguation5/5

With only one tool, there is zero ambiguity—the 'sum' tool has a clear, singular purpose that cannot be confused with anything else.

Naming Consistency5/5

The single tool name 'sum' is simple, descriptive, and perfectly aligned with its operation, presenting no inconsistency issues.

Tool Count2/5

A calculator server exposing only one tool is too sparse for its apparent domain; even a minimal arithmetic toolkit would include multiple basic operations.

Completeness1/5

The server covers only addition, missing essential operations like subtraction, multiplication, division, or more advanced calculator functions, making the surface severely incomplete.

Maintenance

ActivityInactive
ResponsivenessNo issues

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

Related MCP Servers

  • A
    license
    A
    quality
    A
    maintenance
    Pure-Python MCP server for type-faithful calculation — evaluate expressions under fixed-point, IEEE-754 double, or exact rational arithmetic, with every answer labelled with its precision (exact vs inexact).
    5
    1
    GPL 3.0
  • A
    license
    A
    quality
    D
    maintenance
    An MCP server and CLI providing business, financial, and tax calculations including math expressions, income tax estimates, loan amortization, depreciation, and more.
    10
    2
    MIT
  • A
    license
    B
    quality
    C
    maintenance
    High-precision mathematics server for MCP clients, providing exact integer arithmetic, symbolic derivatives, and numerical calculus via LaTeX-style input.
    6
    17
    2
    MIT

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/halfords-pro/calculator'

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