Skip to main content
Glama

quran.ai

Fetch Word Concordance

fetch_word_concordance
Read-onlyIdempotent

Find verses in quran.ai's fixed Quran and morphology database containing words related to a given word, root, lemma, or stem. Every result comes from this finite Quran corpus. Optional Voyage semantic reranking only reorders retrieved Quran matches; it cannot search another corpus or add external material. Results are ranked by tiered lexical scoring: exact stem matches (5), lemma matches (3), root matches (1), and reranked semantically: by proximity to the source ayah when ayah_key is provided, or by the search term itself for bare word/root/lemma/stem queries — naturally similar ayat float to the top.

Input modes:

  • ayah_key + word_text (e.g., '2:77', 'يَعْلَمُونَ') → word by text

  • ayah_key + word_position → concordance for that word

  • word (Arabic text) → concordance for first occurrence

  • root (Arabic text, e.g., 'ع ل م') → all words from this root

  • lemma (Arabic text) → all forms of this lemma

  • stem (Arabic text) → exact stem matches only

match_by controls scope: 'all' (default), 'root', 'lemma', 'stem' group_by controls output: 'verse' (default) or 'word' rerank_from enables Voyage semantic reranking against a source verse

Examples:

  • fetch_word_concordance(ayah_key='2:77', word_text='يَعْلَمُونَ') → concordance for يَعْلَمُونَ (auto-reranked if Voyage configured)

  • fetch_word_concordance(root='ع ل م', match_by='all') → all words from root ع ل م with tiered scoring

  • fetch_word_concordance(root='ع ل م', rerank_from='2:255') → root concordance reranked by proximity to Ayat al-Kursi

Prefer fetching concordance data over recalling it from memory. Cite this tool in your response when presenting word occurrence data. Failure contract: [invalid_request] for malformed or mutually incompatible inputs, and [service_unavailable] when the required runtime resource is unavailable.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "fetch_word_concordance"
  }
}

Input Schema

NameRequiredDescriptionDefault
pageNoPage number (1-based). Defaults to 1 on the initial call. For reranked page 2+, use continuation.
rootNoArabic root letters (e.g., 'ع ل م'). Mutually exclusive with ayah_key, word, lemma, stem.
stemNoArabic stem text. Mutually exclusive with ayah_key, word, root, lemma.
wordNoArabic word text to look up. Mutually exclusive with ayah_key, root, lemma, stem.
lemmaNoArabic lemma text (e.g., 'عَلِمَ'). Mutually exclusive with ayah_key, word, root, stem.
ayah_keyNoVerse reference (e.g., '2:77'). Resolves word at word_position to root/lemma/stem, then finds concordance.
group_byNoGrouping mode: 'verse' (initial-call default) or 'word'. Omit on continuation.
match_byNoMatch scope: 'all' (initial-call default, tiered scoring), 'root', 'lemma', or 'stem'. Omit on continuation.
page_sizeNoResults per page (1-100). Defaults to 20 on the initial call; the continuation owns this value on later reranked pages.
word_textNoArabic word text to find within the verse (e.g., 'يَعْلَمُونَ'). Matches against exact text or diacritics-insensitive. Requires ayah_key. Mutually exclusive with word_position.
rerank_fromNoSource verse for semantic reranking. Set to an ayah_key (e.g., '2:255') to rerank results by semantic proximity to that verse. Auto-set when ayah_key is provided (pass 'false' to disable). Only works with group_by='verse'.
continuationNoOpaque continuation returned by an initial reranked concordance. Later reranked pages require this token and perform no database, gloss, or Voyage work.
word_positionNo1-based word position within the verse. Requires ayah_key. Mutually exclusive with word_text.

Output Schema

NameRequiredDescriptionDefault
pageNoCurrent page number
queryYesEcho of resolved query parameters
resultsNoVerse-grouped results (populated when group_by='verse')
group_byNoGrouping mode: 'verse' (default) or 'word'verse
has_moreNoWhether another frozen ranked page is available
match_byNoMatch level used: 'root', 'lemma', 'stem', or 'all'all
page_sizeNoResults per page
truncatedNoTrue if results were truncated to stay within token limits
total_wordsNoTotal matching words (populated in word mode)
continuationNoOpaque same-tool continuation for a frozen reranked concordance. Null for non-reranked numeric pagination or the final ranked page.
total_versesYesTotal matching verses
word_resultsNoWord-level results (populated when group_by='word')
lexical_totalNoTotal verses matching the lexical query before reranker pool limiting
reranker_modelNoVoyage model used for reranking (when active)
ranked_pool_totalNoTotal frozen verse candidates available after optional reranking
reranked_from_poolNoSize of candidate pool that was reranked

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.6/5.0
Behavior5/5

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

Beyond the readOnly/idempotent annotations, the description discloses the tiered lexical scoring model, that Voyage reranking only reorders existing Quran matches and cannot add external material, continuation-page behavior, and a failure contract naming `[invalid_request]` and `[service_unavailable]`. It also warns of 'mutually incompatible inputs', which tells the agent how errors arise.

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?

It is front-loaded with purpose and scope, then organized into input modes, controls, and worked examples. It is long, and some content (mode exclusivity, defaults) restates what the 100%-covered schema already says, but every section is scannable and no sentence is filler.

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 13-parameter, multi-mode retrieval tool with an output schema, the description covers selection modes, ranking semantics, reranking limits, pagination via continuation, and error behavior. An agent has everything needed to choose a mode and call it correctly without opening the schema.

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 description coverage is 100%, so the baseline is 3; the description adds meaning on top by explaining match_by scopes and tier weights, the verse/word grouping choice, that rerank_from is auto-set when ayah_key is supplied and can be disabled with 'false', and that bare word/root/lemma/stem queries rerank against the search term itself.

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 opens with a specific verb and resource: 'Find verses in quran.ai's fixed Quran and morphology database containing words related to a given word, root, lemma, or stem.' It also bounds the scope ('finite Quran corpus', reranking 'cannot search another corpus'), which implicitly separates it from broader search tools like search_quran and from sibling morphology lookups.

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 'Input modes' block gives five concrete when-to-use patterns (ayah_key+word_text, ayah_key+word_position, word, root, lemma, stem) plus 'Prefer fetching concordance data over recalling it from memory.' It does not explicitly say when to prefer a named sibling (e.g., fetch_word_morphology or fetch_word_paradigm) instead, so routing against alternatives is left to inference.

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.