Skip to main content
Glama

ass_convert_clip_scale

Convert vector clip coordinates to a target \p scale, preserving rendered appearance. Measures ink bounding box before and after to prove the conversion.

Instructions

Rewrite vector clip coordinates from their current \p scale to target_scale.

A clip made at level S renders each unit at 2 ** (1 - S) script pixels; to keep the rendered result identical at level T every coordinate is multiplied by 2 ** (T - S) and rounded to the nearest integer. The clip is rewritten with an explicit \clip(T,...) level.

The tool proves the conversion by measuring the rendered ink bounding box with measure.measure_render before and after (at the midpoint of the first selected line) and reporting both, plus converged. Measurement failing (no ffmpeg) is reported as measurement.error instead of an exception.

Both measurements carry an empty flag: if the line renders no ink at all (for example a drawing with no \pos/\an whose geometry lands off-screen) then before and after are both empty and converged is true for a trivial reason. A caller that wants a real proof must check not measurement["before"]["empty"] first, which is what the test suite does.

dry_run=True computes everything and reports the measurement proof without touching the document.

Returns {doc_id, target_scale, dry_run, converted, lines: [{index, source_scale, target_scale, ratio, before_arg, after_arg, text}], measurement: {before, after, delta, converged, time_ms}}.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
doc_idNo
dry_runNo
selectionNo
target_scaleNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.4/5.0
Behavior5/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 so exceptionally: it documents the rounding behavior, the explicit \clip(T,...) rewrite, the measurement-based proof via measure.measure_render, the failure mode (measurement.error instead of an exception when ffmpeg is missing), the empty-ink trivial-convergence caveat, and what dry_run actually touches. This is far beyond a bare mutation description.

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 purpose is front-loaded in the first line, followed by rationale, then caveats, then the return shape – a sensible ordering. It is dense and somewhat long, but nearly every sentence adds real information (math, proof semantics, empty caveat, dry_run); only the formula derivation is arguably heavier than needed.

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?

Even though an output schema exists, the description anticipates the tricky parts: the empty-ink false-positive convergence and the explicit check ('not measurement["before"]["empty"]') a caller must perform for a real proof. Combined with the error-handling note and dry_run semantics, the definition is complete for a tool of this 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?

Schema coverage is 0%, so the description must compensate. It richly explains target_scale (the 2**(T-S) ratio, rounding) and dry_run ('computes everything ... without touching the document'), covering the two non-obvious params. doc_id and selection are left unqualified, but those are conventional in this tool family, so the gap is minor.

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?

States a precise verb and resource ('Rewrite vector clip coordinates') plus the exact transformation (from current \p scale to target_scale). An agent can distinguish it from siblings like ass_set_clip or ass_remove_clip purely from this sentence, and the level math makes the operation unambiguous.

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?

Usage is implied by the mechanism (rescale an existing clip when the script resolution/level changes) and dry_run=True is explained as a non-mutating proof mode. However, it never states when to prefer this over siblings such as ass_set_clip/ass_scale_drawing, nor any preconditions or exclusions.

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

Deploy Server

Other Tools