Skip to main content
Glama

measure_text

Calculate text render dimensions in a widget font to prevent clipping by verifying it fits within a max width.

Instructions

Measure how wide/tall text renders in a widget font, so a box fits its content (prevents clipping). "items" is a list of {text, font?, size?, weight?, max_width?}. Returns {items:[{text,width,height,fits}]} where "fits" is whether the text is within max_width. Font names come from list_widgets().appearance.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
itemsYes
Behavior4/5

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

With no annotations, the description carries the full burden and does well: it explains the return payload structure, the meaning of 'fits', and the dependency on widget font names from list_widgets. It implicitly indicates read-only behavior through 'Measure', but does not explicitly rule out side effects or describe error handling.

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 exactly two sentences, front-loaded with the primary action and purpose, and packs input shape, output shape, and a prerequisite into a compact, well-organized format. No filler or redundant phrasing.

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 simple parameter setup and lack of output schema, the description covers purpose, input structure, output structure, and a key dependency. It omits edge cases like missing fonts or invalid max_width, but remains complete relative to the tool's complexity.

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 is minimal (array of objects with additionalProperties true), so the description compensates by fully specifying the items structure: {text, font?, size?, weight?, max_width?}. It also clarifies the output and the meaning of 'fits', which is more than the schema provides. Minor ambiguity remains about exact units or value formats.

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 measures rendered text dimensions to fit a box, with a specific verb ('Measure') and resource ('text in a widget font'). It distinguishes itself from sibling tools by focusing on measurement rather than rendering or modification.

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 usage for sizing containers to avoid clipping and mentions the dependency on list_widgets for font names, providing clear context. However, it does not explicitly call out alternatives or when not to use the tool, so it stops short of full exclusionary guidance.

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

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/dmellok/tesserae-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server