Skip to main content
Glama

Create shader effect

create_shader_effect

Save reusable WGSL ShaderFX effects with source validation and a parameter manifest, returning an effect ID and parameter table for later use.

Instructions

Save a reusable ShaderFX effect: WGSL defining fn fx(c: FxCtx) -> vec4 (straight rgba). Validated before saving; errors come back as [{ line, column, message }] in your source lines. Returns effect_id and the param table. FxCtx, helpers, manifest and v3 (textures, feedback, passes, data, particles) with examples: load_skill shaderfx-effects.

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": {
      "name": "<name>",
      "source": "<source>",
      "manifest": "<manifest>"
    },
    "name": "create_shader_effect"
  }
}

Input Schema

NameRequiredDescriptionDefault
dataNo[v3] Up to 16384 floats for data(i).
nameYesEffect name.
sourceYesWGSL with fn fx(c: FxCtx) -> vec4<f32> (no bindings, no @fragment). ≤ 24 KB (v3: 48 KB).
data_urlNo[v3] URL of a JSON array or CSV, resolved to floats at apply time.
feedbackNo[v3] { enabled, warmup_sec?, clear? }: prev(uv) reads the previous output frame.
geometryNo[v3] { mode: "quads"|"points", count }: instanced particles drawn by fn instance(i, c).
manifestYes{ kind: "filter"|"transition"|"generator", output: "add"|"normal"|"replace", params: [{ name, type: float|vec2|vec3|color|bool, min?, max?, default }] }; v3 adds passes / textures / feedback / geometry. Leave abi out.
texturesNo[v3] Up to 4 named textures; read with tex_<name>(uv).
is_publicNoShare publicly (default false).
overwriteNoReplace your effect with the same name.
project_idNoOptional project context.
descriptionNoOne-line description.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.7.4

TDQS

A3.7/5.0
Behavior4/5

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

Annotations already say this is a non-destructive, closed-world write, so the bar is lower; the description still adds real behavior: the source is validated before saving, failures return structured [{ line, column, message }] rather than throwing, and a successful call returns effect_id plus the param table. It omits permission/auth requirements and the overwrite semantics of the existing-effect case, which the schema only partially covers.

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?

Four dense sentences with the contract front-loaded (what is saved, the signature, validation behavior, return value) and the reference pointer last. Terminology is heavy but every sentence carries information; nothing is padded.

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?

For a 12-parameter, nested-object mutation tool with no output schema, the description covers the source format, validation failure shape, return values, and points to the deep reference for FxCtx/manifest/v3. Remaining gaps are minor: overwrite behavior and any auth or size constraints live only in the schema.

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%, so the baseline is 3; the per-parameter meanings (source limits, manifest shape, v3 fields) are already documented in the schema and the description mostly restates them. It does add the useful signal that the whole v3 surface (textures, feedback, passes, data, particles) is documented elsewhere via load_skill, but it explains no individual parameter beyond the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource ("Save a reusable ShaderFX effect") and immediately pins down what the payload must contain (WGSL with fn fx(c: FxCtx) -> vec4<f32>, straight rgba). That is enough to tell it apart from apply_shader_effect by implication (reusable/library vs. application), though the sibling is never named.

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

Usage Guidelines3/5

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

Usage is only implied: "reusable" hints this is the save-to-library path, and the load_skill shaderfx-effects pointer tells the agent where to get reference material. There is no explicit when-to-use vs. apply_shader_effect, no statement of prerequisites, and no when-not guidance.

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