Skip to main content
Glama

search_sections

Read-only

Locate relevant documentation sections through hybrid lexical-semantic search, returning summaries so agents can pinpoint answers without consuming full files.

Instructions

Search sections by relevance. Hybrid (BM25 lexical + semantic embedding) fusion when the index was built with use_embeddings=true; falls back to lexical-only otherwise. Returns summaries only — use get_section for full content.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
repoNoRepository identifier
roleNoOptional v1.19+ role filter. Values: concept, tutorial, how_to, reference, api, example, troubleshooting, changelog, faq, other.
tagsNov1.45+ — restrict to sections whose Section.tags contains every listed tag (AND semantics). Case-insensitive.
queryYesSearch query
rolesNov1.52+ — restrict to sections whose metadata.role matches ANY listed role (positive OR-match). Differs from singular `role` (which is exact). Case-insensitive.
dedupeNov1.34+ — collapse near-duplicate sections to a single representative based on the v1.34 cluster sidecar. _meta.deduped reports suppressed member ids.
fieldsNov1.121+ — explicit per-row field whitelist (e.g. ['id','title','doc_path','_score']). Wins over compact. `id` is always returned.
compactNov1.121+ — drop per-row fields a caller can't act on (repo, parent_id, children, byte_start/byte_end, content_hash, inline_code, references; plus empty tags and a summary identical to the title). Per-row _freshness is kept only when it isn't 'fresh'. ~40% fewer bytes per result. Default off — the full row is unchanged.
profileNov1.32+ — task-aware retrieval profile. install/debug/explain/api each boost a small role set so matching sections rank ahead. Explicit role= overrides.
doc_pathNoOptional: limit search to a specific document
semanticNonull/omit (auto — hybrid when embeddings exist), true (force hybrid), false (force lexical-only). Zero performance cost when the index has no embeddings.
max_levelNov1.44+ — restrict to sections at heading level <= this. Inclusive. Stacks with min_level.
min_levelNov1.44+ — restrict to sections at heading level >= this. Inclusive.
path_globNov1.36+ — fnmatch glob restricting results to matching doc_paths (e.g. 'api/**/*.md'). Stacks with doc_path.
repo_groupNov1.26+ — fan out across the named repo group (defined via define_repo_group). When set, the per-repo `repo` arg is ignored; results from each member repo are fused via RRF.
max_resultsNoMaximum number of results to return
exclude_tagsNov1.51+ — drop sections whose Section.tags contains ANY listed tag (negative ANY-match). Stacks with `tags`. Case-insensitive.
exclude_rolesNov1.52+ — drop sections whose metadata.role matches ANY listed role. Case-insensitive. Stacks with `roles` (the result must match an included role and not match any excluded role).
semantic_onlyNoSkip lexical scoring; rank purely by embedding cosine similarity.
snippet_bytesNov1.121+ — inline the first N bytes of each section's body as `snippet` so a confident top hit needs no get_section round-trip. UTF-8 safe (never splits a codepoint); `snippet_truncated: true` marks a cut section. 0 = off.
max_byte_lengthNov1.53+ — drop sections longer than this many bytes. Use to filter out oversized dumps. Stacks with min_byte_length.
min_byte_lengthNov1.53+ — drop sections shorter than this many bytes (byte_end - byte_start). Use to filter out stubs / one-liners.
min_quotabilityNov1.42+ — drop results whose v1.33 _quotability score is below this threshold (0–1). Stacks with min_answerability.
semantic_weightNoWeight (0.0–1.0) of semantic component in hybrid fusion. Lexical gets 1 - weight. Omit to use this repo's tuned weight, else 0.5; a value you pass is always honoured. _meta.semantic_weight and _meta.semantic_weight_source report which applied. Paraphrased queries usually want 0.7–0.95: RRF (k=60) structurally penalises an answer that is strong in only one channel, so 0.5 can rank below a section that is mediocre in both.
min_answerabilityNov1.42+ — drop results whose v1.33 _answerability score is below this threshold (0–1). _meta.quality_filtered reports drop count.
Behavior4/5

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

The description adds behavioral context beyond the readOnlyHint annotation by explaining the hybrid fusion logic (BM25 + semantic embedding) and the fallback to lexical-only. It also discloses that only summaries are returned. This is valuable transparency for a search tool, though it doesn't cover pagination or result ordering nuances.

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?

The description is two sentences, front-loaded with the core purpose, and every clause adds meaningful information (hybrid search, fallback, summary-only output, pointer to get_section). No fluff or redundancy.

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?

For a tool with 25 parameters and no output schema, the description provides essential behavioral context and points to related tools. It doesn't list return fields or pagination, but the schema includes rich parameter descriptions and the 'Returns summaries only' line gives a clear boundary. It could be more detailed on result structure, but the core usage is well-covered.

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

Parameters3/5

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

The schema covers 100% of parameters with detailed descriptions, so the baseline is 3. The tool description itself does not add any parameter-specific context; it only mentions the overall search semantics. The schema descriptions are already comprehensive, so the description is not required to compensate.

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?

The description uses a specific verb 'Search' with resource 'sections' and clearly indicates the search is by relevance. It distinguishes from siblings like get_section by stating 'Returns summaries only — use get_section for full content.' This makes the tool's purpose unambiguous.

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?

The description gives clear context on when the tool is appropriate: searching sections by relevance, with a fallback behavior based on index configuration. It explicitly points to get_section for full content, serving as an alternative. However, it does not discuss when to prefer search_sections over similar siblings like search_titles or get_sections.

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/jgravelle/jdocmunch-mcp'

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