Skip to main content
Glama

get_histogram

Read-onlyIdempotent

Measures the photo and changes nothing in it. 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; on a very large photo it is slow, so make a checkpoint before it, as before any long call. region and mask narrow what is measured; a mask that is thin or feathered is measured at full resolution (the result then says exact, and it takes longer on a large photo).

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": {
      "image": "<image>"
    },
    "name": "get_histogram"
  }
}

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; a call that runs past its time limit keeps running and the next call waits for it; ask again then for the reading.
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 / 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 (checkpoint) 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; a call that runs past its time limit keeps running and the next call waits for it; ask again then for the reading."
  2. 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."
  3. 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."
  4. 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 (readOnly, idempotent, non-destructive), and the description adds genuinely new behavior: proxy-resolution under-counting of small clipped highlights, ~0.3s vs ~4s cost, the fact that a call past its time limit keeps running and blocks the next call, and that thin/feathered masks force full resolution. These are operational traits an agent cannot get from 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?

Front-loaded with purpose and effect, then mode selection; almost every clause carries decision-relevant information. It is dense with stacked parentheticals (timings, caveats) that make it heavier than necessary, and the mask/exact interaction is stated twice (description and schema).

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 5-parameter analytics tool with an output schema present, the description supplies everything needed to call it well: resolution mode tradeoff, timing, blocking behavior, masking semantics. Return-value structure is deferred to the output schema, which is appropriate.

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 baseline is 3; the description goes beyond it by explaining the perceptual weighting of luminance, the 0/255 pixel counts that distinguish real clipping from near-limit values, and that a thin/feathered mask is measured at full resolution and the result reports exact. Most remaining semantics (region fallback, channels default) already live in 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?

States a specific verb and resource ('Measures the photo', statistics per channel from ONE render) and immediately bounds the scope with 'and changes nothing in it,' plus it names the sibling whose decision it feeds ('export_photo'). The bins[v] definition makes the output of the tool unambiguous.

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 between modes: default fast proxy 'good for iterating' vs `exact: true` as 'the final clipping check before `export_photo`', and advises taking a `checkpoint` before the long call on very large photos. It also says when to use `region`/`mask` to narrow what is measured, so the agent has conditions rather than inference.

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