Skip to main content
Glama

Measure and leading

measure_leading
Read-only

Check line length and suggest leading. Pass fontSizePx and containerPx (the text column width in px). Optional: charsPerLine (use a counted value instead of the estimate), language (en, de, fr, es, it, pt, nl, ru, ja, zh, ko; sets the average character width), avgCharWidthEm (override, default 0.5). Returns the measure in characters, whether it is inside 45 to 75 (25 to 40 for CJK), a recommended line-height (about 1.4 at the short end rising to 1.6 at the long end, tighter for large type), paragraph spacing, and the container width that hits the range. The 45 to 75 range is Bringhurst's guidance (The Elements of Typographic Style) as cited in Smashing's Typography Best Practices; 1.4 to 1.6 line spacing is from UXPin's Principles of Visual Consistency. The leading curve is a convention. Width is an estimate from an average character, so it is a guide, not a measurement.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "fontSizePx": "<fontSizePx>",
      "containerPx": "<containerPx>"
    },
    "name": "measure_leading"
  }
}

Input Schema

NameRequiredDescriptionDefault
languageNoTwo-letter language code (default en).
fontSizePxYesFont size in px.
containerPxYesWidth of the text column in px.
charsPerLineNoOptional counted characters per line, used instead of the estimate.
avgCharWidthEmNoOptional average character width as a fraction of the font size (default 0.5).

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A3.9/5.0
Behavior4/5

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

Annotations already cover the safety profile (readOnlyHint true, destructiveHint false, openWorldHint false), so the bar is lower, and the description still adds meaningful context: it enumerates what is returned, discloses that the leading curve is a convention, and explicitly warns that width is estimated from an average character and is "a guide, not a measurement." That limitation disclosure is exactly the kind of context annotations cannot carry.

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?

The core instruction (required params, optional overrides) is front-loaded, followed by the return contract and the estimate caveat. The two sentences citing Bringhurst/Smashing and UXPin are borderline filler for an agent deciding how to call the tool, though they justify the thresholds. Slightly long but well ordered.

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?

With no output schema, the description fully specifies the return payload (measure, range verdict, line-height, paragraph spacing, target container width) and states the CJK threshold variant. All five parameters and the estimation caveat are covered, so an agent has everything needed to invoke and interpret the result.

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 baseline is 3, but the description earns more: it explains that `language` sets the average character width and lists the supported codes, that `avgCharWidthEm` is an override with default 0.5, and that `charsPerLine` substitutes a counted value for the estimate. That is genuine added meaning beyond the schema's one-line parameter descriptions.

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?

"Check line length and suggest leading" gives a specific verb and resource, and the body names the concrete outputs (measure in characters, in-range verdict, recommended line-height, paragraph spacing, target container width). It doesn't explicitly distinguish itself from adjacent siblings like audit_type_scale, vertical_rhythm, or check_cjk_line_breaking, so it falls just short of a 5.

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 tells the agent which parameters to pass and when to prefer `charsPerLine` over the estimate, which is real usage guidance. However, it never states when to reach for this tool versus siblings such as vertical_rhythm or audit_type_scale, and offers no exclusions or preconditions. Usage is implied by the parameter narrative rather than declared.

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