Skip to main content
Glama

maket_html

Read and write page HTML: set the initial skeleton, patch iterative edits by data-id, get current markup, and check layout overflow without writing.

Instructions

When to use: read and write page HTML. Pick set for the initial skeleton, patch for iterative edits, get to read, check to measure overflow without writing.

Every visible element MUST have a data-id. Use flex/grid with mm units. When a charte is loaded, prefer var(--charte-*) tokens. The compliance check is narrow: it rejects (1) hardcoded colour literals that duplicate an existing charte token value (e.g. #2563EB when primary=#2563EB), (2) any hardcoded font-family when the charte defines fonts, (3) any hardcoded box-shadow when the charte defines shadows. Fresh colours that don't duplicate a token pass untouched. Layout override: data-maket-layout="ignore" excludes exactly one marked non-interactive leaf block from overflow, overlap, clipping, and margin checks. The block must have no child elements or text; controls, links, data-maket-bind and focusable/ARIA elements are ineligible. Reserve it for intentional non-content decoration after visual review. Add it only with maket_html action=patch using attr on an existing data-id; the enabling op must be the only op in that patch request. Set, insert, replace, and content HTML cannot introduce it. For a state-backed document, Mustache is display-only. The document must author editable controls and all their CSS explicitly: data-maket-bind supports for booleans, and for strings, for string enums (or for a string whose options come from a state list with data-maket-options="state.list"), and for the single-value editor; a bound button with data-maket-value="" (optionally data-maket-action="set") writes that value on click instead. Use state.foo at the root and relative foo inside state sections; never persist data-maket-path or other runtime attributes. set — REPLACE the full page HTML. Rejects the whole payload on any violation. Requires context_token when the doc has a charte. patch — apply ops by data-id: style/content/attr/insert/replace/remove/clone/moveTo. Violating ops roll back individually, the rest still apply. get — return current HTML; pass id= for a single element, format=text to strip tags. check — measure layout against the canvas + declared canvas.margins, and report page links that target a missing page; no side effects. The page is measured as readers see it: a state-backed page hydrated with the current document state (a JSON Forms page on its rendered form), a collection page with the member its preview cursor shows (first member otherwise), a Structured Workspace collection document with its items; a list that flows onto continuation pages is measured page by page; other pages as authored. The report's first line names what was measured. set and patch measure the same way. Returns a Markdown measurement report with physical canvas and content extents, root geometry, problematic addressable blocks, parent/canvas excess per side, clipping, and overlap pairs. Status: ✓ OK, ⚠ tight (block crosses a declared margin band — tighten or move into the safe zone before shipping), ⛔ overflow (block escapes the canvas, not shippable; pairwise overlaps between [data-id] blocks are reported under this same status), or ⛔ unchecked when headless validation could not run. On tight/overflow, the next: block points to a snapshot + targeted patch; unchecked is diagnostic-only to avoid blind retry loops. Page links: (canonical, 1-based page number) or navigates to that page of the same document in Canvas, Reader and viewer, and becomes an internal link in print and PDF. In the authoring Canvas a plain click selects the link for editing; ⌘-click (Ctrl-click elsewhere) follows it. The href is a literal: set and patch refuse Mustache in a page link.

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": {
      "action": "<action>",
      "doc": "<doc>",
      "page": "<page>"
    },
    "name": "maket_html"
  }
}

Input Schema

