Skip to main content
Glama

Search (passages)

search
Read-only

Search the web and return only the passages that answer your query rather than full pages, using keyword and semantic matching to extract the relevant excerpts.

Instructions

Search the web and return only the passages that answer the query, not whole pages: usually about a tenth of the text of rag_search_ddgs. Use this first.

Tiers, cheapest first:

  1. Search, then keep the top_pages results whose title/snippet match best.

  2. Fetch those pages, split them into ~600-char passages, keyword-match them (BM25) against the query plus keywords.

  3. Only if that leaves too many candidates, or matches nothing (a paraphrase), the local embedder ranks them by meaning. If nothing matched the keywords and the client can show questions, the user is asked whether they want the full pages instead.

Input Schema

NameRequiredDescriptionDefault
queryYesThe question or topic, in natural language.
backendNoSearch backend, same names as deep_research. Default "auto".auto
keywordsNoTerms a good answer would contain, including synonyms and exact phrases. Example for "how do I make postgres faster": ["index", "EXPLAIN ANALYZE", "query planner", "vacuum"]. Strongly improves results.
top_pagesNoPages to fetch and split. Default 5.
num_resultsNoSearch results to consider. Default 10.
max_passagesNoPassages to return. Default 8.

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv1.1.1

TDQS

A4.8/5.0
Behavior5/5

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

Annotations only declare readOnlyHint and openWorldHint, but the description goes much further: it discloses the multi-tier ranking pipeline, that a local embedder may run, and that the client may prompt the user to switch to full pages. That is exactly the non-obvious behavioral context an agent needs before paying the cost of this call.

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?

The lead sentence is front-loaded and the tier list is scannable, with every tier conveying the cost tradeoff. It is on the long side for a search tool, and the closing sentence about the client asking about questions is a bit convoluted, but nothing is pure filler.

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?

An output schema exists so return values need no explanation, and the description covers the remaining gaps: cost relative to siblings, fallback behavior, and where the `keywords` hint pays off. Nothing an agent needs to call this correctly is missing.

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 3 is the baseline, but the description adds real meaning by tying parameters into the pipeline: `keywords` is matched via BM25 alongside the query, `top_pages` bounds stage 1, and the passage mechanics explain the ~600-char split. It stops short of explaining `backend` or `num_results` beyond the schema.

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 web') plus a precise output scope ('return only the passages that answer the query, not whole pages'), and explicitly contrasts itself with sibling rag_search_ddgs ('about a tenth of the text'). An agent can distinguish it from the rag_search_* siblings without opening a schema.

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 says 'Use this first', names rag_search_ddgs as the heavier alternative, and lays out the escalation order (cheap title/snippet filter -> fetch+BM25 -> embedder fallback). The condition that triggers the fallback path ('matches nothing, a paraphrase') is stated outright.

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