Skip to main content
Glama
Symbolic Algebra MCP Server

Symbolic Algebra MCP Server

apart_expression

Decomposes a rational expression into partial fractions, optionally specifying the variable, and returns a key to the decomposed result.

Instructions

Computes the partial fraction decomposition of a rational expression using SymPy's apart.

Args:
    expr_key: The key of the expression (previously introduced) to decompose.
    var_name: The variable (previously introduced) to decompose with respect to.
        Required when the expression has several variables.

Example:
    intro("x", [Assumption.REAL], [])
    expr_key = introduce_expression("1/(x**2 - 1)")
    result_key = apart_expression(expr_key, "x")
    # -1/(2(x + 1)) + 1/(2(x - 1))

Returns:
    A key for the decomposed expression.

Input Schema

NameRequiredDescriptionDefault
expr_keyYes
var_nameNo

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.5/5.0
Behavior4/5

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

Without annotations, the description carries the burden and does well: it names the underlying operation, explains that expr_key and var_name refer to previously introduced objects, and states that a key for the decomposed expression is returned. It omits failure modes or error conditions, but for a pure symbolic computation that is a minor gap.

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?

The purpose is front-loaded, followed by compact argument notes, a useful example, and a return note. Every section contributes directly to correct invocation.

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?

The description is complete enough to call the tool correctly: inputs, optionality context, example, and return key are all covered. Since an output schema exists, it need not detail return structure, and the remaining gap around error behavior is minor.

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

Parameters5/5

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

Schema description coverage is 0%, so the description must compensate. It does: expr_key is defined as the key of a previously introduced expression, and var_name is defined as the variable to decompose with respect to, including when it is required.

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?

States a specific verb and mathematical resource: computes partial fraction decomposition of a rational expression using SymPy's apart. This is clearly distinguishable from sibling operations such as factor_expression, expand_expression, or cancel_expression.

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?

Provides a concrete usage example and clarifies that var_name is required when the expression has several variables. It does not explicitly compare against alternatives, but the operation's purpose makes appropriate use clear.

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