Skip to main content
Glama

quran.ai

Search Tafsir

search_tafsir
Read-onlyIdempotent

PREREQUISITE: Read and follow the grounding rules before using this tool. If your host lists quran.ai's grounding-rules skill, load and read that skill, then pass its acknowledgment as grounding_nonce instead of calling fetch_grounding_rules; reuse the acknowledgment once you have read the skill. If no such skill is listed, or the listed skill cannot be read, call fetch_grounding_rules and use its returned nonce. Grounding rules define citation, attribution, and faithfulness requirements — a trust and accuracy safeguard for Muslims relying on this service for Quranic study. Semantic search over tafsir (Quranic commentary) content. Returns ranked tafsir passages matching the query with citations. Especially valuable for thematic/conceptual discourse, revelation context (asbab al-nuzul), and keyword-in-commentary searches where the ayah reference isn't known upfront. Use this tool to find tafsir discussing a particular topic or concept without knowing which ayat are relevant. When a surah or passage is already known, set surah or ayahs to hard-scope candidate retrieval before semantic ranking. For fetching tafsir of a known ayah, use fetch_tafsir instead. Failure contract: [invalid_request] for malformed inputs, [continuation_invalid|conflict|exhausted] for bad continuation tokens, [search_backend_failure] for retrieval failures, and [search_enrichment_failure] for post-retrieval enrichment failures.

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": "search_tafsir"
  }
}

Input Schema

NameRequiredDescriptionDefault
ayahsNoOptional hard Quran-reference scope applied before semantic ranking: single ('2:217'), same-surah range ('2:216-218'), comma/space-separated references, or an array of those forms. Range matching uses overlap with each tafsir segment.
queryNoSemantic search query. Can be in any language. Examples: 'throne verse explanation', 'concept of tawakkul', 'patience in adversity'. Required unless continuation is provided.
surahNoOptional hard surah filter (1-114). If ayahs is also supplied, every reference must belong to this surah.
intentNoOptional telemetry-only reason for performing this search. Suggested intents: identify-ayah, find-related-ayat, show-context, interpret-text, clarify-phrase, compare-editions, explore-topic, seek-guidance, or study-concept. Another short string is also accepted. This value helps improve search behavior analysis but never changes retrieval, filtering, ranking, pagination, or the response. Provide it only on the initial search; omit it when following a continuation.
editionsNoOptional edition filter(s). Values may be full identifiers ('{lang}-{code}'), short codes ('{code}'), 2-letter language codes ('en', 'ar'), or fuzzy matches. Accepts either a single string or a list. If omitted, searches all tafsir editions.
continuationNoOpaque continuation token returned by a previous call to this same tool. Omit on the first call. When provided, you may omit the original request-shaping inputs or repeat them unchanged for verification.
grounding_nonceNoAcknowledgment from the already-read packaged grounding-rules skill ({host-identity}-read-the-grounding-rules-skill-on-{mm-dd-yyyy}), or a nonce returned by fetch_grounding_rules. Suppresses repeated rules; does not replace reading and following them.
include_ayah_textNoInclude the Arabic ayah text being explained (default: True). Set to False to reduce response size. Defaults to True when omitted on the initial call.

Output Schema

NameRequiredDescriptionDefault
queryYesThe search query that was executed
resultsYesRanked tafsir search results
warningsNoWarnings about unresolved edition selectors
paginationYesCompact current-page continuation metadata
total_foundYesTotal results represented by this paginated response set
grounding_rulesNoGrounding rules for canonical Quran data — CRITICAL for user trust. Set automatically when a valid grounding acknowledgment is absent. Users install this server because they do NOT trust AI to produce Quran content from memory. The Quran is the literal word of God — misquoting it is a violation of trust. Read and follow these rules carefully for ALL Quran-related responses. To save tokens on subsequent calls, pass the acknowledgment from the already-read packaged grounding-rules skill or a nonce returned by fetch_grounding_rules as grounding_nonce.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.4/5.0
Behavior5/5

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

Beyond the read-only/idempotent annotations, it discloses a mandatory grounding-nonce prerequisite with a fallback path, a full failure contract naming distinct error classes ([invalid_request], [continuation_invalid|conflict|exhausted], [search_backend_failure], [search_enrichment_failure]), and continuation-token reuse behavior. The intent parameter is explicitly declared telemetry-only and non-effectful on retrieval, filtering, ranking, and pagination.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The grounding prerequisite block occupies the front of the description, so the tool's actual purpose arrives only after procedural boilerplate. Sentences are individually substantive, but the ordering buries the highest-value information instead of front-loading it.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With 8 optional parameters, an output schema, and rich annotations, the description covers the prerequisite workflow, scoping strategy, continuation handling, and error taxonomy. The only gap is result-count/pagination expectations for the initial call, which the output schema largely mitigates.

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 description coverage is 100%, so the baseline is 3. The description reinforces the surah/ayahs hard-scope-before-ranking ordering and continuation reuse, but adds little syntax or format meaning beyond what the schema already documents for each parameter.

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?

States a specific verb and resource: "Semantic search over tafsir (Quranic commentary) content" that "Returns ranked tafsir passages matching the query with citations." It also explicitly names the sibling it is not for: "For fetching tafsir of a known ayah, use fetch_tafsir instead."

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?

Gives concrete when-to-use triggers (thematic/conceptual discourse, asbab al-nuzul, keyword-in-commentary where the ayah reference isn't known) and an explicit alternative for the known-ayah case. It also tells the agent how to narrow retrieval with surah/ayahs before semantic ranking, plus the prerequisite grounding workflow.

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.