Skip to main content
Glama

Moltline Vision Maths

Resize Plan

resize_plan
Read-onlyIdempotent

Work out the exact scale, padding and crop for a model input size. FREE.

Returns the numbers you need to transform boxes alongside the image, which is the step that usually gets skipped. Typical input {"width": 1920, "height": 1080, "target": "yolo_640"} returns {"scale": 0.3333, "resized": [640, 360], "pad": {"left": 0, "top": 140, "right": 0, "bottom": 140}, "box_transform": "x_new = x * 0.3333 + 0; y_new = y * 0.3333 + 140"}.

Use before feeding an image to a fixed-input model. Not for finding out the image's size in the first place - that is image_probe. Errors: on invalid, missing, or malformed input this tool never raises a protocol error — it returns {"error": ""} (for example {"error": "unknown target ; use one of or set"}). Every call is read-only and idempotent, so after correcting the input it is always safe to retry.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
modeNo"letterbox" scales to fit and pads the remainder, preserving aspect; "cover" scales to fill and crops the overflow; "stretch" distorts to fit exactly. Default "letterbox".letterbox
widthYesSource image width in pixels.
heightYesSource image height in pixels.
targetNoA named preset: "clip_224", "vit_384", "yolo_640", "sam_1024", "sd_512", "sd_768" or "detr_800". Ignored when target_size is set.yolo_640
target_sizeNoA square side length in pixels, overriding target. Use this for a size the presets do not cover.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

TDQS

A4.9/5.0
Behavior5/5

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

Annotations already declare readOnlyHint=true and idempotentHint=true, but the description adds significant behavioral context: it explicitly states the tool never raises protocol errors on invalid input, instead returning a structured error object with guidance. It also confirms read-only and idempotent behavior, which reinforces safety for retries. There's no contradiction with annotations; in fact, the description amplifies the annotation hints with concrete error-handling 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 well-structured and front-loaded: it opens with the core purpose, gives a concrete example with a typical input/output, provides direct usage guidance, and closes with error-handling details. Every sentence adds value; there is no fluff or repetition. It is substantial but each part is necessary for correct tool invocation.

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?

Given the tool's moderate complexity (5 params, multiple presets, modes) and the presence of a rich output schema and annotations, the description covers everything needed: purpose, example, usage, error behavior, and safety. The error-handling details are particularly valuable for an agent to interpret unexpected responses. The description is complete enough that the agent can use the tool correctly without additional probing.

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?

The input schema already has 100% coverage with rich descriptions for all parameters, including acceptable values and defaults. The description adds value by showing the expected output shape and the box-transform formula, which clarifies how parameters flow into results. However, it doesn't elaborate on each parameter beyond the schema, but since the schema is already thorough, this is sufficient. A 4 is appropriate because the description's example adds meaning beyond the schema without over-explaining.

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 computes scale, padding, and crop for model input sizing, with a concrete example. It explicitly distinguishes itself from image_probe, and its purpose is unambiguous relative to sibling tools like bbox_convert or nms.

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?

The description gives explicit usage guidance: 'Use before feeding an image to a fixed-input model' and even names the alternative for a different need ('Not for finding out the image's size in the first place - that is image_probe'). This tells the agent exactly when to invoke it and when not to, satisfying the when/when-not criteria.

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.

TDQS

A4.6/5.0
Disambiguation5/5

Each of the six tools addresses a clearly distinct operation: bbox_convert handles format transforms, nms removes duplicate detections, detection_metrics evaluates predictions, image_probe reads headers, resize_plan computes resize parameters, and colour_check checks WCAG contrast. There is no overlap or ambiguity between them.

Naming Consistency3/5

Most tools follow a noun_verb pattern (bbox_convert, colour_check, image_probe, resize_plan) but two are outliers: detection_metrics is noun_noun and nms is an acronym. Naming is readable but not fully consistent across the set.

Tool Count5/5

Six tools is a well-scoped count for a vision/maths utilities server. Each tool covers a distinct, necessary facet of computer vision workflows (conversion, suppression, metrics, probing, planning, contrast), with no apparent bloat or trivial tools.

Completeness4/5

The tool surface covers the core calculation needs for bounding-box-based vision tasks: conversion, NMS, evaluation, image metadata, resize planning, and accessibility contrast. Missing features like actual image manipulation or geometric transforms are outside the stated 'maths' scope, so coverage is strong. One could argue for a tool that applies resize to boxes, but resize_plan already returns the transform parameters, which is sufficient.

Resources