Skip to main content
Glama
Symbolic Algebra MCP Server

Symbolic Algebra MCP Server

introduce_expression

Parses a SymPy expression string using available variables and stores it under a temporary or specified name for later symbolic computation.

Instructions

Parses a sympy expression string using available local variables and stores it. Assigns it to either a temporary name (expr_0, expr_1, etc.) or a user-specified global name.

Uses Sympy parse_expr to parse the expression string.

Applies default Sympy canonicalization rules unless canonicalize is False.

For equations (x^2 = 1) make the input string "Eq(x^2, 1") not "x^2 == 1"

Examples:

    {expr_str: "Eq(x^2 + y^2, 1)"}
    {expr_str: "Matrix(((25, 15, -5), (15, 18, 0), (-5, 0, 11)))"}
    {expr_str: "pi+e", "expr_var_name": "z"}

Input Schema

NameRequiredDescriptionDefault
expr_strYes
canonicalizeNo
expr_var_nameNo

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.8/5.0
Behavior4/5

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

With no annotations, the description carries the burden well: it discloses the parsing engine (parse_expr), default canonicalization behavior and how to disable it, and the naming convention (temporary expr_N vs. a global name). It omits failure behavior for undefined variables and what happens on a name collision, which keeps it short of a 5.

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?

Front-loaded with the core action, then the equation-syntax caveat, then examples — good ordering. The sentence 'Uses Sympy parse_expr to parse the expression string' largely restates the first sentence, and the equation example has a mismatched quote, so it is not airtight.

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 explained, and the description covers the pieces an agent actually needs: input syntax, equation form, naming, and canonicalization. The main remaining gap is the absence of any routing guidance against the many sibling expression tools.

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, and it largely does: expr_str is explained with equation syntax guidance plus three concrete examples, canonicalize is described as a default-on behavior, and expr_var_name is described as an optional global name overriding temp naming. What 'canonicalize' actually does to the expression remains vague.

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?

States a specific verb+resource: parses a sympy expression string from local variables and stores it under a generated (expr_0) or user-supplied name. That is clear enough to separate it from computational siblings like simplify_expression or introduce_function, though it never explicitly names those alternatives.

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?

Usage is only implied — an agent can infer this is the entry point for bringing an expression into the session before applying simplify/integrate/differentiate. There is no explicit statement of when to prefer this over introduce_function, nor any prerequisites or exclusions.

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