Skip to main content
Glama

cancel_expression

Cancel common factors in rational expressions to reduce them to lowest terms. Simplifies formulas for analysis, removes singularities, and improves numerical stability.

Instructions

    Cancel common factors in rational expression.

    ═══════════════════════════════════════════════════════════════════════
    🆕 PHASE 1 - NOT IN SYMPY-MCP OR NSFORGE v0.2.3!
    ═══════════════════════════════════════════════════════════════════════

    Reduces rational functions to lowest terms by canceling common factors.

    Use cases:
    - Simplify PK models
    - Remove singularities
    - Numerical stability
    - Standard form

    Args:
        expression: Rational expression to cancel

    Returns:
        Canceled expression with LaTeX

    Examples:
        # Simple cancellation
        cancel_expression("(x**2 - 1)/(x - 1)")
        → {"result": "x + 1", ...}  # Removed (x-1) factor

        # PK clearance
        cancel_expression("(V*CL)/(V)")
        → {"result": "CL", ...}

        # Multiple factors
        cancel_expression("(x**2 - 4)/(x**2 + 4*x + 4)")
        → {"result": "(x - 2)/(x + 2)", ...}

        # Remove common exponentials
        cancel_expression("exp(-k*t)*C0 / exp(-k*t)")
        → {"result": "C0", ...}
    

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
expressionYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

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 explains the operation and gives examples of expected outputs, but it does not disclose edge cases, behavior for non-rational inputs, or error handling. The odd 'PHASE 1' banner adds confusion without clarifying behavior. Overall, it is minimally adequate but lacks depth.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured with Args/Returns/Examples, but it includes a large decorative banner and redundant phrasing ('Cancel common factors in rational expression' followed by 'Reduces rational functions to lowest terms by canceling common factors'). The banner and repetition add noise without contributing value, making it less concise than it could be.

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 that an output schema exists and this is a simple single-parameter tool, the description covers purpose, use cases, parameters, and return format with examples. It is reasonably complete, though the lack of edge-case or error information and the confusing banner prevent a perfect score.

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 so effectively with an 'Args' section specifying 'expression: Rational expression to cancel' and multiple examples demonstrating valid expressions and expected results. This fully clarifies the single parameter's meaning and usage.

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 states a specific verb and resource: 'Cancel common factors in rational expression' and 'Reduces rational functions to lowest terms by canceling common factors.' This clearly distinguishes it from sibling simplification tools like factor_expression or simplify, and the examples reinforce the specific operation.

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 description lists use cases ('Simplify PK models', 'Remove singularities', etc.) which give context, but it does not explicitly say when to use this tool versus alternatives, nor does it mention when not to use it. No exclusions or alternative tool names are provided, so guidance is only implied rather than explicit.

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