Skip to main content
Glama

Search inside scripts

search_scripts
Read-only

Searches decompiled Roblox game scripts by exact text, Lua pattern, or ranked word matches; narrow by root or class to find relevant code within a time budget.

Instructions

Search the source code of the game's scripts, like grep. Modes: text (exact text, default), pattern (a Lua pattern, always case sensitive) and words (every word must appear, scripts are ranked by how often they match). It decompiles the scripts, which can be slow (results are cached in the executor, set refresh to decompile again), so it stops after budget_seconds and reports how many scripts it searched. Narrow it with root or class_name for speed. Requires the connected state.

Input Schema

NameRequiredDescriptionDefault
modeNoHow to match the query (default text).
rootNoDotted path to search under (default game).
queryYesWhat to look for.
clientNoClient id from list_clients, for example c2. Defaults to the client that connected last.
refreshNoDecompile the scripts again instead of using cached sources (default false).
class_nameNoOnly search this kind of script.
max_matchesNoMaximum matches to return (default 40).
max_scriptsNoMaximum number of scripts to search (default 150).
context_linesNoLines of context around each match (default 0).
budget_secondsNoStop searching after this many seconds (default 20).
case_sensitiveNoMatch the case exactly (default false).
include_hiddenNoAlso search scripts outside the tree (default false).

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv1.4.0
    • addedInput schema / properties / refresh
      Added value: +{
      +  "description": "Decompile the scripts again instead of using cached sources (default false).",
      +  "type": "boolean"
      +}
  2. First observedv0.1.0

TDQS

A4.2/5.0
Behavior5/5

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

Beyond the readOnly/openWorld annotations, it discloses the important non-obvious traits: decompilation cost, caching in the executor, that refresh forces re-decompile, and that budget_seconds truncates the run and reports how many scripts were searched. The connection prerequisite is also stated, which annotations do not cover.

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?

Front-loads the purpose before modes and performance caveats, and every clause carries information (modes, cost, caching, budget, narrowing, prerequisite). It is dense and parenthetical, but no sentence is wasted.

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 tool with no output schema, the description covers the costly behavior, caching/refresh semantics, time truncation, the connection requirement, and how to scope searches. It would be stronger if it sketched what a match result contains or how truncation affects completeness of results.

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 the one-line schema entries lack: pattern means a Lua pattern that is always case sensitive (implicitly overriding case_sensitive), words ranks by match frequency, refresh re-decompiles, and budget_seconds bounds runtime. Minor gaps remain for include_hidden, max_matches, and max_scripts.

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?

Opens with a specific verb and resource ("Search the source code of the game's scripts") plus a grep analogy that implicitly separates it from semantic_search and from the single-script get_script_source. It stops short of naming any sibling explicitly, so the differentiation is inferred rather than stated.

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?

Gives practical usage context: the three modes with defaults, advice to "Narrow it with root or class_name for speed", and the prerequisite "Requires the connected state." It never says when to prefer this over get_script_source, list_scripts, or semantic_search, so the alternative-selection guidance is incomplete.

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