Skip to main content
Glama

quran.ai

Resolve Quran Reader Link

interactive_study_link
Read-onlyIdempotent

When reader context supplies reader_target, pass it unchanged so links return to that reader in ChatGPT. Use the returned reader_url unchanged. Resolve one same-surah ayah point/range and optional copied canonical Arabic phrase into a verified link. Recognized ChatGPT clients use Interactive Study; all other clients use Quran.com. Quran.com phrase links open the containing ayah span without word highlighting. The server looks up QCF V2 words and returns exact word positions; never infer or guess positions. Spacing, diacritics and verified simple/Uthmani spelling differences do not prevent a match. Prefer a unique contiguous match, then a unique ordered match whose omitted words remain unselected. Missing, ambiguous or unsupported phrases return the supplied ayah/range link successfully with resolution='ayah' and a fallback_reason. Use resolution and spans to describe what the link selects accurately. Omit phrase for a whole-ayah/range link. Invalid argument types, phrase lengths and target formats fail tool-schema validation. Failure contract: [invalid_request] for malformed references/origins or oversized input scopes; [not_found] when the supplied canonical ayahs are absent; [service_unavailable] when the Fetch database is unavailable.

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": {
      "ayahs": "<ayahs>"
    },
    "name": "interactive_study_link"
  }
}

Input Schema

NameRequiredDescriptionDefault
ayahsYesOne same-surah point ('3:37') or forward range ('3:37-38'). At most 128 ayahs. Multiple or cross-surah references are not accepted.
phraseNoOptional Arabic phrase copied from the canonical Quran text. Matches QPC/Uthmani Hafs words and Imlaei or simplified Hafs edition text verified against those same complete reader words. Spacing and diacritics are ignored. A unique ordered match may select several spans with gaps. If matching is uncertain or the selection exceeds three mushaf pages, the link falls back to the supplied ayahs. Do not include ayah numbers in the phrase.
reader_targetNoOptional navigation target copied exactly from the originating reader context. Do not infer it from a conversation or context ID. Omit when no target was supplied.
originating_chat_urlNoOptional exact originating conversation URL from supported host metadata/tools or the user; never guess it. Accepts https://chatgpt.com/c/UUID or codex://threads/UUID, optionally with ?hostId=VALUE for Codex. Preserve the original URL when forwarding a link; never replace it with the sidebar reader's current conversation. This navigation destination is separate from reader_target and conveys no reader authority.

Output Schema

NameRequiredDescriptionDefault
endNoLast word of a single resolved span; null for multiple spans or whole ayahs
ayahsYesCanonical same-surah point or range
spansYesExact selected pieces in Quran order; empty for whole-ayah links. Never fill gaps between these pieces.
startNoFirst word of a single resolved span; null for multiple spans or whole ayahs
reader_urlYesPreferred URL for this client. Recognized ChatGPT clients use the configured ChatGPT reader; other clients use Quran.com. Use unchanged.
resolutionYesLink scope: the supplied ayahs, one selected word span, or several selected disjoint spans
quran_com_urlYesPublic Quran.com URL for the resolved ayah(s). For a phrase, opens its containing ayah span without selecting individual words.
fallback_reasonNoWhy a supplied phrase fell back to the supplied ayah scope; null when no fallback was needed
canonical_phraseNoCanonical QCF text for a single resolved span; null for multiple spans or whole ayahs
app_relative_pathYesCanonical app-relative Interactive Study deep-link path
chatgpt_reader_urlNoVerified ChatGPT web reader URL for recognized ChatGPT clients when this deployment configures a reader plugin registration; otherwise null
desktop_reader_urlNoVerified native ChatGPT desktop reader URL for recognized ChatGPT clients when this deployment configures a reader plugin registration; otherwise null. Use only with explicit native ChatGPT host evidence.
originating_chat_urlNoValidated originating conversation URL, preserved exactly; navigation only, not reader authority

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.3/5.0
Behavior5/5

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

Beyond the readOnly/idempotent annotations, it discloses match-precedence rules (unique contiguous, then unique ordered with gaps unselected), the three-mushaf-page fallback threshold, the fallback success contract (resolution='ayah' plus fallback_reason), and a three-code failure contract with conditions for each. That is substantial behavior an agent could not infer from annotations.

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?

Dense but nearly every sentence carries a distinct rule; no filler. The weakness is ordering: it opens with a reader_target passthrough instruction rather than the core purpose, and the 'never infer/guess' rule is stated twice (positions and reader_target), so it is slightly less front-loaded than ideal.

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?

An output schema exists, yet the description still tells the agent how to read resolution, spans and fallback_reason, and adds a full error taxonomy. For a resolver with 4 parameters, client routing, and fallback paths, nothing an agent needs 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 coverage is already 100%, so the baseline is 3. The description still adds real semantics: it forbids inferring reader_target or originating_chat_url, explains that phrase matching ignores spacing/diacritics and verified spelling variants, and warns that omitted words stay unselected in ordered matches — meaning beyond what the schema says.

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: 'Resolve one same-surah ayah point/range and optional copied canonical Arabic phrase into a verified link.' The client-routing sentence ('Recognized ChatGPT clients use Interactive Study; all other clients use Quran.com') further scopes the output. It never names a sibling tool, so the agent must rely on the name to differentiate it from fetch_quran or search_quran.

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?

Gives clear operational conditions: pass reader_target unchanged when the reader context supplies it, use the returned reader_url unchanged, and omit phrase for a whole-ayah/range link. What is missing is any 'use X instead when…' routing to an alternative tool, so it stops short of explicit alternative guidance.

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.