Skip to main content
Glama

Keyword Search

search_by_keyword
Read-onlyIdempotent

Keyword search across the Pāli Tipiṭaka (trigram word-similarity).

Searches the configured enabled language(s) on the server. Filterable by pitaka and translation edition.

💡 Hints for the AI client: The system's canonical reference is Romanised Pāli (from SuttaCentral). If the user asks in a disabled or unsupported language, translate the keyword to Romanised Pāli (preferred) or English before calling this tool — e.g. "suffering" → "dukkha", "mindfulness of breathing" → "ānāpānassati". See the server instructions for the enabled language set.

✅ Diacritics do not matter. anapanassati and ānāpānassati return the same thing; so do nibbana and nibbāna. Write the macrons if you know them, guess without them if you don't — neither costs you results.

⚠️ A common Pāli noun is a poor query. samudda (sea) matches ~700 segments and the top of that list is mostly section headings, not the passage that teaches anything. Two things to do instead:

  • Search the rarest distinctive noun in the passage, not its most obvious one. For the simile of the blind turtle, turtle/kacchapa gets there; ocean/samudda does not, in either language.

  • Prefer English, or raise the limit. turtle returns SN 56.47 and SN 56.48 inside the default window; kacchapa matches them too but ranks them past 30, so you need limit=50 to see them.

  • A word inside a compound may be out of reach entirely: samudda scores 0.50 against mahāsamudde (compounded and inflected), under the 0.6 cutoff, so SN 56.47 is not ranked low — it is excluded. Trying more spellings will not recover it; search a different word instead.

🔍 Pick the right search tool for the question shape:

  • Term lookup (exact word appearances) — e.g. "occurrences of ānāpānassati": this tool is best (trigram nails the exact word).

  • Concept search ("discourses about X") — e.g. "discourses about mindfulness of breathing": use search_hybrid instead. Canonical Pāli has two quirks that hurt keyword search for concepts: • Section headings (Ānāpānapabba) often use a different word than the teaching body, which uses verb forms (assasati, passasati, dīghaṁ, rassaṁ). E.g. DN22's Ānāpānapabba has 16 segments but the word ānāpāna appears in only 2 (header + footer) — the actual teaching segments won't match. • Stock phrases (e.g. So satova assasati, satova passasati) recur in 10+ suttas, so a keyword query ranks broadly and won't pinpoint the canonical reference.

  • General keyword survey — set limit≥30 and filter client-side, or call multiple related forms (root verb + noun + compound).

📊 Reading the two scores. word_similarity is the primary sort key: it scores your query against the best-matching span inside the line, 0 to 1, and a row appears at all only if it clears the 0.6 cutoff. similarity scores it against the whole line, so it falls as the line grows longer. Both measure resemblance of letters — neither measures doctrinal importance.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "keyword": "<keyword>"
    },
    "name": "search_by_keyword"
  }
}

Input Schema

