Fetch Word Concordance
fetch_word_concordanceFind 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
| Name | Required | Description | Default |
|---|---|---|---|
| page | No | Page number (1-based). Defaults to 1 on the initial call. For reranked page 2+, use continuation. | |
| root | No | Arabic root letters (e.g., 'ع ل م'). Mutually exclusive with ayah_key, word, lemma, stem. | |
| stem | No | Arabic stem text. Mutually exclusive with ayah_key, word, root, lemma. | |
| word | No | Arabic word text to look up. Mutually exclusive with ayah_key, root, lemma, stem. | |
| lemma | No | Arabic lemma text (e.g., 'عَلِمَ'). Mutually exclusive with ayah_key, word, root, stem. | |
| ayah_key | No | Verse reference (e.g., '2:77'). Resolves word at word_position to root/lemma/stem, then finds concordance. | |
| group_by | No | Grouping mode: 'verse' (initial-call default) or 'word'. Omit on continuation. | |
| match_by | No | Match scope: 'all' (initial-call default, tiered scoring), 'root', 'lemma', or 'stem'. Omit on continuation. | |
| page_size | No | Results per page (1-100). Defaults to 20 on the initial call; the continuation owns this value on later reranked pages. | |
| word_text | No | Arabic 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_from | No | Source 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'. | |
| continuation | No | Opaque continuation returned by an initial reranked concordance. Later reranked pages require this token and perform no database, gloss, or Voyage work. | |
| word_position | No | 1-based word position within the verse. Requires ayah_key. Mutually exclusive with word_text. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| page | No | Current page number | |
| query | Yes | Echo of resolved query parameters | |
| results | No | Verse-grouped results (populated when group_by='verse') | |
| group_by | No | Grouping mode: 'verse' (default) or 'word' | verse |
| has_more | No | Whether another frozen ranked page is available | |
| match_by | No | Match level used: 'root', 'lemma', 'stem', or 'all' | all |
| page_size | No | Results per page | |
| truncated | No | True if results were truncated to stay within token limits | |
| total_words | No | Total matching words (populated in word mode) | |
| continuation | No | Opaque same-tool continuation for a frozen reranked concordance. Null for non-reranked numeric pagination or the final ranked page. | |
| total_verses | Yes | Total matching verses | |
| word_results | No | Word-level results (populated when group_by='word') | |
| lexical_total | No | Total verses matching the lexical query before reranker pool limiting | |
| reranker_model | No | Voyage model used for reranking (when active) | |
| ranked_pool_total | No | Total frozen verse candidates available after optional reranking | |
| reranked_from_pool | No | Size of candidate pool that was reranked |