Skip to main content
Glama
Chetto983

Mathematical Calculator MCP Server

by Chetto983

expand

Multiplies out algebraic expressions to produce simplified, expanded form.

Instructions

Expands an expression.

Args: expression: The expression to expand as a string.

Returns: On success: {"result": } On error: {"error": }

Examples: >>> expand("(x + 1)2") {'result': 'x2 + 2*x + 1'}

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
expressionYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.1.1

TDQS

B3.2/5.0
Behavior3/5

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

No annotations exist, so the description carries the full behavioral burden. It does disclose the response contract with explicit success ({"result": ...}) and error ({"error": ...}) shapes, which is genuinely useful given there is no output schema. It says nothing about error conditions (malformed/invalid expression), which symbol(s) are assumed, or whether the operation is purely symbolic with no side effects.

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?

Front-loaded one-line summary followed by Args, Returns, and Examples sections — a clean, conventional structure with no filler. The Args line is slightly redundant with the schema, but overall it is well-sized for a single-parameter tool.

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

Completeness3/5

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

For a low-complexity single-parameter math tool with no annotations and no output schema, the description covers the input and the return contract adequately. It omits the two things an agent would most want here: which symbolic variable/domain is assumed and how this differs from factorize, its inverse sibling.

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?

Schema description coverage is 0% for the single parameter, so the description must compensate. It restates the parameter as 'The expression to expand as a string' (type is already in the schema) but the example adds real meaning by showing the accepted syntax with ** for exponentiation. That is modest added value, not full compensation for the coverage gap.

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?

States a specific verb and resource ('Expands an expression') and the worked example ('(x + 1)**2' -> 'x**2 + 2*x + 1') confirms it is algebraic expansion of products/powers into sums. Clear, but it never distinguishes itself from the natural inverse sibling factorize, so an agent must still reason about which to pick.

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?

There is no when-to-use statement, no mention of factorize as the inverse operation, and no note on prerequisites or expression syntax limits. The example demonstrates a call but that is illustration, not guidance about conditions for selecting this tool over its siblings.

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