Skip to main content
Glama

js.search_source

Read-only

Search all loaded browser scripts for a query and return file:line hits with excerpts, avoiding the need to pull entire bundles into context.

Instructions

Grep every loaded script in the browser and return file:line hits with excerpts. Use this instead of pulling bundles into 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": "js.search_source"
  }
}

Input Schema

NameRequiredDescriptionDefault
queryYes
typesNo
is_regexNo
max_filesNo
target_idNoTarget handle (tgt_*). Omit for the active page.
browser_idNoBrowser handle (br_*). Omit to use the only running browser, or auto-launch one.
ignore_caseNo
url_containsNo
context_linesNo
max_matches_per_fileNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

B3.4/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=true and openWorldHint=true, so safety is covered. The description adds useful scope (only scripts already loaded in the browser are searched) and the output format, but says nothing about match limits, truncation, or performance characteristics of scanning all scripts.

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 short sentences, front-loaded with the action and result, with the usage rule immediately after. Nothing is wasted or buried.

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

Completeness2/5

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

For a 10-parameter search tool with no output schema and thin schema coverage, the description does far too little: it never explains the filtering, regex, or limiting parameters that determine result quality. Only the return shape and scope are covered.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Ten parameters with only 20% schema description coverage, and the description mentions none of them. Regex mode, case sensitivity, type filters, url_contains, context_lines, and the max_files/max_matches_per_file caps are all left for the agent to infer from bare property names.

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 (grep) and resource (every loaded script in the browser) plus the return shape (file:line hits with excerpts). It implicitly distinguishes itself from bundle-pulling siblings like js.get_source, though it never names an alternative tool explicitly.

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?

"Use this instead of pulling bundles into context" gives a clear selection rule against the obvious alternative (fetching full source). It lacks explicit when-not conditions, such as when a targeted single-script read is preferable, but the core routing guidance is present.

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

Deploy Server

Other Tools