Skip to main content
Glama
lpenguin
by lpenguin

read_texture

Inspect a live GPU texture or render target region without full capture, returning per-channel stats, hole coverage, and an ASCII luminance view. Resolves texture views automatically; use when a capture is armed.

Instructions

Read a region of a live GPU texture / render target (G-buffer attachment, depth, canvas) on a connected page, without taking a full capture. Copies the texture to a readback buffer, decodes per its format, and returns per-channel min/max/mean, the fraction of unrasterised 'hole' texels (RGB all ~0 = the clear value showing through), and a small ASCII luminance view of the spatial pattern — never raw pixels. Pass a Texture id OR a TextureView id (a render pass attachment is a TextureView — it is resolved to its source texture automatically, so no get_object round-trip is needed). The texture must have COPY_SRC, which the inspector adds to every texture while a capture is armed. Note: reading an engine's POOLED render target after the frame can be unreliable (the pool may have recycled it); to see the final image use screenshot_page instead.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
xNoRegion origin x (default 0).
yNoRegion origin y (default 0).
layerNoArray layer / depth slice (default 0).
widthNoRegion width (default: to the right edge, capped 1024).
heightNoRegion height (default: to the bottom edge, capped 1024).
pageIdNoPage to read from. Optional when exactly one page is connected.
mipLevelNoMip level (default 0).
textureIdYesNumeric id of the GPU Texture OR TextureView object to read (a view is resolved to its texture).
Behavior5/5

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

With no annotations, the description carries the full burden of behavioral disclosure, and it delivers: it reveals the internal copy-to-readback-buffer operation, per-format decoding, the COPY_SRC prerequisite that the inspector adds only while a capture is armed, the TextureView-to-texture resolution behavior, and the pooling pitfall. This far exceeds what a bare schema would communicate.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The core purpose is front-loaded ('Read a region of a live GPU texture'), followed by return-value semantics, then parameter guidance, then caveats in order of importance. Although it is a dense paragraph, every sentence earns its place — trimming any would lose critical information about prerequisites, pitfalls, or alternatives given the tool's GPU-readback complexity.

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?

This is a high-complexity tool (8 parameters, TextureView resolution, COPY_SRC prerequisites, pooling hazards) with no annotations and no output schema, so the description must compensate — and it does. It explains the return shape (stats, hole fraction, ASCII view, no raw pixels), the failure mode (pool recycling), and the escape hatch (screenshot_page), leaving nothing an agent needs to invoke it correctly.

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 description coverage is 100%, so the baseline is 3. The description adds genuine meaning beyond the schema: it explains what a TextureView is (a render pass attachment), why passing one works without a get_object round-trip, and the COPY_SRC precondition on the textureId target. The region-oriented parameters (x/y/width/height, layer, mipLevel) are already fully documented in the schema, so no more is needed.

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 opens with a specific verb and resource — 'Read a region of a live GPU texture / render target' — and narrows scope with 'a connected page' and 'without taking a full capture'. It also enumerates exactly what is returned (per-channel min/max/mean, hole fraction, ASCII luminance view, 'never raw pixels'), which differentiates it sharply from siblings like screenshot_page, read_buffer, and get_object.

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?

Provides explicit when-to-use and when-not-to-use guidance: it names screenshot_page as the alternative 'to see the final image', warns that pooled render targets may have been recycled and are unreliable, and explains that a TextureView is resolved automatically so 'no get_object round-trip is needed'. This routes an agent to the correct tool without opening any schemas.

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/lpenguin/webgpu_inspector_mcp'

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