Skip to main content
Glama
tvolodi

penpot-headless

by tvolodi

penpot_measure_text

Measure the exact width and height of text strings for any font, using Google Fonts or team fonts, to ensure accurate text placement in Penpot shapes without guesswork.

Instructions

Measure the real rendered width/height of a text string for a given font, without creating or touching any shape. Tries Google Fonts first (by family name, no API key needed); if the family is not on Google Fonts, searches all Penpot teams accessible to the configured token for a matching custom/team font. Computes glyph advance widths so the numbers match what Penpot would actually render — removing the guesswork around width/height when calling penpot_add_shapes or penpot_update_shapes for a text shape. Splits on explicit "\n" for multi-line text; pass maxWidth to also get word-wrapped line breaks for a fixed-width box. Returns { width, height, lineHeight, lines }, where width/height are the natural (or wrapped) bounding box and lines is a per-line breakdown of text/width.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
fontSizeNo
maxWidthNo
charactersYes
fontFamilyNoInter
fontWeightNo400
Behavior4/5

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

With no annotations provided, the description carries full burden. It discloses font lookup behavior, glyph advance computation, and handling of newlines and maxWidth. It does not mention auth needs or rate limits, but covers core behavior well.

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 comprehensive at ~7 sentences, front-loading the main purpose. While slightly verbose, every sentence adds value and it is well-structured.

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?

Despite no output schema, the description fully specifies return values (width, height, lineHeight, lines) and explains per-line breakdown. It covers multi-line and word-wrapping behavior, making it complete for the tool's purpose.

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 0%, so description must explain parameters. It explains characters, maxWidth, fontFamily, fontSize, fontWeight semantics, including that fontFamily is used for font lookup. It does not repeat defaults from schema but adds context beyond parameter names.

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 explicitly states it measures real rendered width/height of a text string for a given font without creating or touching any shape. It distinguishes itself from siblings like penpot_add_shapes and penpot_update_shapes by removing guesswork for text dimensions.

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 explains when to use it (before creating/updating text shapes) and how it handles font lookup (Google Fonts first, then team fonts). It also discusses multi-line and maxWidth parameter usage. However, it lacks explicit 'when not to use' 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/tvolodi/penpot-mcp'

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