Skip to main content
Glama

Optimize set

optimize_set

Optimize multiple SVG documents in one call, with per-doc results, total byte savings, and a cross-doc consistency check.

Instructions

Web-optimize a SET of documents in one call: per-doc results + aggregate + verdict.

When to use: losslessly shrinking a whole multi-document system (e.g. a 12-icon set) in one call, reading the set's total byte saving and a cross-doc consistency check. For a SINGLE document use svg_web_optimize; to inspect the opportunities use quality_report_set.

Key params: doc_ids is a non-empty, duplicate-free set; precision / keep_ids are the SAME arguments svg_web_optimize takes (applied to EVERY document). Each document is optimized through the reversible pipeline, so a CHANGED document gets ONE pre-mutation snapshot + Operation Record (ADR-004) and a no-op writes none. The whole set is rejected if ANY document fails (no partial apply on the remainder is suppressed — earlier successful docs stay optimized and reversible via their snapshots).

Return shape: OptimizeSetResultper_doc (each {doc_id, result} with the standard WebOptimizeResult), total_bytes_before / total_bytes_after / total_bytes_saved aggregated across the set, changed_count, and consistency — the structured cross-doc verdict computed on the PRE-optimize state (per property: agree/disagree + the differing values + which doc_ids differ).

Example: optimize_set(["d1","d2","d3"], precision=2)

Render and look before you trust this edit: render with render_preview (or live_render_view) and inspect the result before relying on it; restore_snapshot reverts it if it is wrong.

Risk class: medium (each document optimized reversibly; one snapshot per changed doc).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
doc_idsYes
keep_idsNo
precisionNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
per_docYes
consistencyYesStructured cross-document consistency audit over a set. One :class:`ConsistencyProperty` per audited property (``viewBox``, ``stroke_width``, ``id_naming``). ``consistent`` is True iff EVERY audited property agrees across the set. Not prose: an agent reads ``properties`` to see precisely which property disagrees and which ``doc_ids`` carry which value.
changed_countYes
total_bytes_afterYes
total_bytes_savedYes
total_bytes_beforeYes
Behavior5/5

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

Discloses reversible pipeline, no-op behavior, whole-set rejection on failure, snapshot creation, and risk class 'medium', adding significant context beyond minimal annotations.

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?

Well-structured with sections, but somewhat lengthy. Every sentence contributes value; minor redundancy could be trimmed.

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?

Given tool complexity, output schema existence, and no sibling tool covers set optimization, the description provides all necessary input, behavior, output, and risk details for correct invocation.

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?

With 0% schema coverage, description compensates by explaining doc_ids constraints, and referencing precision/keep_ids from sibling tool. However, keep_ids purpose is not fully detailed, relying on agent's knowledge of svg_web_optimize.

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 clearly states the verb 'Web-optimize' and the resource 'SET of documents', and contrasts with single-document and inspection tools, making it distinguishable from siblings.

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?

Explicitly states when to use (losslessly shrinking a multi-document system), and when to use alternatives (svg_web_optimize for single docs, quality_report_set for inspection). Also recommends post-use preview.

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/jjjsood/inkscape-mcp-server'

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