Skip to main content
Glama

searchShaderSource

Find matching GLSL code across all effects using a regular expression and return snippets with surrounding context for targeted shader debugging or analysis.

Instructions

Search GLSL source code across all effects with a regular expression. Return matching snippets with context.

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": {
      "query": "<query>"
    },
    "name": "searchShaderSource"
  }
}

Input Schema

NameRequiredDescriptionDefault
limitNoMaximum results
queryYesRegular expression to search for
context_linesNoNumber of context lines around each match

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.5.4

TDQS

A3.6/5.0
Behavior3/5

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

No annotations are provided, so the description carries the full behavioral burden. It does disclose the return shape ('matching snippets with context'), which is genuinely useful, but it omits read-only confirmation, regex flavor/dialect, behavior on invalid patterns, and how truncation via limit interacts with context_lines.

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, zero filler, with the core action and scope front-loaded ahead of the return-value note. Nothing could be removed without losing information.

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 simple three-parameter read tool with full schema coverage and no output schema, the description covers what it searches, how it matches, and what it returns. The remaining gap is minor: regex dialect and any limits on scanning all effects are unstated.

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 description coverage is 100%, so all three parameters (query, limit, context_lines) are already documented in the schema. The description adds only mild reinforcement — 'with a regular expression' for query and 'with context' for context_lines — without explaining scope of the regex (per-effect vs global), match semantics, or default behavior.

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 (search) plus resource (GLSL source code), the scope ('across all effects') and the matching mechanism (regular expression). That clearly separates it from sibling tools like searchShaderKnowledge or searchShaderLibrary, which by name suggest different corpora, though the description never explicitly contrasts them.

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 implied by 'search GLSL source code across all effects' with a regex, so an agent can infer this is for pattern-matching raw shader text. However, there is no explicit when-to-use / when-not-to-use guidance and no alternative named for keyword-style or semantic lookups (e.g. searchShaderKnowledge).

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