Skip to main content
Glama

refine_expression

Simplify mathematical expressions using variable assumptions, reducing sqrt(x^2) to x and Abs(x) to x under positivity constraints.

Instructions

    Simplify expression using assumptions.

    ═══════════════════════════════════════════════════════════════════════
    🆕 NOT AVAILABLE IN SYMPY-MCP!
    ═══════════════════════════════════════════════════════════════════════

    SymPy can simplify expressions differently when it knows
    properties of the variables. For example:
    - sqrt(x**2) → x when x is positive
    - Abs(x) → x when x is positive

    Args:
        expression: Expression to refine
        assumptions: Assumptions about symbols

    Returns:
        Refined expression

    Examples:
        # sqrt(x**2) simplifies to x when x is positive
        refine_expression("sqrt(x**2)", {"x": ["positive"]})
        → {"result": "x", ...}

        # Abs simplifies under assumptions
        refine_expression("Abs(a*b)", {"a": ["positive"], "b": ["positive"]})
        → {"result": "a*b", ...}
    

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
expressionYes
assumptionsYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior4/5

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

With no annotations, the description carries the full burden. It explains that refinement depends on variable properties via examples and even discloses non-availability in certain contexts. However, it does not describe failure modes, edge cases, or behavior when assumptions are insufficient.

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?

The description is organized with a short summary, args, returns, and examples. The large 'NOT AVAILABLE' warning box is prominent but contributes little to the operational understanding and adds noise. Otherwise, it is concise and easy to scan.

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?

For a two-parameter tool with an output schema, the description offers examples and return expectations. It lacks details on handling empty assumptions or conflicts, but these are minor gaps given the simplicity of the tool. The output schema already covers return structure, so the description needn't elaborate.

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?

The schema provides only types and no descriptions, so the examples are crucial. They clearly illustrate that `expression` is a string and `assumptions` is a dict mapping symbols to lists of properties (e.g., 'positive'). This adds significant meaning beyond the schema, though it doesn't enumerate all possible assumption values.

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 description clearly states that the tool simplifies expressions using assumptions, with specific examples like sqrt(x**2) → x. It differentiates from generic simplification tools by highlighting the assumptions parameter, but does not explicitly name alternative tools or mention when to prefer this over other simplification functions.

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?

The use case is implied: apply assumptions to simplify expression. Examples show the input format, but there is no explicit guidance on when to choose this tool over siblings like derivation_simplify, or when assumptions are not needed. The 'NOT AVAILABLE IN SYMPY-MCP' warning is more of a limitation note than a usage guideline.

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

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/u9401066/nsforge-mcp'

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