NameRequiredDescriptionDefault
limitNoMaximum results (default: 10, max: 50).
pitakaNoFilter by pitaka — "vinaya", "sutta", "abhidhamma" or None (all). ✅ v1.1+: all three pitakas at parity with SuttaCentral bilara — see list_structure for live counts.
editionNoThai translation edition — "dhiranandi", "jayasaro", "mbu", "royal" or None. Only used when language="thai" and Thai is enabled on the server.
keywordYesThe word/phrase to search for.
languageNoSearch language — must be in the server's ENABLED_LANGUAGES (default: "pali"). Disabled languages return an error.pali

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changed
    • changedInput schema / properties / edition / anyOf
      Previous value: -[
      -  {
      -    "type": "string"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]New value: +[
      +  {
      +    "enum": [
      +      "dhiranandi",
      +      "jayasaro",
      +      "mbu",
      +      "royal"
      +    ],
      +    "type": "string"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
    • addedInput schema / properties / language / enum
      Added value: +[
      +  "pali",
      +  "english",
      +  "thai"
      +]
    • changedInput schema / properties / pitaka / anyOf
      Previous value: -[
      -  {
      -    "type": "string"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]New value: +[
      +  {
      +    "enum": [
      +      "vinaya",
      +      "sutta",
      +      "abhidhamma"
      +    ],
      +    "type": "string"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
  2. Changed5 schema fields changed
    • changedInput schema / properties / edition / description
      Previous value: -"ฉบับแปลภาษาไทย — \"dhiranandi\", \"jayasaro\", \"mbu\", \"royal\" หรือ None\n      (ใช้เฉพาะเมื่อ language=\"thai\" และ Thai เปิดอยู่)"New value: +"Thai translation edition — \"dhiranandi\", \"jayasaro\", \"mbu\",\n      \"royal\" or None. Only used when language=\"thai\" and Thai is\n      enabled on the server."
    • changedInput schema / properties / keyword / description
      Previous value: -"คำที่ต้องการค้นหา"New value: +"The word/phrase to search for."
    • changedInput schema / properties / language / description
      Previous value: -"ภาษาที่ค้นหา — ต้องอยู่ใน ENABLED_LANGUAGES ของเซิร์ฟเวอร์\n      (default: \"pali\"). ภาษาที่ปิดอยู่จะ return error."New value: +"Search language — must be in the server's ENABLED_LANGUAGES\n      (default: \"pali\"). Disabled languages return an error."
    • changedInput schema / properties / limit / description
      Previous value: -"จำนวนผลลัพธ์สูงสุด (default: 10, max: 50)"New value: +"Maximum results (default: 10, max: 50)."
    • changedInput schema / properties / pitaka / description
      Previous value: -"กรองตามปิฎก — \"vinaya\", \"sutta\", \"abhidhamma\" หรือ None (ค้นทั้งหมด)\n    ✅ v1.1+: ทั้ง 3 ปิฎกครบ (Sutta + Vinaya + Abhidhamma) เทียบเท่า\n    SuttaCentral bilara — ดู list_structure ตัวเลขสด"New value: +"Filter by pitaka — \"vinaya\", \"sutta\", \"abhidhamma\" or None\n    (all). ✅ v1.1+: all three pitakas at parity with SuttaCentral\n    bilara — see list_structure for live counts."
  3. First observed

TDQS

A4.8/5.0
Behavior5/5

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

Annotations cover the safety profile (readOnly, idempotent, no destruction), and the description adds substantial non-obvious behavior: the 0.6 similarity cutoff that silently excludes rows, diacritic insensitivity, compound words scoring below cutoff and being unreachable, and the difference between word_similarity and whole-line similarity. This is real operational context not present in structured fields.

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?

Purpose is front-loaded in the first sentence and the rest is organized under clear headers with actionable content rather than filler. It is long, and the two quirk sections about concept search partially overlap, but every block earns its place for a tool with real selection ambiguity.

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?

For a keyword-search tool with a full input schema, an output schema, and complete annotations, the description supplies everything else an agent needs: selection criteria, language/diacritic handling, scoring interpretation, and known failure modes. Nothing required to invoke it correctly is missing.

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 100%, so the baseline is 3, but the description adds meaning beyond the schema: it explains that the default limit window can hide valid hits and recommends limit=50, and gives guidance on translating keywords into Romanised Pāli or English before setting language. These are genuinely useful semantic additions.

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 first line states a specific verb (search), resource (Pāli Tipiṭaka) and mechanism (trigram word-similarity), and the description actively contrasts itself with sibling tools such as search_hybrid. An agent can distinguish this from search_hybrid/search_semantic without opening any schema.

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?

It gives explicit when-to-use (term lookup / exact word appearances) and when-not-to-use (concept search → use search_hybrid), with concrete worked examples and the underlying reason. It also names the alternative tools by name, so routing is unambiguous.

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.

Resources