Skip to main content
Glama

round

Round a number to the nearest integer using a simple API tool for precise numerical calculations. Ideal for quick and accurate integer conversion.

Instructions

Rounds a number to the nearest integer

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
numberYesThe number to round

Implementation Reference

  • The handler function that executes the 'round' tool logic by calling Arithmetic.round on the input number and returning the result as MCP text content.
    }, async ({ number }) => {
        const value = Arithmetic.round(number)
        return {
            content: [{
                type: "text",
                text: `${value}`
            }]
        }
    })
  • The Zod input schema defining a single 'number' parameter for the 'round' tool.
    number: z.number().describe("The number to round"),
  • src/index.ts:246-260 (registration)
    The registration of the 'round' tool on the MCP server, including JSDoc, name, description, schema, and handler.
    /**
     * Round operation
     * Rounds a number to the nearest integer
     */
    mathServer.tool("round", "Rounds a number to the nearest integer", {
        number: z.number().describe("The number to round"),
    }, async ({ number }) => {
        const value = Arithmetic.round(number)
        return {
            content: [{
                type: "text",
                text: `${value}`
            }]
        }
    })
  • The helper static method 'Arithmetic.round' that performs the core rounding logic using Math.round.
    /**
     * Calculate the round of a number
     * @param number - Number to find the round of
     * @returns round of the number
     */
    static round(number: number) {
        const round = Math.round(number)
        return round
    }
Behavior2/5

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

With no annotations provided, the description carries full burden but only states the basic function. It doesn't disclose important behavioral traits like how it handles edge cases (e.g., .5 values, negative numbers), precision limitations, or error conditions.

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 with zero wasted words. It's appropriately sized for this simple mathematical operation and gets straight to the point without unnecessary elaboration.

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?

For a mathematical operation with no annotations and no output schema, the description is too minimal. It doesn't explain the return value format, rounding rules for edge cases, or how this differs from similar sibling tools, leaving significant gaps in understanding.

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%, so the schema already documents the single parameter. The description adds no additional parameter semantics beyond what's in the schema, maintaining the baseline score for high schema coverage.

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 action ('Rounds') and resource ('a number') with precise outcome ('to the nearest integer'). It effectively distinguishes from siblings like 'ceiling' or 'floor' which have different rounding behaviors.

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 'ceiling' or 'floor'. The description only states what it does, not when it's appropriate or how it differs from similar mathematical operations.

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