Skip to main content
Glama

Shader code

shader
Read-onlyIdempotent

Generate GLSL, WGSL, HLSL, or MSL code to convert between color spaces, with ready entry functions for real GPU compilation—no hand-written color matrices.

Instructions

The conversion as shader source – GLSL (WebGL2; WebGL1 too unless the path reads a table), WGSL (WebGPU), HLSL (DirectX, Unity, Unreal) or MSL (Metal) – with an entry function <from>_<to> (hyphens stripped), e.g. vec3 rgb_oklch(vec3 c), plus every function on the path. Each language is differentially tested against the library and compiled on real GPUs: use it instead of writing color matrices. HLSL and MSL need the optional peer naga-wasm installed beside color-space.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
toYestarget space id, e.g. 'rgb', 'oklch', 'lab', 'slog3', 'rec709' (the 'spaces' tool lists all 221)
fromYessource space id, e.g. 'rgb', 'oklch', 'lab', 'slog3', 'rec709' (the 'spaces' tool lists all 221)
languageNodefault glsl

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
codeYes
entryYes
languageYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv3.5.0
    • changedInput schema / properties / from / description
      Previous value: -"source space id, e.g. 'rgb', 'oklch', 'lab', 'slog3', 'rec709' (the 'spaces' tool lists all 205)"New value: +"source space id, e.g. 'rgb', 'oklch', 'lab', 'slog3', 'rec709' (the 'spaces' tool lists all 221)"
    • changedInput schema / properties / to / description
      Previous value: -"target space id, e.g. 'rgb', 'oklch', 'lab', 'slog3', 'rec709' (the 'spaces' tool lists all 205)"New value: +"target space id, e.g. 'rgb', 'oklch', 'lab', 'slog3', 'rec709' (the 'spaces' tool lists all 221)"
  2. First observedv0.1.0

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already declare this a read-only, idempotent, non-destructive operation, so the safety profile is covered. The description adds genuinely useful behavior the annotations do not: the generated entry-point name and signature, the WebGL1 table-read caveat, and the hard dependency on the optional `naga-wasm` peer for HLSL/MSL. It stops short of describing failure modes or validation errors.

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?

Dense but front-loaded: the artifact is named first, then languages, then the entry-function convention, then the dependency note. Every parenthetical carries information (platform targets, WebGL1 caveat, naming rule), though the single long sentence is heavy to parse.

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?

An output schema exists, so return values need no explanation. Combined with annotations covering safety and the description covering the generated artifact, its naming, its language targets, and its dependency requirements, an agent has everything needed 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, but the description meaningfully extends the bare `language` enum by mapping glsl→WebGL2, wgsl→WebGPU, hlsl→DirectX/Unity/Unreal, and msl→Metal, which helps an agent pick a target. The `from`/`to` ids are left to the schema and the `spaces` tool, which is reasonable.

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 (produce) and resource (shader source for a color conversion), and enumerates the four output languages with their target platforms. The entry-function naming convention (`<from>_<to>`) makes it clearly distinct from siblings like `convert` or `code`, which produce values or generic code rather than GPU shader source.

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?

Explicitly says 'use it instead of writing color matrices', which tells the agent when this tool is preferred over hand-rolling a solution. It does not, however, contrast itself against the sibling `code` tool, so the choice among generation tools is left partly to inference.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Deploy Server

Other Tools