Skip to main content
Glama

quran.ai

Fetch Quran Metadata

fetch_quran_metadata
Read-onlyIdempotent

Fetch structural Quran metadata for a surah, ayah, juz, page, hizb, ruku, or manzil. Returns a fixed-shape response with the full context chain: surah info, ayah location, juz/hizb/page/ruku/manzil placement, and sajdah info. All parameters are optional — provide one entry point.

Examples:

  • fetch_quran_metadata(surah=2, ayah=255) → structural location of Ayat al-Kursi

  • fetch_quran_metadata(surah=2) → overview of Surat Al-Baqarah (verse count, page range, juz range, etc.)

  • fetch_quran_metadata(juz=1) → what surahs/pages are in Juz 1

  • fetch_quran_metadata(page=50) → what's on page 50

Prefer fetching metadata over recalling it from memory. Cite this tool in your response when presenting structural Quran 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_quran_metadata"
  }
}

Input Schema

NameRequiredDescriptionDefault
juzNoJuz number (1-30). Mutually exclusive with other span entry points.
ayahNoAyah number within the surah. Requires surah parameter.
hizbNoHizb number (1-60). Mutually exclusive with other span entry points.
pageNoMushaf page number (1-604). Mutually exclusive with other span entry points.
rukuNoRuku number (1-558). Mutually exclusive with other span entry points.
surahNoSurah number (1-114). Use alone for surah overview, or with ayah for a specific verse.
manzilNoManzil number (1-7). Mutually exclusive with other span entry points.

Output Schema

NameRequiredDescriptionDefault
juzYesJuz info or range
ayahYesAyah info (point) or range (span)
hizbYesHizb info or range
pageYesPage info or range
rukuYesRuku info or range
surahYesSurah(s) in scope (always a list)
manzilYesManzil info or range
sajdahYesSajdah verses in scope (empty list if none)
query_typeYesQuery mode that produced this response
rub_el_hizbYesRub' al-Hizb info or range

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.4/5.0
Behavior4/5

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

The annotations already declare read-only, idempotent, non-destructive, closed-world behavior, so the description focuses on things annotations can't express: the response is fixed-shape and returns the full context chain (surah, ayah location, juz/hizb/page/ruku/manzil placement, sajdah), and it documents two named failure codes ([invalid_request] for malformed or mutually incompatible inputs, [service_unavailable] for runtime unavailability). That is meaningful added disclosure, though nothing is said about response size or performance.

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?

The opening sentence front-loads the purpose and scope, followed by the return shape, the entry-point rule, and compact examples that each illustrate a distinct intent. The trailing instruction to cite the tool and mirror failure codes is boilerplate-adjacent but still functional guidance rather than filler.

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 seven-optional-parameter read tool with a full annotation set and an output schema, this description is complete: purpose, valid input combinations, response shape, default behavior (fetch rather than recall), and failure modes are all covered. An agent needs nothing further to call it correctly.

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 100%, so the baseline is 3; the description earns above baseline by stating the mutual-exclusivity contract in prose ('provide one entry point') and, more importantly, by demonstrating valid parameter combinations in examples — surah alone for an overview, surah+ayah for a verse, juz/page alone for span inspection. This resolves the ambiguity of seven all-optional parameters that the schema alone leaves to the agent.

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?

The description names a specific verb ('Fetch') and a precisely scoped resource ('structural Quran metadata') with all seven entry-point dimensions (surah, ayah, juz, page, hizb, ruku, manzil) enumerated. The examples make it unambiguous that this returns structure/index data (verse counts, page ranges, placement) rather than verse text or commentary, which is what separates it from fetch_quran or fetch_tafsir without naming them.

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?

'All parameters are optional — provide one entry point' plus four worked examples tell the agent exactly how to select an entry point per intent (surah overview, surah+ayah verse location, juz span, page contents). 'Prefer fetching metadata over recalling it from memory' gives a clear default-behavior rule. It stops short of explicitly excluding cases or naming when a sibling such as fetch_quran should be preferred instead.

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.