Skip to main content
Glama

sympy_im

Extract the imaginary part of a complex symbolic expression using SymPy. Provide the expression as input to compute its imaginary component.

Instructions

Imaginary part.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
exprYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The tool 'sympy_im' is registered via @mcp.tool() decorator and computes the imaginary part of a SymPy expression. The function accepts a string expression, converts it via _sympify(), and returns sympy.im(...) as a string.
    @mcp.tool()
    def sympy_im(expr: str) -> str:
        """Imaginary part."""
        return str(sympy.im(_sympify(expr)))
  • The _sympify() helper converts a string expression into a SymPy object, used by sympy_im to parse input.
    def _sympify(expr: str) -> sympy.Basic:
        """Convert string expression to SymPy object."""
        return sympy.sympify(expr)
  • The FastMCP instance 'mcp' is created here; the @mcp.tool() decorator on sympy_im registers it with this MCP server.
    mcp = fastmcp.FastMCP("mcp-sympy")
Behavior1/5

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

With no annotations, the description carries full burden but provides no behavioral details (e.g., input constraints, side effects, or function purity).

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?

Extremely short but under-specified; lacks a verb. The single noun phrase does not earn its place as a complete description.

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 complexity of SymPy and many sibling tools, the description is inadequate. No info on return values or use cases despite an output schema being present.

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 description adds no meaning to the 'expr' parameter beyond the schema. Parameter coverage is 0%, and the description does not clarify what 'expr' should be.

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 'Imaginary part.' states the tool's basic function but lacks a verb. It is minimally clear but does not actively distinguish from related tools like sympy_re or sympy_as_real_imag.

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 on when to use this tool versus alternatives (e.g., sympy_re, sympy_conjugate). The description does not mention context or prerequisites.

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