Skip to main content
Glama

floor

Round down any number to its nearest integer using this mathematical function, designed for precise calculations.

Instructions

Rounds a number down to the nearest integer

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
numberYesThe number to round down

Implementation Reference

  • src/index.ts:212-227 (registration)
    Registration of the "floor" MCP tool, including JSDoc description, input schema (number: z.number()), and inline handler function that calls Arithmetic.floor and returns the floored value as text content.
    /**
     * Floor operation
     * Rounds a number down to the nearest integer
     */
    mathServer.tool("floor", "Rounds a number down to the nearest integer", {
        number: z.number().describe("The number to round down"),
    }, async ({ number }) => {
        const value = Arithmetic.floor(number)
    
        return {
            content: [{
                type: "text",
                text: `${value}`
            }]
        }
    })
  • Static helper method in Arithmetic class that implements the floor operation by calling JavaScript's Math.floor(number). This is invoked by the floor tool's handler.
    /**
     * Calculate the floor of a number
     * @param number - Number to find the floor of
     * @returns floor of the number
     */
    static floor(number: number) {
        const floor = Math.floor(number)
        return floor
    }
Behavior3/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. It discloses the core behavior (rounding down), but does not add context beyond that, such as handling of negative numbers, edge cases, or performance. It's adequate but lacks rich behavioral details.

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 waste. It is appropriately sized and front-loaded, directly stating the tool's function without unnecessary elaboration. Every word earns its place.

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

Completeness4/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 (one parameter, simple mathematical operation), no annotations, and no output schema, the description is complete enough for basic use. It covers the essential purpose and parameter intent, though it could benefit from more behavioral context or examples.

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 'number' parameter fully. The description adds no additional meaning beyond what the schema provides, such as examples or constraints. Baseline 3 is appropriate when 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 tool's purpose with a specific verb ('Rounds down') and resource ('a number'), and it distinguishes from siblings like 'ceiling' (which rounds up) and 'round' (which rounds to nearest). It precisely defines the mathematical operation without ambiguity.

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

Usage Guidelines4/5

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

The description implies when to use this tool—when you need to round a number down to the nearest integer—but does not explicitly state when not to use it or name alternatives like 'ceiling' or 'round'. It provides clear context for its mathematical function without exclusions.

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

  • @EthanHenrickson/math-mcp
  • @EthanHenrickson/math-mcp
  • @EthanHenrickson/math-mcp
  • @kelseyee/mcp_calculator
  • @nbiish/mcp-calc-tools
  • @avanishd-3/math-mcp

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