Skip to main content
Glama

GO AI Tools

Image compression size-vs-quality curve

image_compression_curve
Read-onlyIdempotent

Analysis-only tool (no image bytes returned): re-encodes an image at the same fixed 14 quality levels GO AI's browser compressor samples to draw its size-against-quality curve (5, 10, ..., through 100 -- see the qualities in each returned point), for JPEG, WebP or AVIF, and reports the resulting byte size and percent change at each level. The image is first downscaled to fit within maxDimension (default 1600px on the longer side, never enlarged), exactly as the source's working canvas is, then every quality level is encoded one at a time. Because this repeats the encode 14 times, its maxDimension is capped at 2000px -- lower than image_compress's 4000px -- which costs nothing in practice, since the knee of the curve is a property of the image's content and sits in the same place at either size. Use this to find that 'knee' (where size stops dropping much per quality point) for a specific image, or image_compress to actually get the compressed bytes at one chosen quality. Input is base64-encoded image bytes, not a file path or URL.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
formatNoFormat to sample the curve in. Defaults to 'webp', matching the source's own default.webp
imageBase64YesBase64-encoded source image bytes (not a file path or URL).
maxDimensionNoLonger-side cap in pixels before encoding, aspect preserved, never enlarged. Defaults to 1600, matching the source. Capped at 2000 here (vs 4000 for image_compress) because this tool runs the encode 14 times.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
formatYesFormat every point was encoded in.
pointsYesThe 14 fixed sample points, ascending by quality. The 'knee' -- where size stops dropping much per quality point -- is what this tool exists to locate. No image bytes are returned.
workingYesThe downscaled image every quality level was encoded from. The knee sits in the same place at either size, so this does not distort the curve.
originalYesThe image as supplied.

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. Changed1 schema field changed
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "$schema": "http://json-schema.org/draft-07/schema#",
      +  "additionalProperties": false,
      +  "properties": {
      +    "format": {
      +      "description": "Format every point was encoded in.",
      +      "enum": [
      +        "jpeg",
      +        "webp",
      +        "avif"
      +      ],
      +      "type": "string"
      +    },
      +    "original": {
      +      "additionalProperties": false,
      +      "description": "The image as supplied.",
      +      "properties": {
      +        "bytes": {
      +          "description": "Original file size in bytes.",
      +          "maximum": 9007199254740991,
      +          "minimum": -9007199254740991,
      +          "type": "integer"
      +        },
      +        "height": {
      +          "description": "Original height in px.",
      +          "maximum": 9007199254740991,
      +          "minimum": -9007199254740991,
      +          "type": "integer"
      +        },
      +        "width": {
      +          "description": "Original width in px.",
      +          "maximum": 9007199254740991,
      +          "minimum": -9007199254740991,
      +          "type": "integer"
      +        }
      +      },
      +      "required": [
      +        "width",
      +        "height",
      +        "bytes"
      +      ],
      +      "type": "object"
      +    },
      +    "points": {
      +      "description": "The 14 fixed sample points, ascending by quality. The 'knee' -- where size stops dropping much per quality point -- is what this tool exists to locate. No image bytes are returned.",
      +      "items": {
      +        "additionalProperties": false,
      +        "properties": {
      +          "bytes": {
      +            "description": "Encoded size at that quality, in bytes.",
      +            "maximum": 9007199254740991,
      +            "minimum": -9007199254740991,
      +            "type": "integer"
      +          },
      +          "percentChange": {
      +            "description": "Size against the original as a percentage; negative means smaller.",
      +            "type": "number"
      +          },
      +          "quality": {
      +            "description": "The quality level sampled.",
      +            "maximum": 9007199254740991,
      +            "minimum": -9007199254740991,
      +            "type": "integer"
      +          }
      +        },
      +        "required": [
      +          "quality",
      +          "bytes",
      +          "percentChange"
      +        ],
      +        "type": "object"
      +      },
      +      "type": "array"
      +    },
      +    "working": {
      +      "additionalProperties": false,
      +      "description": "The downscaled image every quality level was encoded from. The knee sits in the same place at either size, so this does not distort the curve.",
      +      "properties": {
      +        "height": {
      +          "description": "Height the curve was measured at, in px.",
      +          "maximum": 9007199254740991,
      +          "minimum": -9007199254740991,
      +          "type": "integer"
      +        },
      +        "maxDimension": {
      +          "description": "The longest-side cap that was applied before sampling.",
      +          "maximum": 9007199254740991,
      +          "minimum": -9007199254740991,
      +          "type": "integer"
      +        },
      +        "width": {
      +          "description": "Width the curve was measured at, in px.",
      +          "maximum": 9007199254740991,
      +          "minimum": -9007199254740991,
      +          "type": "integer"
      +        }
      +      },
      +      "required": [
      +        "width",
      +        "height",
      +        "maxDimension"
      +      ],
      +      "type": "object"
      +    }
      +  },
      +  "required": [
      +    "format",
      +    "original",
      +    "working",
      +    "points"
      +  ],
      +  "type": "object"
      +}
  2. First observed

TDQS

A4.8/5.0
Behavior5/5

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

Annotations already cover safety (readOnlyHint, idempotentHint, destructiveHint=false), and the description adds substantial behavioral context on top: the 14 repeated encodes, the downscaling-to-maxDimension pipeline, no image bytes returned, and the cap rationale ('costs nothing in practice, since the knee of the curve is a property of the image's content'). No contradiction with 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?

Dense but well-organized: core behavior, pipeline, limitation with justification, usage routing, input format. Every sentence earns its place, though a few points (input format, never-enlarged) repeat schema text and the caveat about the knee's position is somewhat elaborate. Front-loading is excellent.

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?

Complete for a tool of this complexity: it specifies the fixed quality levels, the supported formats, the downscale behavior, the cap and its rationale, the output shape (byte size and percent change per point), and the sibling routing. The output schema exists and annotations cover the safety profile, so the description needn't repeat those.

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 100%, so the baseline is 3; the description adds real value by explaining the why behind maxDimension's cap (14 encodes) and why that cap doesn't hurt accuracy. It also clarifies the input contract (base64 bytes, not path/URL) in prose. Slightly redundant with schema text on defaults, hence 4 rather than 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 the defining trait ('Analysis-only tool (no image bytes returned)') and states a specific action: re-encode at 14 fixed quality levels and report byte size and percent change per level. It explicitly differentiates from the sibling image_compress ('or image_compress to actually get the compressed bytes'), so an agent can distinguish them without opening either schema.

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?

Gives an explicit selection rule: 'Use this to find that knee... for a specific image, or image_compress to actually get the compressed bytes at one chosen quality.' It also surfaces the operational difference (2000px cap vs image_compress's 4000px) and explains why that difference is practically irrelevant, removing a potential reason for an agent to wrongly pick the other tool.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources