Skip to main content
Glama
Symbolic Algebra MCP Server

Symbolic Algebra MCP Server

simplify_expression

Simplifies a mathematical expression by applying SymPy's simplify function to a previously introduced expression key, returning a new key for the reduced result.

Instructions

Simplifies a mathematical expression using SymPy's simplify function.

Args:
    expr_key: The key of the expression (previously introduced) to simplify.

Example:
    # Introduce variables
    intro("x", [Assumption.REAL], [])
    intro("y", [Assumption.REAL], [])

    # Create an expression to simplify: sin(x)^2 + cos(x)^2
    expr_key = introduce_expression("sin(x)**2 + cos(x)**2")

    # Simplify the expression
    simplified = simplify_expression(expr_key)
    # Returns 1

Returns:
    A key for the simplified expression.

Input Schema

NameRequiredDescriptionDefault
expr_keyYes

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.8/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does reasonably well: it discloses the underlying algorithm (SymPy simplify), the precondition that the expression must already exist, and that the result is a new key rather than a mutation. It omits failure modes (e.g. invalid or stale expr_key) and whether the original expression remains queryable.

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?

Purpose is front-loaded in the first sentence, with args, a concrete example and returns following in a predictable structure. The example is longer than strictly necessary but earns its place by showing the key-based data flow that the schema does not convey.

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?

An output schema exists, so return-value documentation is a bonus rather than a requirement, and the description still states a key is returned plus a concrete example (sin^2+cos^2 returns 1). The only real gap for a single-parameter, pure-computation tool is the absence of any error or edge-case note.

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 coverage is 0%, so the description must compensate, and it does: expr_key is explained as the key of a previously introduced expression, which is meaningfully more than the bare 'Expr Key' schema title. The worked example further illustrates the value format produced by introduce_expression.

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 opening sentence gives a specific verb and resource ('Simplifies a mathematical expression') and names the underlying engine (SymPy's simplify). It does not differentiate itself from close siblings such as factor_expression, expand_expression, cancel_expression or apart_expression, so an agent must infer the distinction from names alone.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Usage is implied by the worked example, which shows introducing variables, creating an expression, then simplifying it. However, there is no explicit when-to-use/when-not-to-use guidance relative to the many other expression-rewriting siblings, and no statement of prerequisites beyond 'previously introduced'.

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