Skip to main content
Glama
Symbolic Algebra MCP Server

Symbolic Algebra MCP Server

integrate_expression

Computes indefinite or definite integrals of a stored expression with respect to a variable and returns a key for the integrated result.

Instructions

Integrates an expression with respect to a variable using SymPy's integrate function.

Args:
    expr_key: The key of the expression (previously introduced) to integrate.
    var_name: The name of the variable to integrate with respect to.
    lower_bound: Optional lower bound for definite integration.
    upper_bound: Optional upper bound for definite integration.

Example:
    # Introduce a variable
    intro("x", [Assumption.REAL], [])

    # Create an expression to integrate: x^2
    expr_key = introduce_expression("x**2")

    # Indefinite integration
    indefinite_result = integrate_expression(expr_key, "x")
    # Returns x³/3

    # Definite integration from 0 to 1
    definite_result = integrate_expression(expr_key, "x", "0", "1")
    # Returns 1/3

Returns:
    A key for the integrated expression.

Input Schema

NameRequiredDescriptionDefault
expr_keyYes
var_nameYes
lower_boundNo
upper_boundNo

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.1/5.0
Behavior3/5

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

No annotations are provided, so the description carries the full behavioral burden. It does disclose the return form ('A key for the integrated expression') and demonstrates concrete outputs, but it never states that a new expression key is registered into state, nor what happens on an invalid or unknown expr_key, nor how symbolic vs numeric bounds behave.

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 sentence one, followed by a structured Args/Example/Returns layout. The example is somewhat long but each line demonstrates a distinct call pattern (indefinite vs definite), so it largely earns its space.

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 values need not be spelled out, yet the description still gives the agent the key semantic. Combined with full argument documentation and a runnable example, the definition is nearly complete; only error behavior and state side effects are absent.

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 description coverage is 0%, so the description must document all four parameters, and the Args block does so including that bounds are optional and gate definite integration. The example clarifies that bounds are passed as strings ('0', '1'), but it does not say whether symbolic or unbounded-free-form bounds are accepted.

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 first sentence states a specific verb and resource ('Integrates an expression with respect to a variable') and names the underlying engine (SymPy's integrate). It is clearly distinguishable from the differentiation, simplification and limit siblings without any schema inspection.

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?

The worked example makes the selection rule explicit: omit bounds for indefinite integration, supply both for definite integration over 0 to 1. It does not name alternatives such as differentiate_expression or explain when-not to use this tool, so it falls short of a 5.

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