Skip to main content
Glama

sympy_expand_complex

Expand a symbolic expression into its complex expanded form, distributing products and sums for simplification.

Instructions

Expand complex.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
exprYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The tool handler function for 'sympy_expand_complex'. It takes a string expression, converts it to a SymPy object via _sympify, applies expand_complex, and returns the result as a string.
    def sympy_expand_complex(expr: str) -> str:
        """Expand complex."""
        return str(expand_complex(_sympify(expr)))
  • The function signature defines the schema: takes a single string parameter 'expr' and returns a string. The @mcp.tool() decorator registers it as an MCP tool.
    def sympy_expand_complex(expr: str) -> str:
  • The tool is registered as an MCP tool via the @mcp.tool() decorator on line 2438. 'mcp' is a FastMCP instance defined on line 119.
    def sympy_expand_complex(expr: str) -> str:
  • The _sympify helper converts a string expression to a SymPy object (sympy.Basic), used by the tool handler.
    def _sympify(expr: str) -> sympy.Basic:
        """Convert string expression to SymPy object."""
        return sympy.sympify(expr)
  • The expand_complex function is imported from sympy on line 66, which is the core operation used in the tool handler.
    expand_complex,
    expand_log,
Behavior2/5

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

With no annotations, the description must disclose behavior. 'Expand complex.' gives no details about what happens to the expression (e.g., expands into real and imaginary parts), whether it's destructive, or any side effects.

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 very short but severely underspecified. It lacks any useful information, making it uninformative rather than concise.

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?

Despite having an output schema, the description does not explain what the tool returns. With one parameter and no annotations, the description is completely inadequate for an agent to understand or correctly invoke the tool.

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

Parameters2/5

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

The input schema has one parameter 'expr' with no description (0% coverage). The tool description adds no meaning about what expr should be (e.g., a string representing a complex expression in SymPy format).

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

Purpose2/5

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

The description 'Expand complex.' is vague; it restates the tool name without specifying what kind of expansion or what 'complex' refers to. Sibling tools like sympy_expand, sympy_expand_log, sympy_expand_trig offer more specific expansions, but this description doesn't differentiate.

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 usage guidance is provided. The description does not indicate when to use this tool versus alternatives like sympy_expand or sympy_as_real_imag.

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