Skip to main content
Glama

Hybrid Search

search_hybrid
Read-onlyIdempotent

Find discourses about concepts by merging exact keyword matching with semantic search, catching suttas that discuss a topic using varied vocabulary.

Instructions

Hybrid search — combines keyword + semantic search via RRF.

Uses Reciprocal Rank Fusion (RRF) to merge exact-word results with meaning-based results. This is the recommended tool for "discourses about X" / concept queries, because the semantic side catches suttas that discuss a concept using different vocabulary (e.g. some mindfulness-of-breathing suttas use assasati/passasati/dīghaṁ instead of ānāpānassati).

💡 Hints for the AI client:

  • English queries usually work best (e.g. mindfulness of breathing) because the embedding model is multilingual but EN-primary.

  • Thai stop-word handling is weak. If a Thai query underperforms, the AI client should translate to Pāli/English first (see server instructions).

  • The default limit=5 is often too small for a topic survey — use limit=15-20 (max 20) for good coverage.

  • Ranking is by similarity, NOT canonical importance — locus classicus suttas (e.g. MN118, DN22) may rank below smaller suttas that happen to use the exact vocabulary. Treat results as a starting point, then call get_sutta for the canonical references.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNoMaximum results (default: 5, max: 20).
queryYesQuery text (Thai, Pāli, or English — English works best).
languageNoOutput language — "pali", "thai", "english", or "all".pali

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.9/5.0
Behavior5/5

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

Annotations already declare readOnly/idempotent, but the description adds substantial behavioral context: RRF merging, ranking by similarity vs. canonical importance, language-specific quirks, and limit behavior. This goes well beyond annotations with no contradiction.

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?

Well-structured with a front-loaded definition and clearly labeled hints for the AI client. Slight redundancy between the first two sentences, but every section earns its place given the tool's complexity.

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?

Given the output schema exists and the tool's moderate complexity, the description covers usage scenarios, language handling, ranking caveats, and next-step actions. It is complete for an agent to select and invoke the tool correctly.

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?

Although schema coverage is 100%, the description enriches parameter meaning: it advises increasing limit for topic surveys, notes English queries work best, and explains Thai stop-word weaknesses — all valuable guidance 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?

Description uses specific verb+resource: 'Hybrid search — combines keyword + semantic search via RRF.' It clearly distinguishes itself by being the recommended tool for concept queries, differentiating from keyword-only and semantic-only siblings.

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 states when to use (recommended for 'discourses about X' / concept queries), provides practical exclusions and alternatives (e.g., translate Thai queries, call get_sutta for canonical references), and gives tuning guidance like limit=15-20.

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