Resolve Quran Reader Link
interactive_study_linkWhen 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
| Name | Required | Description | Default |
|---|---|---|---|
| ayahs | Yes | One same-surah point ('3:37') or forward range ('3:37-38'). At most 128 ayahs. Multiple or cross-surah references are not accepted. | |
| phrase | No | Optional 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_target | No | Optional 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_url | No | Optional 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
| Name | Required | Description | Default |
|---|---|---|---|
| end | No | Last word of a single resolved span; null for multiple spans or whole ayahs | |
| ayahs | Yes | Canonical same-surah point or range | |
| spans | Yes | Exact selected pieces in Quran order; empty for whole-ayah links. Never fill gaps between these pieces. | |
| start | No | First word of a single resolved span; null for multiple spans or whole ayahs | |
| reader_url | Yes | Preferred URL for this client. Recognized ChatGPT clients use the configured ChatGPT reader; other clients use Quran.com. Use unchanged. | |
| resolution | Yes | Link scope: the supplied ayahs, one selected word span, or several selected disjoint spans | |
| quran_com_url | Yes | Public Quran.com URL for the resolved ayah(s). For a phrase, opens its containing ayah span without selecting individual words. | |
| fallback_reason | No | Why a supplied phrase fell back to the supplied ayah scope; null when no fallback was needed | |
| canonical_phrase | No | Canonical QCF text for a single resolved span; null for multiple spans or whole ayahs | |
| app_relative_path | Yes | Canonical app-relative Interactive Study deep-link path | |
| chatgpt_reader_url | No | Verified ChatGPT web reader URL for recognized ChatGPT clients when this deployment configures a reader plugin registration; otherwise null | |
| desktop_reader_url | No | Verified 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_url | No | Validated originating conversation URL, preserved exactly; navigation only, not reader authority |