Skip to main content
Glama

search_scripts

Search cached script sources for a text pattern to find matching locations, then set breakpoints at specific lines and columns.

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).
Behavior4/5

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

Describes side effects as none and read-only query. Mentions special commands like @source and debug in parameter description. Could be improved by noting potential performance impact on large caches, but overall provides good transparency.

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?

Efficiently structured with main action first, then side effects, prerequisites, return format, usage advice, and alternatives. Every sentence serves a purpose, no redundancy.

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?

Despite no output schema, describes return format as JSON array with fields. Covers prerequisites, side effects, and special command behaviors. Complete for a simple search tool with one parameter.

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%, but description adds value by explaining special commands (@source, debug), constraints (empty string returns script count), and default behavior. Goes beyond schema requirements.

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?

Clearly states the tool searches cached script sources for a text pattern and returns line/column locations. Distinguishes itself from siblings by mentioning alternatives like set_breakpoint and evaluate_js.

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?

Explicitly states to use this tool before setting breakpoints and lists alternatives (set_breakpoint for direct breakpoint placement, evaluate_js for runtime code discovery). Also notes prerequisite that scripts must be parsed and cached.

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