Skip to main content
Glama

scry_grep

Search file contents with full-text queries, filtering by doc kind, status, or path glob. Returns ranked matches with highlighted snippets.

Instructions

Full-text search over all indexed file bodies (scry__file_fts).

Complements scry_sql: use this when you want broad full-text search across file content, not just curated marker fields.

Returns one hit per file (highest BM25-ranked match).

Args: query: FTS5 query string — plain words, phrases ("foo bar"), boolean (foo AND bar, foo OR bar, NOT foo). Accepts standard FTS5 syntax. kind: Optional: filter to files whose associated doc has this kind (e.g. 'design', 'lesson', 'pattern'). Files without a doc marker are excluded when this filter is set. status: Optional: filter by doc status (e.g. 'active', 'draft'). Files without a doc marker are excluded when set. path_glob: Optional: GLOB pattern on file path, e.g. 'agent/design/' or '.py'. Applied before FTS. limit: Max number of results to return (default 20).

Returns JSON: { "hits": [ { "path": "agent/design/...", "doc_id": "design.foo~abcd1234" | null, "snippet": "...text with matches highlighted...", "score": 12.4, "match_count": 3 } ], "total_matches": 47, "query": "...", "filters_applied": { "kind": null, "status": null, "path_glob": null } }

Tips:

  • Combine with scry_sql: get doc IDs from scry_grep, then JOIN to scry__doc_tag or scry__doc for richer metadata.

  • Use path_glob to scope to a subtree: 'agent/design/*'

  • scry__file is populated during scry_surface; call that first if results are empty on a fresh DB.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
kindNo
limitNo
queryYes
statusNo
path_globNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior4/5

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

Describes return behavior (one hit per file, BM25-ranked), return JSON structure, and filter behavior. Lacks explicit statement about read-only nature, but overall transparent.

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?

Well-structured with intro, args, return format, and tips. Front-loaded purpose, every sentence adds value, no fluff.

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?

Covers purpose, usage, parameters (all 5 detailed), return JSON, and tips. No gaps given complexity and presence of output schema described.

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

Parameters5/5

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

Each parameter is thoroughly explained with syntax examples (query FTS5, kind filter, path_glob pattern, etc.), adding significant value beyond the bare 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?

Clearly states 'Full-text search over all indexed file bodies' with verb+resource. Distinguishes from sibling scry_sql by noting broader full-text search vs curated marker fields.

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 when you want broad full-text search across file content, not just curated marker fields.' Provides tips for combining with scry_sql and prerequisite scry_surface call.

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/prmichaelsen/scry'

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