Skip to main content
Glama

PrismPoster Creator Tools

Calculate aspect ratio and crop/pad plan

calculate_aspect_ratio
Read-onlyIdempotent

Reduce any pixel size to its simplest aspect ratio (1920x1080 is 16:9) and the nearest even size an H.264 encoder accepts, and, given a target ratio, solve the missing width or height and return the centre-crop and letterbox/pillarbox plans with the px trimmed or added per edge. Use this for arbitrary sizes and ratios (cinema 2.39:1, a client's 4:5); when the target is a named platform placement, use get_social_media_placement with sourceWidth/sourceHeight instead, which picks the right ratio for you. Errors on a non-integer or out-of-range size, or on only one of targetRatioW/targetRatioH.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
widthYesFrame width in px.
heightYesFrame height in px.
targetRatioHNoHeight term of the target ratio, e.g. 16 for 9:16. Requires targetRatioW.
targetRatioWNoWidth term of the ratio to crop or pad to, e.g. 9 for 9:16 or 2.39 for 2.39:1. Requires targetRatioH.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
inputYes
ratioYes
padPlanYes
cropPlanYes
targetRatioYes
formattedRatioYes
evenEncoderSizeYes
referenceToolUrlYes
solvedHeightForWidthYes
solvedWidthForHeightYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.6/5.0
Behavior4/5

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

Annotations already declare readOnly/idempotent/non-destructive, and the description adds real behavioral content: it returns centre-crop and letterbox/pillarbox plans with px trimmed or added per edge, and it errors on non-integer or out-of-range sizes and on only one of targetRatioW/targetRatioH. It stops short of stating rounding/precision behavior for the crop offsets, which keeps it from a 5.

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?

Front-loaded with the primary computation, then the alternative route, then error cases — a sensible ordering with no filler. The opening sentence is long and packs three distinct outputs into one clause, which slightly hurts scanability.

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

Completeness5/5

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

An output schema exists, so return values needn't be spelled out, yet the description still characterizes what the plans contain (px per edge). Combined with sibling routing and explicit error conditions, nothing an agent needs to invoke it correctly is missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the baseline is 3, but the description adds meaning beyond the schema: it explains the pairing constraint (targetRatioW/targetRatioH must both be supplied) as an error condition and illustrates ratio terms with 2.39:1 and 4:5. The width/height bounds themselves are left to the schema.

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?

States specific verbs and resources: reducing a pixel size to a simplest aspect ratio plus nearest even H.264-legal size, and solving the missing dimension for a target ratio with crop/letterbox plans. It even gives a concrete example (1920x1080 is 16:9), so an agent can tell exactly what it produces without opening the schema.

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

Usage Guidelines5/5

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

Explicitly names the boundary case ('arbitrary sizes and ratios (cinema 2.39:1, a client's 4:5)') versus the sibling route ('when the target is a named platform placement, use get_social_media_placement with sourceWidth/sourceHeight'), so the routing decision is fully determined.

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.