Skip to main content
Glama

sympy_match

Matches a symbolic expression against a pattern to determine structural equivalence.

Instructions

Match expression to pattern.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
exprYes
patternYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The handler function that executes the sympy_match tool logic. It takes an expression string and a pattern string, converts both to SymPy objects via _sympify(), and returns the result of calling .match() on the expression against the pattern.
    def sympy_match(expr: str, pattern: str) -> str:
        """Match expression to pattern."""
        return str(_sympify(expr).match(_sympify(pattern)))
  • The @mcp.tool() decorator registers sympy_match as an MCP tool on the FastMCP server instance.
    @mcp.tool()
  • The _sympify helper function converts string expressions to SymPy objects, used by the sympy_match handler.
    def _sympify(expr: str) -> sympy.Basic:
        """Convert string expression to SymPy object."""
        return sympy.sympify(expr)
  • The function signature defines the schema: expr (str) and pattern (str) parameters, with a str return type.
    def sympy_match(expr: str, pattern: str) -> str:
Behavior2/5

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

No annotations exist, and the description does not explain the tool's behavior beyond the minimal intention. It fails to mention what the tool returns (e.g., match object, boolean), whether it modifies state, or other behavioral traits. The description carries the full burden but provides almost nothing.

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

Conciseness2/5

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

The description is extremely short (three words), which is concise but severely under-specified. It does not earn its place by adding useful information beyond the tool name.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness1/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the lack of annotations, zero parameter documentation, and a large set of sibling tools, the description is entirely insufficient. It provides no context about output, usage, or behavior, making it nearly unusable for an agent.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters1/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 0% description coverage, and the description does not clarify what 'expr' and 'pattern' should represent (e.g., sympy expressions as strings). This leaves the agent with no meaning beyond the parameter names.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states a verb ('match') and resources ('expression', 'pattern') but does not distinguish this tool from similar siblings like sympy_subs, sympy_replace, or sympy_xreplace. Without differentiation, the purpose is clear but not uniquely identifiable.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus alternatives. Given the numerous sibling tools for expression manipulation, the absence of usage context is a significant gap.

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

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