NameRequiredDescriptionDefault
idNoFor get: data-id of a single element to return; omit to fetch the whole page.
docYesDocument name (always required).
opsNoFor patch: list of surgical ops by data-id. Each op has `id` plus one of: style (object), content (string), attr (object), insert (html) + optional position, replace (outerHTML), remove (true), clone (newId), moveTo (targetId) + optional position. To exclude one intentional non-interactive leaf decoration with no child elements or text from layout validation, patch that existing element with attr: {"data-maket-layout":"ignore"}; controls, links, data-maket-bind and focusable/ARIA elements are ineligible. This override is rejected in insert/replace/content HTML, and in set HTML except on a data-id that already carries it in the stored page (so a get → set round trip keeps it), and its enabling op must be the only op in the patch request.
htmlNoFor set: full page HTML. Every visible element MUST carry a data-id. Use flex/grid with mm units; images use relative filenames (src="photo.jpg"); colours/fonts come from var(--charte-*). Example: <div data-id="page" style="width:210mm;height:297mm;display:flex;flex-direction:column;padding:15mm"><h1 data-id="title">Hello</h1></div>.
pageYesPage number, 1-based (always required).
actionYesOperation to run. See the tool description for the action table.
formatNoFor get: 'html' (default, full markup) or 'text' (tags stripped).
context_tokenNoFor set: charte context token from maket_charte view. REQUIRED when the document has a charte — proof the brand guidelines were read first.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv2.3.1
    • changedInput schema / properties / ops / description
      Previous value: -"For patch: list of surgical ops by data-id. Each op has `id` plus one of: style (object), content (string), attr (object), insert (html) + optional position, replace (outerHTML), remove (true), clone (newId), moveTo (targetId) + optional position. To exclude one intentional non-interactive leaf decoration with no child elements or text from layout validation, patch that existing element with attr: {\"data-maket-layout\":\"ignore\"}; controls, links, data-maket-bind and focusable/ARIA elements are ineligible. This override is rejected in set/insert/replace/content HTML, and its enabling op must be the only op in the patch request."New value: +"For patch: list of surgical ops by data-id. Each op has `id` plus one of: style (object), content (string), attr (object), insert (html) + optional position, replace (outerHTML), remove (true), clone (newId), moveTo (targetId) + optional position. To exclude one intentional non-interactive leaf decoration with no child elements or text from layout validation, patch that existing element with attr: {\"data-maket-layout\":\"ignore\"}; controls, links, data-maket-bind and focusable/ARIA elements are ineligible. This override is rejected in insert/replace/content HTML, and in set HTML except on a data-id that already carries it in the stored page (so a get → set round trip keeps it), and its enabling op must be the only op in the patch request."
  2. Changed1 schema field changedv1.7.0
    • changedInput schema / $schema
      Previous value: -"http://json-schema.org/draft-07/schema#"New value: +"https://json-schema.org/draft/2020-12/schema"
  3. Changed1 schema field changedv1.5.0
    • changedInput schema / properties / ops / description
      Previous value: -"For patch: list of surgical ops by data-id. Each op has `id` plus one of: style (object), content (string), attr (object), insert (html) + optional position, replace (outerHTML), remove (true), clone (newId), moveTo (targetId) + optional position."New value: +"For patch: list of surgical ops by data-id. Each op has `id` plus one of: style (object), content (string), attr (object), insert (html) + optional position, replace (outerHTML), remove (true), clone (newId), moveTo (targetId) + optional position. To exclude one intentional non-interactive leaf decoration with no child elements or text from layout validation, patch that existing element with attr: {\"data-maket-layout\":\"ignore\"}; controls, links, data-maket-bind and focusable/ARIA elements are ineligible. This override is rejected in set/insert/replace/content HTML, and its enabling op must be the only op in the patch request."
  4. First observedv0.1.0

TDQS

A4.7/5.0
Behavior5/5

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

No annotations are supplied, so the description carries the full burden and does so: set rejects the whole payload on violation, patch rolls back ops individually while the rest still apply, check has no side effects, and the compliance check's exact rejection rules are enumerated. It also discloses measurement semantics (state-hydrated pages, preview cursor member, page-by-page flow), report contents, status meanings (✓/⚠/⛔/unchecked), and that page-link hrefs are literals that reject Mustache.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loaded with a clear 'When to use' line and an action list, and most sentences carry real rule content. However, it is a dense wall of prose with several blocks (layout override, state/Mustache binding, page links) that restate or overlap the ops and context_token schema descriptions, and the long 'measured as readers see it' clause is hard to parse in one pass.

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 tool with four modes and no output schema, this covers what an agent needs: the check report's line-by-line contents and status codes, rollback behavior for violations, the charte-token prerequisite, and the page-link syntax. Nothing required to invoke any of the four actions correctly appears missing.

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 description coverage is 100%, so the baseline is 3; the description still adds cross-parameter constraints the schema does not express, such as the enabling attr op needing to be the only op in a patch request, that set cannot introduce data-maket-layout except on an already-marked data-id, and when context_token becomes mandatory. The get id/format semantics are largely repeated from the schema rather than extended, which keeps this below 5.

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?

Opens with a specific verb+resource ('read and write page HTML') and then disambiguates all four actions inline: set replaces full page HTML, patch applies ops by data-id, get returns HTML, check measures layout. An agent can tell exactly which mode to enter and how each differs from the others.

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?

Explicit routing: 'Pick set for the initial skeleton, patch for iterative edits, get to read, check to measure overflow without writing.' It also states when to use the layout-override escape hatch (after visual review, one non-interactive leaf) and when set requires a context_token, plus when to prefer var(--charte-*) tokens. When-to-use and when-not (override ineligible for controls/links/bound elements) are both covered.

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