Skip to main content
Glama

grep_scripts

Read-only

Search all script sources in a place for Lua patterns and return matching lines as path:line:text, helping you locate definitions or usages before editing.

Instructions

Search the Source of every script in the place and return matching lines as path:line: text. Read-only; stops at 500 matches. Use it to find where something is defined or used before editing. To find instances by name use search_objects; to replace text everywhere use find_and_replace_in_scripts.

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": {
      "pattern": "<pattern>"
    },
    "name": "grep_scripts"
  }
}

Input Schema

NameRequiredDescriptionDefault
placeNoTarget place (PlaceId or project name). Defaults to the bound/sole connected place.
patternYesLua pattern (not a regex): magic characters ( ) . % + - * ? [ ^ $ need a % escape, e.g. "game%.Players".
ignoreCaseNoMatch regardless of case. Default false.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv0.1.1
    • addedInput schema / properties / ignoreCase / description
      Added value: +"Match regardless of case. Default false."
    • addedInput schema / properties / pattern / description
      Added value: +"Lua pattern (not a regex): magic characters ( ) . % + - * ? [ ^ $ need a % escape, e.g. \"game%.Players\"."
  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 readOnlyHint=true and openWorldHint=false, and the description adds a real behavioral fact not present there: results stop at 500 matches, and each hit is formatted as path:line: text. It does not say whether truncation is signaled or how to narrow past the cap, which keeps it short of a 5.

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?

Three short sentences: what it does, its limits, then routing to alternatives. The 500-match cap is placed immediately after the core behavior where it matters most.

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 read-only text search with fully documented params and no output schema, the definition covers purpose, output format, and limits adequately. The one loose end is what happens when the 500-match cap is hit and whether the caller can detect truncation.

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 all three parameters are already documented, including the Lua-pattern escaping rule which is the main gotcha. The description adds nothing parameter-specific beyond implying the search spans the target place; baseline 3 applies.

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 and resource ("Search the Source of every script in the place") and even specifies the return shape as path:line: text. An agent can immediately distinguish it from search_objects (name-based) and find_and_replace_in_scripts (mutation).

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

Usage Guidelines5/5

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

Gives an explicit use case ("find where something is defined or used before editing") and names two alternatives with the condition that selects each. Nothing about routing is left to inference.

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