Skip to main content
Glama
sdiehl
by sdiehl

introduce_expression

Parse and store symbolic expressions with SymPy, assigning them to temporary or user-defined variables. Supports equations and matrices while applying canonicalization rules by default.

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

TableJSON Schema
NameRequiredDescriptionDefault
canonicalizeNo
expr_strYes
expr_var_nameNo
Behavior4/5

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

With no annotations provided, the description carries full burden and does well by disclosing key behaviors: uses Sympy parse_expr, applies canonicalization rules by default, stores expressions with temporary or user-specified names, and provides critical formatting guidance for equations. It doesn't mention error handling, performance, or state persistence details, but covers essential operational context.

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 appropriately sized and front-loaded with the core purpose in the first sentence. The examples are relevant but slightly lengthy; every sentence earns its place by clarifying behavior or parameters. Minor trimming of example formatting could improve efficiency, but overall it's well-structured and avoids redundancy.

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 (expression parsing/storage), no annotations, no output schema, and 0% schema coverage, the description is quite complete. It covers purpose, usage, parameters, and key behaviors. It doesn't describe the return value (stored expression reference) or error cases, which would be helpful given the lack of output schema, but provides sufficient context for effective use.

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?

With 0% schema description coverage, the description must compensate and does so excellently. It explains all three parameters: 'expr_str' (the expression string to parse, with formatting examples), 'expr_var_name' (optional user-specified name vs. automatic temporary names), and 'canonicalize' (default Sympy canonicalization behavior). The examples directly illustrate parameter usage, adding substantial value beyond the bare schema.

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's purpose: '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.' This specifies the verb (parses and stores), resource (sympy expression string), and distinguishes it from sibling tools like 'simplify_expression' or 'differentiate_expression' by focusing on introduction/storage rather than manipulation.

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 when to use this tool: for parsing and storing sympy expressions, with examples showing equation formatting ('Eq(x^2, 1)' not 'x^2 == 1'). However, it doesn't explicitly state when NOT to use it or name specific alternatives among the many sibling tools (e.g., vs. 'create_matrix' or 'introduce_function'), which prevents a perfect score.

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