Skip to main content
Glama

Semantic Search

search_semantic
Read-onlyIdempotent

Semantic search — match by meaning, not exact words.

Uses vector similarity (cosine distance) over text_pali embedded with a multilingual MiniLM model.

🤔 In most cases you should use search_hybrid instead — it combines this semantic search with keyword search and ranks better. Use this tool only when you need:

  • Pure semantic results (no keyword influence)

  • Fine-grained threshold tuning (hybrid uses RRF which is harder to tune)

  • To debug what semantic alone picks up vs keyword

⚠️ Known limitations:

  • The index is Pāli only (English/Thai queries pass through the multilingual embedding but the model isn't tuned on Pāli)

  • English queries usually embed better than Thai (model is EN-primary)

  • For specific Pāli terms (appamāda, dukkha), exact match is better — use search_by_keyword instead

  • Pāli stock phrases recur in many suttas → similarity scores cluster; read the top 10, don't trust rank 1 alone

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNoMaximum results (default: 5, max: 20).
queryYesQuery text (English works best, then Pāli, Thai is weakest).
languageNoOutput language — "pali", "thai", "english", or "all" (Thai disabled → null).pali
thresholdNoMaximum cosine distance (smaller = stricter match). Default 0.7; lower to 0.5 for tighter matches, raise to 0.9 for broader.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

TDQS

A4.6/5.0
Behavior5/5

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

Annotations already declare readOnlyHint, idempotentHint, destructiveHint false. The description adds valuable behavioral context: the index is Pāli-only, English queries embed better than Thai, similarity scores cluster due to stock phrases, and users should read the top 10 rather than trust rank 1. This goes beyond the structured annotations and discloses limitations honestly.

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 description is well-structured with a clear opening statement, a usage section with bullets, and a limitations list. It is longer than minimal, but each sentence contributes useful information; the scannable formatting keeps it efficient.

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?

With an output schema present and annotations covering safety, the description fully addresses purpose, alternatives, limitations, and operational advice. There are no significant gaps in understanding when and how to invoke this tool.

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?

Schema coverage is 100%, and each parameter (query, language, threshold, limit) already has a descriptive comment in the schema. The description reinforces threshold tuning and language effectiveness, but it does not add new parameter-level meaning beyond what the schema provides; baseline 3 is appropriate.

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 clearly states the tool performs semantic search by meaning rather than exact words, and specifies vector similarity over text_pali with a multilingual MiniLM model. It distinguishes itself from siblings by explicitly naming search_hybrid and search_by_keyword as alternatives.

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?

The description gives explicit guidance: 'In most cases you should use search_hybrid instead' and enumerates exact conditions for using this tool (pure semantic results, fine-grained threshold tuning, debugging). It also notes when search_by_keyword is preferable for specific Pāli terms, providing clear exclusions.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

TDQS

A4.7/5.0
Disambiguation5/5

Each tool has a clearly distinct purpose. Search tools are differentiated by strategy (keyword, hybrid, semantic, exhaustive). Reading tools separate content retrieval, comparison, and viewer rendering. Parsing and definition tools have complementary roles. No overlapping functionality.

Naming Consistency5/5

All tools follow a consistent verb_noun pattern in snake_case, e.g., compare_translations, get_sutta, list_editions, search_by_keyword. The only slight deviation is open_sutta_viewer using 'open' instead of 'view', but it still fits the pattern.

Tool Count5/5

12 tools is well within the ideal range for a domain-specific server. Each tool addresses a distinct need: retrieval, search, parsing, dictionary, citation, structure overview, and comparison. No bloat or thinness.

Completeness5/5

The tool surface covers the full lifecycle for a read-only Pāli canon server: fetching content, searching (multiple modes), viewing with translations, comparing translations, parsing words, looking up definitions, listing editions and structure, and generating citations. There are no obvious gaps for the intended use case.

Resources