Skip to main content
Glama
IBM

MCP Math Server

by IBM

sum_of_two_squares

Find integer pairs (a,b) such that a² + b² equals a given number, solving the sum of two squares problem in additive number theory.

Instructions

Express a number as sum of two squares if possible. (Domain: arithmetic, Category: additive_number_theory)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nYes
Behavior2/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 states the tool expresses a number as a sum of two squares 'if possible,' implying it may return a result or indicate impossibility, but doesn't specify the output format, error handling, or performance characteristics. For a tool with mathematical computation, more behavioral context would be helpful.

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 concise and front-loaded, consisting of a single sentence that states the core purpose followed by domain context. There's no wasted verbiage, and the structure is clear. However, the parenthetical domain information could be integrated more smoothly, and the brevity comes at the cost of completeness.

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?

Given the tool's mathematical nature, no annotations, no output schema, and low parameter documentation, the description is incomplete. It doesn't explain what the output looks like (e.g., pair of integers, error message), mathematical constraints, or how it handles edge cases. The domain context helps but doesn't compensate for these gaps.

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

Parameters2/5

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

The input schema has 0% description coverage, with a single parameter 'n' of type integer. The description adds minimal parameter semantics by implying 'n' is the number to be expressed, but doesn't specify constraints (e.g., positive integers, range limits) or provide examples. Given the low schema coverage, the description doesn't adequately compensate for the lack of parameter documentation.

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

Purpose4/5

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

The description clearly states the tool's purpose: 'Express a number as sum of two squares if possible.' It specifies the verb ('express'), resource ('a number'), and condition ('if possible'), and mentions the mathematical domain. However, it doesn't explicitly differentiate from sibling tools like 'sum_of_two_squares_all' or 'sum_of_four_squares', which would require more specific scope information.

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 minimal usage guidance. It mentions the domain ('arithmetic, Category: additive_number_theory'), which gives some context, but offers no explicit instructions on when to use this tool versus alternatives like 'sum_of_two_squares_all' or other number decomposition tools. There's no mention of prerequisites, constraints, or typical use cases.

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

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