Skip to main content
Glama

Aspect Ratio Calculator API - simplify ratios, lock-ratio resize, crop/letterbox math & batch

aspect_ratio_calculator
Read-onlyIdempotent

Calculate simplified aspect ratios (GCD), decimal ratios, megapixels, orientation, and nearest standard format (16:9, 9:16, 4:3, 21:9, 4:5, 1:1). Compute locked-ratio resize dimensions or exact crop (cover) and letterbox/pillarbox (contain) pixel math for any target frame or preset. Single or batch up to 500 items. 0 AI, pure stdlib deterministic, < 5 ms, nothing stored. Free: 5 calls/day per IP. Paid: Radar API key (from €15/mo at https://radarbg.com/pricing#starter via X-API-Key) or $0.001/call via x402 at https://radarbg.com/x402/aspect-ratio-calculator.

Example tool call

This call uses example arguments supplied in the tool’s input schema.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "width": 1920,
      "height": 1080,
      "targetWidth": 1280
    },
    "name": "aspect_ratio_calculator"
  }
}

Input Schema

NameRequiredDescriptionDefault
widthNoSource width in pixels (or any unit)
heightNoSource height in pixels (or any unit)
presetNoOptional target screen preset for crop/letterbox mathnone
dimensionsNoOptional batch list of 'WxH' strings like ['1920x1080', '1080x1350']
targetWidthNoOptional target width (leave targetHeight empty to lock ratio)
targetHeightNoOptional target height (leave targetWidth empty to lock ratio)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.1/5.0
Behavior5/5

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

Beyond the readOnly/idempotent annotations it discloses concrete operational traits: no AI, deterministic stdlib computation, sub-5ms latency, nothing stored, a 5 calls/day free tier per IP, and the two paid paths (Radar API key via X-API-Key header, or $0.001/call via x402). Those auth and rate-limit details are exactly what an agent needs before calling and are not present in the annotations.

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

Conciseness4/5

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

Capability is front-loaded in two dense sentences that each carry real information, followed by behavioral and pricing facts. The pricing sentence is long and includes two full URLs, which is slightly heavy for a description but is operationally relevant to whether a call will succeed.

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?

With no output schema, the description does the work of enumerating returnable values (simplified ratio, decimal, megapixels, orientation, nearest standard format, resize dimensions, crop/letterbox pixels). It stops short of describing the response object's shape or field names, but for a deterministic calculator that is a minor gap.

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%, so the schema already documents width/height units, the preset enum, the 500-item batch array, and the leave-one-empty lock-ratio rule. The description reinforces the cover (crop) versus contain (letterbox/pillarbox) semantics of the preset path, but adds little syntax or format detail beyond what the schema states, so the baseline 3 applies.

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?

Names a specific verb and a precise set of computed outputs: simplified ratio via GCD, decimal ratio, megapixels, orientation, nearest standard format, locked-ratio resize dimensions, and cover/contain pixel math. It also distinguishes itself from the image-manipulation siblings by stating it is pure calculation ('0 AI, pure stdlib deterministic'), so an agent knows this returns numbers rather than a processed image.

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 establishes scope (math only, single or batch up to 500) and cost/auth context, which implicitly tells an agent to pick this when only numbers are needed. However, it never explicitly says when to use this instead of image_resize, image_crop, or pdf_crop, nor does it state exclusions such as 'does not modify or return image files'.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources