Skip to main content
Glama
cshum

Imagor MCP

Official

fit_text

Find the largest font size that keeps a string inside a fixed box, preventing text overflow in imagor templates. Returns a font argument for text().

Instructions

Find the largest font size at which a string still fits a box. imagor wraps text but never shrinks it, so a template that suits a short title silently overflows on a longer one. This renders the text on a transparent canvas at candidate sizes, measures the ink, and searches for the largest size that fits. Pass the returned font argument straight to text(). Requires IMAGOR_BASE_URL.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
fontYesa Pango font with hyphens for spaces, family first and size last, e.g. Open-Sans-bold or Liberation-Serif-24
textYesthe string to fit; it may contain %0A for a hard line break
colorNotext colour; affects nothing measurable, and defaults to black
max_sizeYeslargest size to try, in points
min_sizeNosmallest size to accept; the search stops here and reports that it does not fit
box_widthYeswidth of the area the text has to fit, in pixels
box_heightYesheight of that area; the wrapped text may not exceed it

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
fitsYeswhether a size at or above min_size fits the box
fontYesthe font argument to pass to text(), family and size together
noteNo
sizeYes
linesYeshow many lines the text wrapped to at this size
widthYesmeasured ink width in pixels
heightYesmeasured ink height in pixels
probesYeshow many renders the search needed

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.1/5.0
Behavior4/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 and does well: it discloses the mechanism (renders on a transparent canvas at candidate sizes, measures the ink, searches for the largest fit) and the hard prerequisite IMAGOR_BASE_URL. It does not mention cost, how many candidate sizes get rendered, or failure behavior at min_size beyond what the schema says.

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?

Front-loaded with the outcome, then the motivation, mechanism, integration step, and prerequisite in four tight sentences with no filler. Every sentence earns its place; nothing is repeated from the schema.

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 shape need not be explained, and the description instead covers the parts structured data cannot: why the tool exists, how it works internally, the IMAGOR_BASE_URL prerequisite, and the hand-off to text(). For a 7-parameter tool this is complete enough to invoke correctly.

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 all seven parameters including the min/max search bounds and the Pango font format. The description adds only that the returned font value is what text() expects, which is output-side rather than parameter-side. Baseline 3 is correct.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and outcome: 'Find the largest font size at which a string still fits a box,' plus the rationale that imagor wraps but never shrinks text. It is unmistakably a font-fitting search tool. It never names or contrasts a sibling, but no sibling (build_imagor_url, render_template, etc.) competes for this job, so differentiation is not the gap.

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?

Gives a clear trigger context (a template that suits a short title silently overflows on a longer one) and a downstream instruction: 'Pass the returned font argument straight to text().' It also states the prerequisite (IMAGOR_BASE_URL). It stops short of explicit when-not-to-use or cost/latency caveats for what is clearly an expensive search.

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