Skip to main content
Glama
lpenguin
by lpenguin

decode_vertex_buffer

Decode captured vertex buffer data into per-attribute values like UV coordinates, automatically using the draw's pipeline layout from a setVertexBuffer command index.

Instructions

Decode the first N vertices of a captured vertex buffer into per-attribute numbers, so you can read e.g. 'attribute @location(2) (uv) = (0,0)' directly. Pass the bufferDataCommandIndex from get_draw_state (a setVertexBuffer command); the vertex layout is taken from the draw's pipeline automatically (or pass layout/pipelineId).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
firstNNoNumber of vertices to decode (default 8).
layoutNoOptional explicit GPUVertexBufferLayout { arrayStride, attributes:[{shaderLocation, format, offset}] }.
captureIdNoCapture id (default: most recent).
baseVertexNoFirst vertex to decode from (default 0).
pipelineIdNoOptional: pipeline object id to derive the layout from.
commandIndexYesIndex of the setVertexBuffer command (vertexBuffers[].bufferDataCommandIndex from get_draw_state).
Behavior4/5

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

With no annotations provided, the description carries the full behavioral burden, and it delivers: it discloses the non-obvious layout-resolution behavior (auto-derived from the draw's pipeline unless overridden), the output format via a concrete example, and the exact expected input provenance. It does not cover failure modes for invalid indices, but the core behavior is well disclosed.

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?

Two sentences with zero filler: the first front-loads purpose and shows the output shape, the second handles the critical input provenance and layout resolution. Every clause earns its place.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given 6 params, nested layout objects, and no output schema, the description compensates well with a workflow reference to get_draw_state and an example of the return format. The only notable gap is no explicit contrast with read_buffer and no error-condition guidance, but nothing essential to calling it correctly is missing.

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, but the description adds real meaning beyond the schema: it connects commandIndex to get_draw_state's bufferDataCommandIndex, treats layout and pipelineId as alternative override paths, and clarifies the auto-derived default. This is a clear step above the raw 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?

The description opens with a specific verb+resource+outcome: 'Decode the first N vertices of a captured vertex buffer into per-attribute numbers' and includes a concrete output example ('attribute @location(2) (uv) = (0,0)'). This clearly differentiates it from raw-read siblings like read_buffer, which would deliver bytes rather than decoded attributes.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It gives explicit operational context: the required commandIndex must come from get_draw_state's bufferDataCommandIndex, and it explains when to rely on the pipeline-derived layout versus passing layout/pipelineId as overrides. It stops short of a 5 because it does not explicitly name when-not-to-use conditions or contrast itself against read_buffer.

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