Skip to main content
Glama
nmassi

glyphs-mcp

by nmassi

auto_kern

Automatically kern glyph pairs using optical gap analysis. Measures white-space between letters and calibrates to reference values for balanced spacing.

Instructions

Auto-kern glyph pairs using optical gap analysis (MB LetterKerner algorithm).

Measures the optical white area between each glyph pair using horizontal ray-casting, weighted by a trapezoidal function (full weight at baseline–xHeight, tapered in descender/ascender zones), then solves for the kern value that makes each pair's gap area match a calibration reference.

Auto-calibrates from nn (lowercase) and HH (uppercase) if no area is given.

Recommended workflow:

  1. Finalize spacing first (kerning can't fix bad spacing)

  2. Assign kerning groups: analyze_kerning_groups(apply=True)

  3. Preview: auto_kern(pairs="critical", dry_run=True)

  4. Apply critical: auto_kern(pairs="critical")

  5. Expand: auto_kern(pairs="auto") — all group combinations

  6. Verify: analyze_kerning()

Args: pairs: Pair selection mode: "critical" — ~75 essential pairs (AV, AT, To, Va, etc.) "auto" — generate representative pairs per kerning group combination "explicit" — use pairs_list pairs_list: Explicit pairs when pairs="explicit", e.g. [["A","V"],["T","o"]] area: Target gap area in units². None = auto-calibrate from nn/HH. step: Vertical sampling interval (default 5u, smaller = more precise) depth: Max probe depth per side (default 200u) factor: Optical correction factor (default 1.25, matches HT LetterSpacer) rounding: Round kern values to multiples of this (default 5) threshold: Skip kern values with abs < threshold (default 3) use_groups: Use group kerning keys (default True, strongly recommended) overwrite: Overwrite existing kerning (default False) dry_run: Preview only, don't apply (default False) master_id: Process only this master (empty = all masters)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
areaNo
stepNo
depthNo
pairsNocritical
factorNo
dry_runNo
roundingNo
master_idNo
overwriteNo
thresholdNo
pairs_listNo
use_groupsNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.3.0

TDQS

A4.7/5.0
Behavior4/5

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

With no annotations, the description carries the full burden. It discloses the algorithm (ray-casting, trapezoidal weighting), auto-calibration behavior from nn/HH, the default overwrite=False safety behavior, dry_run preview mode, and the effect of use_groups. It doesn't explicitly state that existing kerning is preserved by default or what happens on conflict, but the overwrite parameter and dry_run are disclosed. Minor gap: no mention of side effects on group kerning or master_id behavior, but the description is rich.

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 description is long but earns its length: algorithm explanation, workflow, and per-parameter semantics. It is front-loaded with the core purpose and algorithm, then workflow, then args. Slight redundancy (workflow steps repeat pairs modes already in Args) but not wasteful. A 4 because it's dense and well-organized, though a bit long.

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?

For a complex 12-parameter tool with no annotations and 0% schema coverage, the description covers algorithm, calibration, workflow, parameter semantics, and safety (dry_run, overwrite). The output schema exists, so return values need not be described. Nothing critical is missing for an agent to select and invoke this tool correctly.

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

Parameters5/5

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

Schema description coverage is 0%, so the description must fully compensate. It does: every parameter is explained with its mode, meaning, default, and often examples ('critical' — ~75 essential pairs, 'explicit' — use pairs_list, area — None = auto-calibrate from nn/HH). This is exactly what an agent needs to construct correct arguments.

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 opens with a specific verb and resource: 'Auto-kern glyph pairs using optical gap analysis (MB LetterKerner algorithm).' It clearly distinguishes this from sibling tools like set_kerning_pair (manual single pair) and analyze_kerning (verification) by describing the algorithm and workflow. The purpose is unmistakable.

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 provides an explicit 6-step recommended workflow, including when to use dry_run, when to use 'critical' vs 'auto' pairs, and prerequisites (finalize spacing, assign kerning groups). It also names the verification sibling (analyze_kerning) and the group-assignment sibling (analyze_kerning_groups). This is exemplary usage guidance.

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