Skip to main content
Glama

rag_query

Perform hybrid semantic and keyword search across your notes, docs, commits, and source code. Get top-K chunks with path:line citations, scoped to your current repo.

Instructions

Hybrid semantic + BM25 search over the user's configured corpus: notes, docs, repo docs + README + CHANGELOG, recent git commits, session transcripts, and source code (TS/JS/Python/Shell) from the configured repos. Returns top-K chunks with path:line + symbol + repo citations. Auto-scopes to the current repo when cwd is inside one — pass scope_repos=['all'] to disable. Use instead of grep for fuzzy or cross-file recall.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
cwdNoworking dir to drive auto-scoping (defaults to server cwd)
topNo
queryYes
scope_reposNoconfigured repo names, or pass ['all'] to disable cwd auto-scoping
scope_typesNosource types: the labels from sources.yaml plus built-ins changelog, repo-docs, repo-readme, spec, roadmap, code, workstation-code, commit, session
Behavior4/5

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

With no annotations, the description carries the burden. It discloses hybrid search, auto-scoping based on cwd, and result format (path:line + symbol + repo citations). It implies a read-only operation but does not explicitly state it, nor does it mention side effects or permissions. Still, the provided behavior detail goes beyond a minimal description.

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 concise sentences that are front-loaded with the core action and followed by scoping/usage details. Every phrase adds value, with no redundant fluff. Well-structured for an LLM to quickly grasp.

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

Completeness4/5

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

Given the tool's complexity (5 params, no output schema, no annotations), the description covers the search scope, result format, scoping behavior, and an alternative use case. It is complete enough for an agent to invoke the tool correctly, though it omits explicit read-only confirmation and any potential rate limits.

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 60%, and the description adds meaningful semantics for scope_repos (auto-scoping and disabling with ['all']) and references scope_types from sources.yaml. It also explains cwd drives auto-scoping. However, query and top are left to the schema without additional context, so it does not fully compensate for all parameters.

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?

The description clearly states it performs hybrid semantic + BM25 search over a specific corpus (notes, docs, repo docs, commits, transcripts, code) and returns top-K chunks with citations. It uses a specific verb ('search') and resource ('configured corpus'), but does not explicitly contrast with sibling search_knowledge. However, it differentiates from grep, giving some distinction.

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?

It explicitly says 'Use instead of grep for fuzzy or cross-file recall,' providing an alternative use case. It also explains auto-scoping behavior and how to disable it with scope_repos=['all']. However, it does not mention when to prefer search_knowledge, leaving a minor gap.

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/LucasSantana-Dev/shelfmark'

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