Skip to main content
Glama
sdiehl
by sdiehl

integrate_expression

Perform symbolic integration of an expression with respect to a specified variable. Supports both indefinite and definite integration using SymPy's functionality via the Symbolic Algebra MCP Server.

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

TableJSON Schema
NameRequiredDescriptionDefault
expr_keyYes
lower_boundNo
upper_boundNo
var_nameYes
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 burden. It discloses that the tool uses SymPy's integrate function and returns a key for the integrated expression, which adds behavioral context. However, it lacks details on error handling, performance, or side effects (e.g., whether it modifies state). The example helps but does not fully compensate for the absence of annotations.

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 description is appropriately sized and front-loaded, starting with a clear purpose statement, followed by parameter explanations, an example, and return information. Every sentence earns its place by adding value, with no redundant or wasted text, making it efficient and well-structured.

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?

Given the complexity (mathematical integration tool with 4 parameters, no annotations, and no output schema), the description is fairly complete. It explains the purpose, parameters, provides an example, and states the return value. However, it could improve by detailing error cases or integration constraints, but the example and parameter explanations cover most essential aspects.

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 compensate. It adds meaning by explaining each parameter: expr_key is 'the key of the expression (previously introduced) to integrate,' var_name is 'the name of the variable to integrate with respect to,' and lower_bound/upper_bound are for 'definite integration.' This clarifies semantics beyond the schema's basic types, though it could provide more detail on format (e.g., string representations).

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 description clearly states the tool 'integrates an expression with respect to a variable using SymPy's integrate function,' which is a specific verb+resource combination. It distinguishes itself from sibling tools like differentiate_expression (which performs differentiation) and other mathematical operations in the sibling list, making its purpose unambiguous.

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 description provides clear context for usage through the example, showing how to use it for indefinite and definite integration. However, it does not explicitly state when to use this tool versus alternatives (e.g., differentiate_expression for derivatives), nor does it mention prerequisites like needing to introduce variables or expressions first, though the example implies this.

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

Related 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/sdiehl/sympy-mcp'

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