Skip to main content
Glama

quran.ai

Fetch Word Morphology

fetch_word_morphology
Read-onlyIdempotent

Fetch word-level morphological analysis for Quranic text. Returns root, lemma, stem, grammatical features, morpheme segments, and frequency data (verbatim occurrence count, root occurrence count, lemma occurrence count) for each word.

For a word or phrase question, fetch morphology only for the words being discussed. Use ayah_key with exact word_text, or word_position verified from morphology or concordance output; never count positions yourself. Fetch all words only for whole-ayah grammar. Batch independent word requests once their inputs are verified, and inspect every result.

Input modes:

  • ayah_key (e.g., '2:77') → all words in the verse

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

  • ayah_key + word_position (e.g., '2:77', 2) → specific word by position

  • word (Arabic text, e.g., 'يَعْلَمُونَ') → first occurrence in Quran

Examples:

  • fetch_word_morphology(ayah_key='2:77', word_text='يَعْلَمُونَ') → morphology of يَعْلَمُونَ

  • fetch_word_morphology(ayah_key='2:77', word_position=2) → same word by position

  • fetch_word_morphology(ayah_key='1:1') → all 4 words of Bismillah

  • fetch_word_morphology(word='يَعْلَمُونَ') → first occurrence + other_occurrences_count

Prefer fetching morphology data over recalling it from memory. Cite this tool in your response when presenting morphological analysis. 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_morphology"
  }
}

Input Schema

NameRequiredDescriptionDefault
wordNoArabic word text to look up (e.g., 'يَعْلَمُونَ'). Returns first occurrence. Mutually exclusive with ayah_key.
ayah_keyNoVerse reference (e.g., '2:77'). Returns all words in the verse, or a specific word if word_position is also provided.
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.
word_positionNo1-based word position within the verse. Requires ayah_key. Mutually exclusive with word_text.

Output Schema

NameRequiredDescriptionDefault
wordsYesMorphological entries per word
ayah_keyYesVerse reference (e.g., '2:77')
input_modeYesHow input was resolved: 'ayah_key' or 'word_text'
other_occurrences_countNoFor word_text input: total occurrences minus this one

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.3/5.0
Behavior4/5

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

Annotations already declare readOnly, idempotent, non-destructive, and closed-world behavior, so the description correctly spends its words elsewhere: input mutual exclusivity ('word' vs 'ayah_key', 'word_text' vs 'word_position') and a failure contract naming `[invalid_request]` and `[service_unavailable]`. It adds no performance or rate-limit context, but covers the failure modes an agent needs.

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?

Front-loaded purpose, then rules, then a clearly labeled 'Input modes' block and examples. Slightly redundant: the four examples largely restate the four input modes already bulleted above, which could be trimmed without losing information.

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 4-parameter lookup tool with an output schema, this is complete: purpose, mode combinations, verification rules, failure contract, and a steer to prefer fetched data over memory. Nothing needed to call 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 description coverage is 100%, so baseline is 3; the description earns an extra point by explaining how parameters combine into modes (ayah_key alone → all words; ayah_key+word_text → specific word; ayah_key+word_position → by position; word alone → first Quranic occurrence) and by showing worked examples with expected results.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource ('Fetch word-level morphological analysis for Quranic text') and enumerates exactly what is returned: root, lemma, stem, grammatical features, morpheme segments, and three frequency counts. It does not explicitly contrast itself with morphological neighbors like fetch_word_paradigm, so differentiation from siblings is inferential rather than stated.

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?

Explicit when-to guidance is given: 'For a word or phrase question, fetch morphology only for the words being discussed' versus 'Fetch all words only for whole-ayah grammar.' It also cautions against counting word positions manually and recommends verifying positions from morphology or concordance output, plus batching independent requests and inspecting results.

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.