Skip to main content
Glama
Jake-loranger

Algorand MCP Server

calculate

Evaluate mathematical expressions to perform calculations within the Algorand blockchain environment.

Instructions

Perform basic mathematical calculations

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
expressionYesMathematical expression to evaluate (e.g., "2 + 2", "10 * 5")

Implementation Reference

  • The handler logic for the 'calculate' tool. Parses input arguments using Zod schema, evaluates the mathematical expression with eval(), and returns the result or an error response.
    case 'calculate': {
        const parsed = CalculateArgsSchema.parse(args);
        try {
            // Simple math evaluation (in production, use a safer math library)
            const result = eval(parsed.expression);
            return {
                content: [
                    {
                        type: 'text',
                        text: `Result: ${parsed.expression} = ${result}`,
                    },
                ],
            };
        } catch (error) {
            return {
                content: [
                    {
                        type: 'text',
                        text: `Error: Invalid mathematical expression - ${error}`,
                    },
                ],
                isError: true,
            };
        }
    }
  • Zod schema used for input validation in the calculate tool handler, defining the 'expression' parameter.
    const CalculateArgsSchema = z.object({
        expression: z.string(),
    });
  • src/index.ts:114-127 (registration)
    Tool registration in the TOOLS array, defining name, description, and input schema for MCP protocol compliance.
    {
        name: 'calculate',
        description: 'Perform basic mathematical calculations',
        inputSchema: {
            type: 'object',
            properties: {
                expression: {
                    type: 'string',
                    description: 'Mathematical expression to evaluate (e.g., "2 + 2", "10 * 5")',
                },
            },
            required: ['expression'],
        },
    },
  • Input schema defined in the tool registration for MCP tool listing and validation.
        inputSchema: {
            type: 'object',
            properties: {
                expression: {
                    type: 'string',
                    description: 'Mathematical expression to evaluate (e.g., "2 + 2", "10 * 5")',
                },
            },
            required: ['expression'],
        },
    },
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the tool performs calculations but lacks details on error handling (e.g., invalid expressions), computational limits, or output format. This is a significant gap for a tool that could involve complex inputs, making it inadequate for safe and effective use.

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

Conciseness5/5

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

The description is extremely concise with a single sentence ('Perform basic mathematical calculations') that directly states the tool's function without unnecessary words. It is front-loaded and efficient, making it easy for an agent to parse quickly.

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 tool's complexity (mathematical calculations with potential for errors) and lack of annotations and output schema, the description is incomplete. It doesn't cover behavioral aspects like error messages, supported operations, or result formatting, which are crucial for an agent to use the tool correctly in varied contexts.

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?

The schema description coverage is 100%, with the parameter 'expression' well-documented in the schema as a mathematical expression. The description adds no additional parameter semantics beyond what the schema provides, such as examples or constraints, so it meets the baseline for high schema coverage without extra value.

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 the tool's purpose as 'Perform basic mathematical calculations,' which specifies the verb ('perform') and resource ('calculations'). It distinguishes from siblings like 'create_asset' or 'send_payment' by focusing on math operations, though it could be more specific about what 'basic' entails (e.g., arithmetic vs. advanced functions).

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?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention any prerequisites, limitations, or context for choosing it over other tools (e.g., for simple math vs. complex operations handled elsewhere). This leaves the agent without explicit usage instructions.

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/Jake-loranger/algorand-mcp-server'

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