Review and compile shaders
godot_shaderChecks Godot shader files and unsaved code for Godot 4.7 naming, type, and compile errors, then optionally draws them on the Compatibility renderer to catch GPU driver issues.
Instructions
Check every shader (.gdshader, .gdshaderinc, Shader resources in scenes) two ways: a static review against Godot 4.7's own shader tables (Godot 3 names such as hint_albedo, SCREEN_TEXTURE or WORLD_MATRIX; built-ins in the wrong shader_type or function; read-only built-ins written, such as COLOR in a spatial fragment(); unknown render modes; missing includes; colour uniforms without source_color; performance hints), then a headless compile by real Godot when it is installed (no GPU needed) that adds Godot's own errors (headless Godot runs the full shader compiler). gpu: true also draws the shaders on the Compatibility renderer (needs a display, or xvfb-run on Linux; slower) for what only the GPU driver rejects: a uniform block that is too big, a sampler array indexed by a variable, a driver compile or link error. Every line is res://file:line: severity [rule] message; [godot] marks the compiler's, [gpu] the driver's. Pass code + file to check a shader before you save it (the GPU pass draws the file on disk), files for some shaders (an include also compiles the shaders that use it), compile: false to skip Godot. godot_check shaders: true runs the GPU pass over the whole project. godot_migrate rewrites the Godot 3 names; godot_api shader:spatial.fragment lists built-ins.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "godot_shader"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| gpu | No | also draw them on the Compatibility renderer, for GPU driver errors (needs a display or xvfb-run) | |
| code | No | unsaved shader code, checked in place of the file on disk | |
| file | No | res:// path the code belongs to (required with code) | |
| path | No | project folder, or a file or folder inside it (relative to the server's folder; default: the current project) | |
| files | No | only these res:// shaders, includes or scenes | |
| detail | No | brief (capped lists) or full (everything); default full | |
| compile | No | compile with Godot (default: when Godot is found; true fails without it) |