Skip to main content
Glama

ps_get_histogram

Read-onlyIdempotent

Analyze image histograms to detect clipped shadows/highlights, verify exposure shifts after adjustments, and compare RGB channel means for neutral-gray checks.

Instructions

Whole-image (or per-channel) histogram — the quantitative answer to questions get_preview can't reliably answer by eye. Returns 256 bin counts plus mean / stdev / median. Cheap (~50ms), read-only. Reach for this when: (a) clipping detection — bins 0 and 255 carry the count of crushed shadows / blown highlights; you can't see clipping reliably in a downsampled JPEG preview; (b) exposure verification after a levels/curves/exposure adjustment — confirm the histogram actually shifted; (c) "is this image neutral-gray?" — compare R / G / B channel means; (d) confirming a destructive op did anything (two identical histograms = no-op regardless of the tool's success message). Composite reads the visible flattened image (any color mode). Per-channel reads require the document have that channel.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
channelNoWhich channel to read. "composite" (default) is the visible flattened image; if the active layer is an adjustment/fill/shape layer the tool transparently switches to a pixel layer to read it. "red"/"green"/"blue" require an RGB doc; "gray" a grayscale doc. "luminosity" dispatches per doc mode — Lab uses the Lightness channel (exact), Grayscale uses Gray (exact), RGB synthesizes a Rec.709 weighted approximation from R+G+B (mean is exact; stdev/median are approximations). The result's `channel` field annotates which path landed when a fallback was used.composite

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
binsNo
meanNo
stdevNo
medianNo
channelNo
contextNo
bin_countNo
total_pixelsNo
Behavior5/5

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

Annotations already declare readOnlyHint and idempotentHint, but the description adds valuable context: ~50ms cost, fallback behavior for adjustment/fill/shape layers, per-channel document requirements, and luminosity approximation details. It also clarifies the result's channel field annotates fallback paths—all beyond the basic safety 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?

The description is well-organized with a clear structure: purpose, return stats, cost, and a 'Reach for this when' list. It is slightly longer than necessary but every sentence carries useful information; the bullet-style list makes it skimmable.

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?

The description covers behavior, use cases, cost, and fallback semantics. With an output schema present, it doesn't need to detail return values beyond mentioning the stats. Given the tool's simplicity (one parameter), this is complete and actionable for an agent.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, and the schema description already explains channel meanings, document requirements, fallback behavior, and luminosity dispatch. The description reinforces but does not add new parameter semantics; its value lies more in usage guidance than in clarifying the channel parameter itself.

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 defines the tool as a whole-image or per-channel histogram, explicitly stating it returns 256 bin counts plus mean/stdev/median. It distinguishes itself from sibling get_preview by framing it as 'the quantitative answer to questions get_preview can't reliably answer by eye,' making its purpose unmistakable.

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?

The description provides explicit when-to-use guidance with four concrete use cases (clipping detection, exposure verification, neutral-gray checks, confirming destructive ops). It also names get_preview as an alternative and explains why this tool is preferable in those scenarios, fulfilling both when and why.

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/editmamei/editmamei'

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