Skip to main content
Glama

search_scripts

Search cached script sources for a text pattern to find exact line and column locations, enabling precise breakpoint placement before debugging.

Instructions

Searches all cached script sources for a text pattern and returns matching locations (line and column numbers). Side effects: none (read-only query). Prerequisites: scripts must have been parsed and cached by the debugger. Returns: JSON array of matches with script ID, line/column numbers, and line preview. Use this to locate code before setting breakpoints. Alternatives: 'set_breakpoint' for direct breakpoint placement, 'evaluate_js' for runtime code discovery.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesText pattern or special command to search for. Constraints: non-empty string (empty string returns cached script count). Interactions: '@source' returns first 1000 chars of each script; 'debug' returns script lengths and errors. Defaults to: None (required).
tab_idNoThe Tab ID of the target tab. Omit to use the active tab.
instance_idNoChrome instance id from open_instance/list_instances. Omit for the default instance.
Behavior4/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It explicitly states 'Side effects: none (read-only query)' and discloses prerequisites and return format. While it doesn't cover auth or rate limits, for a read-only search tool these are less critical; the description covers the key behavioral traits sufficiently.

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?

The description is well-structured with clear sections (action, side effects, prerequisites, return, usage, alternatives). Each sentence adds value with no redundancy. It front-loads the primary action and logically groups related information, making it easy for an agent to parse.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The description covers all essential context for an agent to correctly invoke the tool: what it does, prerequisites, side effects, return format, and alternatives. Since there is no output schema, the return format explanation is critical and provided. Nothing an agent needs to call it correctly is missing.

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 the schema already documents all three parameters in detail. The description does not add extra parameter-level semantics beyond what the schema provides; it focuses on usage context, which is not part of parameter semantics. Baseline of 3 is appropriate.

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?

The description clearly states the verb ('searches'), the resource ('all cached script sources'), and the result ('matching locations with line and column numbers'). It also distinguishes itself from siblings by naming alternatives and placement guidance, leaving no ambiguity about what the tool does.

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?

Provides explicit when-to-use guidance ('Use this to locate code before setting breakpoints'), clearly states prerequisites ('scripts must have been parsed and cached'), and names two specific alternatives with conditions for selecting them. This fully routes the agent to the correct tool selection.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/raultov/chrome-debug-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server