Skip to main content
Glama

max

Identify the maximum value from a list of numbers using a simple API for accurate numerical calculations, supported by the Math-MCP server.

Instructions

Finds the maximum value from a list of numbers

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
numbersYesArray of numbers to find the maximum of

Implementation Reference

  • The static `max` method in Statistics class that executes the core tool logic: finds the maximum value in the input array using `Math.max(...numbers)`.
    static max(numbers: number[]) {
        const maxValue = Math.max(...numbers);
    
        return maxValue
    }
  • src/index.ts:199-210 (registration)
    Registers the "max" MCP tool, including input schema validation with Zod and the handler function that calls `Statistics.max` and formats the response.
    mathServer.tool("max", "Finds the maximum value from a list of numbers", {
        numbers: z.array(z.number()).describe("Array of numbers to find the maximum of")
    }, async ({ numbers }) => {
        const value = Statistics.max(numbers)
    
        return {
            content: [{
                type: "text",
                text: `${value}`
            }]
        }
    })
  • Zod schema definition for the "max" tool input: an array of numbers.
    numbers: z.array(z.number()).describe("Array of numbers to find the maximum of")
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states what the tool does but lacks details on error handling (e.g., for non-numeric inputs or empty arrays), return format, or computational characteristics (e.g., time complexity). This is a significant gap for a tool with no annotation coverage.

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 a single, efficient sentence that directly states the tool's purpose without unnecessary words. It is front-loaded with the core functionality, making it easy to parse quickly. Every part of the sentence earns its place by conveying essential information.

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

Completeness3/5

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

Given the tool's low complexity (single parameter, simple operation) and high schema coverage, the description is minimally adequate. However, without annotations or an output schema, it lacks details on behavior (e.g., error cases) and return values, which could be important for reliable use by an AI agent.

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 description coverage is 100%, with the parameter 'numbers' clearly documented as an array of numbers. The description adds no additional semantic information beyond what the schema provides, such as examples or constraints (e.g., minimum array length). Baseline 3 is appropriate since the schema does the heavy lifting.

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

Purpose5/5

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

The description clearly states the specific verb ('Finds') and resource ('maximum value from a list of numbers'), making the purpose immediately understandable. It distinguishes this tool from siblings like 'min' (minimum), 'mean' (average), and 'sum' (total), which operate on the same input type but produce different results.

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

Usage Guidelines3/5

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

The description implies usage by specifying it works on 'a list of numbers', but it doesn't explicitly state when to use this tool versus alternatives like 'min' or 'median'. No guidance is provided on prerequisites, edge cases (e.g., empty lists), or performance considerations, leaving usage context partially inferred.

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

Related 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/EthanHenrickson/math-mcp'

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