Skip to main content
Glama

get_histogram

Read-onlyIdempotent

Statistics for several channels from ONE render: mean, median, 1st/5th/95th/99th percentiles and a 256-bin histogram per channel (bins[v] = pixel count at value v, 0-255, in the structured result); the text also gives each channel's pixel count at 0 and at 255, which tells real clipping from a value merely near the limit. Luminance uses perceptual weights. The default is fast (about 0.3 s, from a 1024 px proxy render): good for iterating, but small clipped highlights can be under-counted. Pass exact: true (about 4 s on 24 MP, much longer on a very large photo) as the final clipping check before export_photo; if it times out the editing session restarts and unsaved work is lost, so checkpoint first. region and mask narrow what is measured.

Input Schema

NameRequiredDescriptionDefault
maskNoThe name of a selection channel: measure only the pixels it selects at 50% or more (a hard cut, no partial credit for soft edges), e.g. the mean lightness or color of a selected object. Combines with region and exact; pixels in the result is the number of pixels counted.
exactNofalse (default): computed on the 1024px proxy render (~0.3s) — good for iterating, but small clipped highlights can be under-counted. true: full-resolution composite (~4s on 24MP) — the trustworthy final clipping check before export. On a very large document true can take much longer; if it times out the editing session restarts and unsaved work is lost, so save (checkpoint) first.
imageYesImage id, as returned by open_photo.
regionNoA rectangle in document pixels: {x, y, width, height}. Must lie entirely within the image — a region partly or fully outside it is refused rather than silently clamped. Computed on the proxy when it maps to a big-enough proxy area, else auto-falls back to a full-resolution crop; exact:true always forces the full-resolution crop.
channelsNoDefault: all four (luminance, red, green, blue) in ONE render.

Output Schema

NameRequiredDescriptionDefault
exactNo
widthNo
heightNo
pixelsNo
channelsNoKeyed by channel name (luminance, red, green, blue).
unmirrored_filtersNoNames of live filters that could not be re-attached on this proxy render — absent from these stats entirely. Present whenever histogram actually used the (mirrored) preview proxy: the default whole-image path, OR a `region` large enough to be sampled from the proxy rather than falling back to a full-resolution crop. Absent when exact: true, or when a region is too small and falls back to that full-resolution crop — neither path mirrors filters at all.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedInput schema / properties / mask / description
      Previous value: -"The name of a selection channel: measure only the pixels it selects at 50% or more (a hard cut, no partial credit for soft edges), e.g. the mean lightness or colour of a selected object. Combines with region and exact; pixels in the result is the number of pixels counted."New value: +"The name of a selection channel: measure only the pixels it selects at 50% or more (a hard cut, no partial credit for soft edges), e.g. the mean lightness or color of a selected object. Combines with region and exact; pixels in the result is the number of pixels counted."
  2. Changed1 schema field changed
    • changedInput schema / properties / exact / description
      Previous value: -"false (default): computed on the 1024px proxy render (~0.3s) — good for iterating, but small clipped highlights can be under-counted. true: full-resolution composite (~4s on 24MP) — the trustworthy final clipping check before export. On a very large document true can take much longer; if it times out the editing session restarts and unsaved work is lost, so save (save_project) first."New value: +"false (default): computed on the 1024px proxy render (~0.3s) — good for iterating, but small clipped highlights can be under-counted. true: full-resolution composite (~4s on 24MP) — the trustworthy final clipping check before export. On a very large document true can take much longer; if it times out the editing session restarts and unsaved work is lost, so save (checkpoint) first."
  3. First observed

TDQS

A4.8/5.0
Behavior5/5

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

Beyond the readOnly/idempotent annotations it discloses timings (0.3 s proxy vs ~4 s on 24 MP), a real risk (timeout restarts the editing session and loses unsaved work), a measurement caveat (small clipped highlights under-counted on the proxy), and the luminance weighting model. That is exactly the context annotations cannot carry.

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?

Long but dense and front-loaded with what is returned before the cost/risk discussion. Some redundancy — the timeout warning and exact-mode timing are restated almost verbatim in the schema's `exact` description, so a sentence could be trimmed without loss.

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?

With an output schema present this only needs to explain how to read the result, and it does: bin indexing, clipping detection, luminance weighting, and the proxy-vs-full-resolution accuracy tradeoff. An agent has everything needed to call it correctly and interpret the output.

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 would be 3; the description still adds interpretation the schema lacks, notably `bins[v]` = pixel count at value v and the pixel-count-at-0/255 clipping signal, plus a one-line summary that region and mask narrow the measurement. Not a full 5 since the individual parameter behaviors are already well covered by the schema text.

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?

Names a specific verb (statistics) and enumerates exactly which statistics — mean, median, percentiles, 256-bin histogram — per channel, with the 'ONE render' cost note clarifying it is a single pass. This clearly separates it from siblings like inspect, preview and overview.

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 routes the agent: default fast mode for iterating, `exact: true` as the final clipping check before `export_photo`, and `checkpoint` first if there is unsaved work. It also names the two sibling tools that bookend its use.

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