Skip to main content
Glama
This connector has been deprecated

Search the Quran

shamela_search_quran
Read-onlyIdempotent

بحث في القرآن

Search the Qur'an (6,236 verses, Hafs from Asim, Egyptian إملائي orthography) via the pre-built aya/ Lucene index. Ships zero-config — works on a fresh Shamela install. Returns aya_id (1..6236), surah, surah_name, aya, body (full verse text), and a snippet with ... around matches. A single-word query is also searched as its ال-stripped stem and that stem's prefixed forms, which widens it: «الملك» returns 60 verses where the word as typed accounts for 28. The widening is reported — stem_expanded_to names the forms searched, query_form_hits counts the verses matching your word or its prefixed forms, and each hit's matched_form says which form it came in on, so a verse that only rode the stem (مَٰلِكِ in 1:4) is identifiable rather than presented as your word. Pair with shamela_get_aya to fetch a single verse with the Othmani Amiri rendering, or with shamela_get_tafseer_of_aya to find tafsir books that comment on a matching verse.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNoMaximum number of results to return (1-100, default 20).
queryYesArabic text of a verse or part of one. Matched against all 6,236 verses in BOTH orthographies — the Egyptian إملائي spelling a user types from memory AND the Uthmani rasm that mushaf apps, quran.com and PDFs copy (ٱ, dagger alef, ﴿﴾, full tashkeel are all handled), so paste the verse exactly as you received it. Every word is ANDed. Single-word queries also match prefixed forms (e.g. «الصبر» matches «بالصبر») AND the same word with «ال» stripped («الملك» is also searched as «ملك»/«للملك»), which widens the answer past the word you typed — the response names those forms in `stem_expanded_to`, tags each hit with the `matched_form` it came in on, and reports in `query_form_hits` how many verses match your word itself. Results come back in mushaf order (aya_id), not by relevance.
offsetNoNumber of results to skip for pagination. Use with `limit` to page through large result sets. The response includes `has_more` and `next_offset` to drive paging.
optionsNoCurrently only the `wildcards` flag is honored. The Quranic index ships pre-built and zero-config.
response_formatNoOutput format for the human-readable text. 'markdown' (default) is best for direct display; 'json' returns the same data as a single JSON code block; 'none' skips the rendered text entirely and returns a one-line pointer, leaving `structuredContent` as the whole answer. The structured data is returned in `structuredContent` regardless of this setting, so a caller that parses it should pass 'none' — the character budget is measured over BOTH channels, and the unread copy is otherwise spending most of it. Requires the 'response_format.none' capability (see shamela_brief).markdown

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?

Annotations declare read-only, idempotent, closed-world safety. The description adds substantial behavioral detail: pre-built zero-config index, returned fields (aya_id, surah, surah_name, aya, body, snippet), stem expansion behavior (ال-stripped and prefixed forms) with reporting fields, and that results come in mushaf order not relevance. This goes well beyond what annotations provide.

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 with purpose and return fields, then structured into query behavior, stem expansion reporting, and pairing suggestions. Long but dense; minor redundancy with schema on stem expansion and an Arabic title, but every paragraph informs invocation.

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?

No output schema exists, so the description must explain return values; it names aya_id, surah, surah_name, aya, body, snippet, and the stem-expansion report fields. Given nested options and query complexity, this is complete enough for correct invocation.

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%; the schema already documents query semantics, limit/offset, options (wildcards), and response_format in detail. The description largely repeats the query-expansion behavior and adds only example counts (e.g., «الملك» 60 vs 28), providing minimal new parameter semantics.

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 (Search), resource (the Qur'an), scope (6,236 verses, Hafs from Asim, Egyptian إملائي orthography), and implementation (pre-built aya/ Lucene index). Distinguishes from sibling search tools by naming the Quran-specific index and follow-up tools (shamela_get_aya, shamela_get_tafseer_of_aya).

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?

Provides clear context: used to search Quran verses, pair with shamela_get_aya for single-verse rendering or shamela_get_tafseer_of_aya for tafsir. Does not explicitly state when to choose this over other search siblings (e.g., shamela_search_library, shamela_search_exact), so no exclusions are given.

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.

Resources