Skip to main content
Glama

sympy_log_base

Compute the logarithm of a symbolic expression with a specified base.

Instructions

Logarithm with specified base.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
exprYesExpression
baseYesLogarithm base

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The tool handler function that implements sympy_log_base. It takes string expressions for the value and base, sympifies them, and returns the log via SymPy's log() function with a specified base.
    @mcp.tool()
    def sympy_log_base(expr: str, base: str) -> str:
        """Logarithm with specified base.
    
        Args:
            expr: Expression
            base: Logarithm base
    
        Returns:
            log_base(expr) as string
    
        Example:
            >>> sympy_log_base("100", "10")
            "2"
        """
        return str(log(_sympify(expr), _sympify(base)))
  • The @mcp.tool() decorator registers sympy_log_base as an MCP tool on the FastMCP instance.
    @mcp.tool()
  • The _sympify helper converts string expressions into SymPy objects, used by sympy_log_base to parse the expr and base arguments.
    def _sympify(expr: str) -> sympy.Basic:
        """Convert string expression to SymPy object."""
        return sympy.sympify(expr)
  • The function signature and docstring serve as the schema: it accepts two string parameters (expr and base) and returns a string. FastMCP infers the input schema from type hints.
    def sympy_log_base(expr: str, base: str) -> str:
        """Logarithm with specified base.
    
        Args:
            expr: Expression
            base: Logarithm base
    
        Returns:
            log_base(expr) as string
    
        Example:
            >>> sympy_log_base("100", "10")
            "2"
        """
Behavior2/5

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

With no annotations, the description carries the full burden of behavioral disclosure. It only states 'Logarithm with specified base.' without explaining that it performs symbolic computation, what the return type is, or handling of edge cases (e.g., base 0, negative bases). This is insufficient for safe invocation.

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

Conciseness3/5

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

The description is very short (one sentence), but it lacks informative content. It is not structured to front-load the most critical information. While brevity is appreciated, it sacrifices clarity and completeness. An effective concise description would pack more context.

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

Completeness2/5

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

Given the complexity of the tool (logarithm with base) and the presence of an output schema, the description should still explain the nature of the computation (symbolic/numeric) and any side effects. The description is too sparse and misses essential details for an agent to use it correctly without falling back to trial and error.

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

Parameters3/5

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

Schema coverage is 100% with descriptions for both parameters. However, the tool description adds no additional meaning beyond what is in the schema. It does not clarify accepted formats (e.g., symbolic expressions, numbers) or any constraints. Baseline 3 is appropriate as the schema does the work.

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?

The description clearly states it is a logarithm with a specified base, which is a specific verb-resource pair. It differentiates from siblings like sympy_log (likely natural log) and sympy_expand_log (expansion). However, it could be more explicit about the exact operation (e.g., compute, simplify).

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 like sympy_log or sympy_expand_log. The description lacks context on when a specified base is appropriate or if there are prerequisites. The agent must infer from the tool name alone.

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