Quran Gallery MCP
Server Details
Hosted, no-account MCP server for the classical Islamic library (Maktabah al-Shamela, 8,594 books): search and read hadith, tafsir, fiqh and other classical works, returning verbatim Arabic text cited by printed volume and page. Optional free API key for higher limits. Docs: https://github.com/qurangallery/kb-mcp
- Status
- Healthy
- Last Tested
- Transport
- Streamable HTTP · MCP 2025-11-25
- URL
TDQS
Scored across 39 tools
Most tools carve out distinct niches, and descriptions explicitly cross-reference siblings to draw boundaries (e.g. search_pages vs search_phrase vs search_boolean vs search_exact). However, real overlap persists: the bare-named `search`, `search_library`, and `shamela_search_pages` are all library searches differentiated only by scoping, `fetch` overlaps with `shamela_get_page`, `shamela_recon` and `shamela_root_stats` are admitted to be "the same measurement" with a different default, and three tafsir tools (get_tafseer_of_aya / get_tafseer_texts / list_tafsirs_for_aya) target one task.
The overwhelming majority follow a clean `shamela_<verb>_<noun>` snake_case pattern (get_page, search_isnad, resolve_work, list_categories). The deviation is three bare legacy tools — `fetch`, `search`, `search_library` — that lack the `shamela_` prefix and use vague generic verbs, plus a few noun-only names (shamela_recon, shamela_root_stats, shamela_brief), which are readable but break the verb_noun rhythm.
39 tools is heavy for any single server and exceeds the 'feels heavy' threshold. The domain is genuinely broad (Qur'an, hadith sciences, narrators, isnad, tafsir, catalog, citations), so many earn their place, but clear consolidation opportunities exist in the search family, the tafsir trio, and recon/root_stats, and the fetch/search/search_library trio overlaps with prefixed equivalents.
Coverage is unusually deep: multiple search modes, page/section/range reading, catalog and author lookup, citation export (5 styles, BibTeX/RIS), isnad/narrator dossiers, tafsir and Qur'an access, plus a capability handshake. The main gap is a dead end — many read tools error with BOOK_NOT_DOWNLOADED and there is no tool to download or fetch a missing book, and there are no on-shortlist write/manage operations.
Available Tools
39 toolsfetchRead a library pageARead-onlyIdempotentInspect
Read one library page by the id search returned ("{bookId}:{pageId}"). Returns the main text and, under a separate label, the footnotes — the editor's notes, not the author's words — with book, author, printed volume/page, the edition data the library records, and the shamela.ws link.
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | A document id from `search`, e.g. "117359:1796". |
Output Schema
| Name | Required | Description |
|---|---|---|
| id | Yes | |
| url | Yes | |
| text | Yes | Main text, then the footnotes under their own label. |
| title | Yes | |
| metadata | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already declare readOnlyHint, idempotentHint, destructiveHint=false and closed-world scope, so the safety profile is fully covered. The description adds the useful semantic note that footnotes are the editor's notes rather than the author's words, but the rest is return-shape detail already implied by the output schema.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Front-loads the core action ('Read one library page by the id...') before the return details, with no filler sentences. The second sentence is long and packs several metadata items, but each earns its place as interpretive context.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a single-page read tool with a full param schema, annotations, and an output schema, the description covers the essential concerns: where the id comes from and how the returned text/footnotes are organized. Nothing critical to correct invocation is missing, though sibling disambiguation could be stronger.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100% and the single `id` parameter is fully documented there. The description reinforces the "{bookId}:{pageId}" format and its provenance from `search`, which is marginal added value over the schema, so baseline 3 applies.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
States a specific verb (Read) and resource (one library page), and even gives the id shape "{bookId}:{pageId}". It ties itself to the `search` sibling that produces the id, so an agent can distinguish this retrieval tool from the many search_* siblings without opening a schema.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
It implies usage by telling the agent the id comes from `search`, which is genuine routing guidance. However, it offers no explicit when-not or comparison against near-neighbors like shamela_get_page, shamela_get_pages_range, or shamela_get_book_section, so the agent must infer when this is the right retrieval tool.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
searchSearch the whole library (deep research)ARead-onlyIdempotentInspect
Search all 8,594 works of the classical Islamic library and return up to 10 matching pages as {id, title, url}. Pass an id to fetch to read that page. Query in ARABIC. A title ending in [footnote match] matched only an editor's footnote, not the main text; [token match] means the exact phrase was not found and the words occur separately. This search is unscoped and ranks by term frequency; for a hadith, tafsir or fiqh question, search_library with a scope ranks the standard sources first.
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | Arabic search text — a quoted wording or a topic. |
Output Schema
| Name | Required | Description |
|---|---|---|
| results | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already cover the safety profile (readOnly, idempotent, non-destructive, closed-world), so the bar is lower, and the description still adds substantial behavior: a 10-result cap, ranking by term frequency, the unscoped nature of the search, and the meaning of the '[footnote match]' and '[token match]' result qualifiers. These are result-interpretation behaviors an agent cannot infer from annotations or schema.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Front-loaded with purpose and return shape, then constraints, then the qualifier legend, then sibling routing. Every sentence carries distinct information (scope, return limit, tool chaining, language, result qualifiers, ranking, alternative) with no filler.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Even though an output schema exists, the description adds the fields an agent needs to act on results, including the id used for fetch, the result cap, and the qualifier legend. Combined with the sibling routing and language requirement, nothing essential to correct invocation is missing.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100% and the single parameter is already documented as 'Arabic search text — a quoted wording or a topic.' The description's 'Query in ARABIC' and 'a quoted wording or a topic' largely restate the schema, so per the high-coverage baseline a 3 is correct.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
States a specific verb ('Search'), the exact resource scope ('all 8,594 works of the classical Islamic library'), and the return contract (up to 10 pages as {id, title, url}). It also explicitly contrasts itself with the sibling search_library ('unscoped... ranks by term frequency'). An agent can distinguish it from search_library and fetch without opening any schema.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Gives explicit when-to-use routing: 'for a hadith, tafsir or fiqh question, search_library with a scope ranks the standard sources first,' naming the alternative and the condition that selects it. It also chains usage to the fetch tool ('Pass an id to `fetch` to read that page') and imposes a hard input constraint ('Query in ARABIC').
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
search_librarySearch the classical Islamic libraryARead-onlyIdempotentInspect
Search a Maktabah al-Shamela library of 8,594 classical works and return passages with the book, author, printed edition page and the verbatim Arabic. Each passage also carries its edition, editor and publisher when the library records them, and a sourceUrl on shamela.ws. Runs an exact-phrase pass first and falls back to a token search, reporting which one answered. A scope is REQUIRED: unscoped ranking in this corpus is by term frequency, which surfaces a poetry anthology above a hadith collection.
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Maximum passages to return (max 10). | |
| query | Yes | Arabic search text. A quoted wording works best; a topic also works. | |
| scope | Yes | hadith-primary — The eight primary hadith collections, edition-pinned; tafsir-canonical — Canonical tafsir — Ibn Kathir, al-Tabari, Ibn al-Jawzi first; fiqh-hanafi — Hanafi fiqh (+ usul, comparative); fiqh-maliki — Maliki fiqh (+ usul, comparative); fiqh-shafii — Shafi'i fiqh (+ usul, comparative); fiqh-hanbali — Hanbali fiqh (+ usul, comparative); fiqh-comparative — All four schools plus comparative and fatwa collections; aqeedah — Creed and sects; hadith-sciences — Hadith commentary, takhrij and the sciences of hadith; tafsir — The whole tafsir shelf and Quranic sciences; seerah — Prophetic biography, history and biographical dictionaries; lugha — Arabic language, lexicons, grammar and adab |
Output Schema
| Name | Required | Description |
|---|---|---|
| note | No | Present only when the result needs a caveat. |
| scope | Yes | |
| passages | Yes | |
| totalMatches | Yes | |
| booksSearched | Yes | |
| relaxedToTokens | Yes | True when the exact phrase was not found and a looser word search answered. |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations cover safety (readOnly, idempotent, non-destructive, closed-world), so the description is free to add real behavioral depth — and it does: the two-pass strategy (exact phrase first, token fallback), that it reports which pass answered, the scope requirement's rationale, and which optional metadata fields are only present 'when the library records them'. That is unusually informative beyond structured fields.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Four sentences, all doing work, with the corpus scope and return payload front-loaded and the escalation to the scope constraint last where it lands hardest. Density is high but no sentence is filler; slightly more compression of the output-field list would help.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
With an output schema present, the description needn't spell out return values, yet it summarizes them usefully and covers the required-vs-optional parameter distinction. Nothing critical is missing for correct invocation, though a hint about result breadth relative to limit (max 10) or scope selection strategy is absent.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
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 earns above baseline by explaining *why* scope is mandatory and how ranking degrades without it, which the enum alone cannot convey. The query parameter gets the same 'quoted wording works best' hint already in the schema, so that part adds nothing.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description names a specific verb and resource (search a Maktabah al-Shamela library of 8,594 classical works) and enumerates exactly what comes back: book, author, printed edition page, verbatim Arabic, editor/publisher, and a sourceUrl. It is very clear on its own, but it never contrasts itself with the many sibling search tools (shamela_search_phrase, shamela_search_exact, shamela_search_boolean, search), leaving the agent to infer the boundary.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
It explains a usage-relevant constraint — that a scope is required because unscoped term-frequency ranking surfaces a poetry anthology above a hadith collection — and notes the exact-phrase-then-token fallback. However, it gives no when-to-use-versus-alternative guidance: nothing tells the agent why to pick this over shamela_search_phrase, shamela_search_exact, or shamela_search_boolean for the same query.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
shamela_books_by_periodBooks by period (composition and death year)ARead-onlyIdempotentInspect
كتب حسب المدة (تأليفًا ووفاةً)
Catalog filter that AND-combines its constraints, unlike scope.period_*, which unions them and so widens a search instead of narrowing it. composed_from/composed_to bound book.book_date (Shamela's «تاريخ الكتاب»); died_from/died_to bound the MAIN AUTHOR's death year. Read those as two COLUMNS, not two independent dimensions: measured on this catalogue they carry the same number on 98.5% of dated books, because Shamela records no composition year. A composed-vs-died question — «books written in the 8th century by authors who died in the 9th» — is therefore one this data cannot answer, and a near-empty result means the distinction is unavailable, not that no such book exists. A book matches only if it satisfies ALL provided constraints at once (composition-year AND death-year AND category AND downloaded) — an intersection, never a union. At least one of the four bounds is required. Also accepts category_id, downloaded_only, limit/offset. Returns book_id, book_name, main author + death_year, book_date, category, downloaded flag, and a ready-to-use book_ids[] to pass as scope.book_ids. Use when a question distinguishes 'books composed in a period' from 'books by authors who died in a period' — e.g. died_from:700, died_to:800 for 8th-century-Hijri authors.
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Maximum number of results to return (1-100, default 20). | |
| offset | No | Number 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. | |
| died_to | No | Hijri year, inclusive UPPER bound on the MAIN AUTHOR's death year (author.death_number). Pair with died_from. | |
| died_from | No | Hijri year, inclusive LOWER bound on the MAIN AUTHOR's death year (author.death_number). A different column from composed_*, but the same number on 98.5% of dated books. Pair with died_to. | |
| category_id | No | Optional: restrict to one category (use shamela_list_categories for IDs). Categories are flat in master.db. | |
| composed_to | No | Hijri year, inclusive UPPER bound on book.book_date («تاريخ الكتاب»; see composed_from — it is not a composition year). Pair with composed_from. | |
| composed_from | No | Hijri year, inclusive LOWER bound on book.book_date — Shamela's «تاريخ الكتاب». NOT an independent composition year: it holds the main author's death year on 98.5% of dated books (8,461/8,587), so pairing it with died_* almost never narrows anything. Pair with composed_to. | |
| downloaded_only | No | If true, restrict to books actually downloaded on this machine (master.db.book.major_ondisk > 0) — the only ones with searchable page content. | |
| response_format | No | Output 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 |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already cover the safety profile (readOnly, idempotent, non-destructive), so the description spends its budget on non-obvious behavior: constraints AND-combine (intersection, never union), at least one of the four bounds is required, and the near-empty-result interpretation. It also discloses the hand-off artifact (`book_ids[]` to pass as `scope.book_ids`), which no annotation could convey.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Front-loaded with the highest-value distinction (AND vs. union, and the composed/died column caveat) before the mechanics and return fields. It is dense but each paragraph carries a distinct load; the main cost is the duplicated Arabic header line and the 98.5% statistic restated from the schema.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
No output schema exists, and the description compensates by enumerating the returned fields (book_id, book_name, main author + death_year, book_date, category, downloaded flag) and the `book_ids[]` payload for chaining into `scope.book_ids`. With the filter semantics, requirement rule, and return shape all covered, an agent has everything needed to call it correctly.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100%, so the per-parameter docs already exist (including the 98.5% overlap note, which the description partly repeats). What the description adds beyond the schema is the cross-parameter rule that at least one of the four bounds must be supplied and the pairing guidance between `composed_*` and `died_*` — real value, but a substantial fraction of the text is duplicative of the schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
States a specific resource (books) and an explicit filter axis (Hijri period bounds on composition/`book_date` and on the main author's death year), and names the sibling family it must not be confused with (`scope.period_*`). An agent can tell it apart from `shamela_search_books` or a period scope without opening any schema.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Explicitly says when to use it ('when a question distinguishes books composed in a period from books by authors who died in a period') with a concrete example (`died_from:700, died_to:800`). It also says when the tool is the wrong instrument — a composed-vs-died question — and warns that a near-empty result means the distinction is unavailable rather than that no book exists.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
shamela_briefServer capabilities and search pitfallsARead-onlyIdempotentInspect
بيان قدرات الخادم ومزالق البحث
Capability handshake + operating brief for programmatic callers. Call this FIRST, before sending any argument you are not certain this build accepts. Returns capabilities[] — the arguments and response fields this server supports — plus server_version, limits, and traps[]. Every tool input here is strict, so sending an unknown argument (e.g. shape, response_format:'none') to a server that predates it is a HARD validation error that fails the whole call, not a silently ignored field; and tools/list cannot help, because it proves a tool exists without saying which arguments it takes. Gate each new argument on its capability string. traps[] is the operating half: each entry pairs a way a search result misleads with the exact RESPONSE FIELD that proves it fired (relaxed_min_match, zero_hit_terms, paging_ceiling, coverage.sample_is_complete, scope_resolution.dropped, madhab_source, probes[].qualifiers, …), so a caller checks the envelope instead of trusting prose. brief_hash covers every other field: cache the brief and re-fetch only when it changes. Pure text and constants — no library access, so it answers even when the Shamela install is missing. Examples: shamela_brief({}), shamela_brief({response_format:'json'}).
| Name | Required | Description | Default |
|---|---|---|---|
| response_format | No | Output 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 |
Output Schema
| Name | Required | Description |
|---|---|---|
| traps | No | |
| limits | No | |
| truncated | No | |
| brief_hash | No | |
| capabilities | No | |
| rows_dropped | No | |
| server_version | No | |
| truncation_message | No |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already declare readOnly/idempotent/non-destructive, but the description adds substantial behavioral context beyond them: strict validation makes unknown arguments a hard failure (not silently ignored), the brief works even without the Shamela install, brief_hash supports caching, and traps[] pairs failure modes with the exact response field that proves them. This is rich disclosure that the annotations alone do not convey.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Dense and front-loaded — the purpose and 'call first' instruction lead, followed by return contract, validation caveat, traps explanation, and caching. It is long, but nearly every sentence carries distinct operational information; a modest trim would still improve it.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
An output schema exists, so return values need no prose, yet the description still enumerates the key returned fields (capabilities, server_version, limits, traps, brief_hash). For a 1-param meta tool this is fully complete.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
With only one parameter and 100% schema coverage, the schema already carries the semantics; baseline is 3. The description adds value by clarifying the response_format examples and tying 'none' to the capability gate, but most parameter detail lives in the schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
States a specific function: a capability handshake and operating brief that returns capabilities[], server_version, limits, and traps[]. It is unmistakably a meta/discovery tool, clearly distinguished from all the shamela_get_*/shamela_search_* siblings that do actual retrieval.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Explicit sequencing instruction: 'Call this FIRST, before sending any argument you are not certain this build accepts.' It also gives the negative case (gate each new argument on its capability string) and explains why tools/list cannot substitute. Nothing is left to inference.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
shamela_get_authorGet author detailsARead-onlyIdempotentInspect
جلب بيانات مؤلف
Fetch metadata for an author by author_id, optionally with the list of books they authored. Returns author_name, death_year (null if unknown or modern), death_text (display string), and the book list (main + co-authored). Each book entry has book_id, book_name, book_date, downloaded flag. Use include_books=false to skip the book list when you only need name/death year. Example: shamela_get_author({author_id:57}) returns Ibn Uthaymeen + his books.
| Name | Required | Description | Default |
|---|---|---|---|
| author_id | Yes | The author id (e.g. 57 for Ibn Uthaymeen). | |
| include_books | No | If true (default), include the list of books authored by this author. Includes co-authored books. | |
| response_format | No | Output 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 |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already declare readOnly/idempotent/non-destructive, so the safety profile is covered; the description then adds genuinely useful behavioral detail the annotations cannot: death_year is null if unknown or modern, death_text is a display string, and the book list includes co-authored works with a downloaded flag. With no output schema present, this return-shape disclosure carries real weight.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Front-loaded with the purpose, then returns, then the parameter hint and example — a sensible order with no wasted discussion. Minor redundancy: the Arabic line 'جلب بيانات مؤلف' merely restates the English opening sentence, and the example sentence is somewhat elaborate.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Because no output schema exists, the description does the work of enumerating the return payload (author_name, death_year, death_text, per-book fields), which is exactly what an agent needs to consume the result. The only real gap is that it never tells the agent how to find a valid author_id, which matters for a tool whose sole required input is an opaque id.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100%, so the baseline is 3, but the description goes beyond the schema by explaining the purpose of include_books (skip the book list when only name/death year is needed) and by giving a concrete call example (author_id:57). It adds a modicum of meaning over the structured fields, though response_format's elaborate schema text needs no help.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
States a specific verb and resource ('Fetch metadata for an author by author_id') and enumerates what is returned, so the agent knows exactly what this tool produces. However, it never differentiates itself from the many sibling lookup tools (e.g. shamela_search_authors as the way to obtain an author_id), so sibling disambiguation is left implicit.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
There is usable guidance for one parameter ('Use include_books=false to skip the book list when you only need name/death year'), but nothing about when to choose this tool over alternatives such as shamela_search_authors or how a candidate author_id is discovered in the first place. Usage is implied by the description rather than stated.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
shamela_get_ayaGet an ayahARead-onlyIdempotentInspect
جلب آية
Fetch Qur'anic verses by aya_id (1..6236, cumulative across surahs) OR by surah (1..114) + aya (1..N), optionally a run of them with count. Returns each verse in three renderings: body (Egyptian إملائي, Hafs from Asim — the searchable form), amiri (Othmani Amiri rendering for display), majma (KFQPC Mushaf rendering). Also returns surah_ayat, the surah's total verse count, so you can ask for the rest without guessing. Pass either aya_id alone OR both surah and aya. Examples: shamela_get_aya({aya_id:1}) → al-Fatiha verse 1 (basmala); shamela_get_aya({surah:55, aya:1}) → Ar-Rahman verse 1; shamela_get_aya({surah:112, aya:1, count:4}) → all of al-Ikhlas in one call; shamela_get_aya({surah:2, aya:285, count:2}) → the last two verses of al-Baqara.
| Name | Required | Description | Default |
|---|---|---|---|
| aya | No | Aya number within the surah, 1..N. Pair with `surah`. | |
| count | No | How many consecutive verses to return, starting at the one resolved above (1-20, default 1). Use it for a passage — «the last two verses of al-Baqara» is surah=2, aya=285, count=2, and a short surah comes back in one call. The response always reports `surah_ayat`, that surah's total verse count, so you never have to guess how many to ask for. Verses continue across the surah boundary; each carries its own surah/aya. | |
| surah | No | Surah number 1..114. Pair with `aya`. | |
| aya_id | No | Cumulative aya id, 1..6236. Mutually exclusive with surah/aya. | |
| response_format | No | Output 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 |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already declare readOnly/idempotent/non-destructive, and the description adds substantial non-obvious behavior: the three renderings returned (body/amiri/majma), the surah_ayat total-count field, that runs continue across surah boundaries with per-verse surah/aya, and that response_format 'none' is preferable when the caller parses structuredContent due to a shared character budget.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Purpose is front-loaded, followed by resolution modes and then examples that each illustrate a distinct invocation pattern. It is longer than strictly necessary but nearly every sentence carries operational information; the examples in particular earn their space.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
With no output schema and five parameters, the description compensates by naming the returned fields (body, amiri, majma, surah_ayat) and explaining the two-channel response_format behavior. An agent has everything needed to call it correctly and interpret the result.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100%, so the baseline is 3, but the description adds cross-parameter constraints (mutual exclusivity of aya_id vs surah+aya) and semantic mapping of each field to a real call, e.g. count=4 returning all of al-Ikhlas. The worked examples meaningfully extend beyond the schema text.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
States a specific verb and resource ('Fetch Qur'anic verses') and immediately names the two resolution modes (cumulative aya_id 1..6236 OR surah+aya). An agent can distinguish this from shamela_search_quran or shamela_get_tafseer_of_aya without opening the schema.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Explicitly tells the agent how to invoke it: 'Pass either aya_id alone OR both surah and aya', with four concrete worked examples covering basmala, mid-surah, full short surah, and a run. It does not explicitly name an alternative tool (e.g. search_quran) or state when not to use it, which keeps it just short of a 5.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
shamela_get_bookGet book detailsARead-onlyIdempotentInspect
جلب بيانات كتاب
Fetch full metadata for a book by book_id. Returns book_name, all authors (main + co), category, book_type (printed/manuscript/journal/thesis/electronic/audio), book_date (Shamela's «تاريخ الكتاب» — on 98.5% of dated books this is the MAIN AUTHOR's death year, not a composition year; do not cite it as one), printed flag, downloaded flag (true ONLY when both master.db says so AND the per-book SQLite has page rows), publication_date (DDMMYYYY Hijri from meta_data), sub_books, same_group (other catalog entries of the SAME work — Ṣaḥīḥ al-Bukhārī is 8 entries: five editions plus three abridgments; treat quotes from two of them as one source, not two), scan (the scanned PDF printing Shamela holds, with resolved download URLs), cover (a ~310x460 JPEG of that printing's title page, attached as an image block by default — pass include_cover:false to suppress; only 1,368 of 8,594 books have one. Its absence does NOT mean there is no scanned printing — 377 books carry a scan with no cover image — and it says nothing about the book's real binding; read scan for whether a scan exists), and a notes array listing citation-grade fields master.db doesn't have (edition/publisher/city/editor — never fabricate these). Find ids via shamela_resolve('book name') or shamela_list_downloaded_books. Works on any catalog book whether downloaded or not.
| Name | Required | Description | Default |
|---|---|---|---|
| book_id | Yes | The book id (e.g. 9942). | |
| include_cover | No | Attach the book's cover image as an MCP image block when Shamela ships one (1,368 of 8,594 books). The picture is a ~310x460 thumbnail of the scanned printing's title page, so it costs roughly 190 image tokens. Set false to keep the reply text-only; `cover.available` still reports whether one exists. | |
| response_format | No | Output 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 |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already declare read-only/idempotent/no-destruction, and the description still adds substantial non-obvious behavior: book_date is usually the author's death year (not composition), downloaded is true only under a dual condition, cover absence does not imply no scan, and same_group entries must not be double-counted as sources. This is exactly the kind of field-level semantics annotations cannot carry.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The core purpose is front-loaded in the first sentence, and most of the parenthetical caveats (book_date, downloaded, same_group, notes) earn their place given there is no output schema. It is dense and slightly redundant with the schema on cover-token cost, but not padded.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
With no output schema, the description carries the full burden of return-value documentation, and it delivers: it names the returned fields and their pitfalls, explains the notes array as non-fabricable citation fields, and gives id-resolution guidance. Nothing an agent needs to interpret the response is missing.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100%, so the baseline is 3, but the description adds genuine decision context for include_cover (why to suppress it, that absence is not meaningful, that ~1,368 of 8,594 books have one) and reinforces the cover/scan distinction. It does not, however, add anything about response_format beyond what the schema states.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
Opens with a specific verb+resource ('Fetch full metadata for a book by book_id') and immediately enumerates the fields returned, so an agent knows exactly what this provides versus shamela_get_book_parts, shamela_get_toc, or shamela_get_page. It also disambiguates scope from shamela_list_downloaded_books by stating it 'works on any catalog book whether downloaded or not.'
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Explicitly routes id discovery to shamela_resolve('book name') or shamela_list_downloaded_books, and clarifies the downloaded-vs-catalog scope. It stops short of stating when to prefer a sibling like shamela_brief or shamela_get_book_parts, but the context for use is clear.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
shamela_get_book_partsList a book's volumesARead-onlyIdempotentInspect
أجزاء الكتاب
List the volumes/parts of a multi-volume book. Returns is_multi_volume flag, total_pages, and an array of parts each with part name (e.g. 'ج 1'), page_count, first_page_id, last_page_id. For single-volume books returns is_multi_volume:false, and an empty parts array unless the pages carry a single part label — that one label is kept, because get_citation prints it (e.g. «(١٨/ ٥١١)»). Useful to know whether a citation needs a part designator. Example: shamela_get_book_parts({book_id:}). Find downloaded book ids via shamela_list_downloaded_books.
| Name | Required | Description | Default |
|---|---|---|---|
| book_id | Yes | The book id. | |
| response_format | No | Output 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 |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already cover the safety profile (readOnly, idempotent, non-destructive, closed-world), so the description's added value is the edge-case behavior: single-volume books return is_multi_volume:false and an empty parts array, except one retained part label because get_citation prints it. That is meaningful behavioral disclosure beyond the annotations.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Front-loads the purpose, then the return shape, then the edge case, then the example and the id-lookup pointer. Most sentences earn their place, though the leading Arabic restatement of the title adds no information and the return-field enumeration is dense.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
There is no output schema and no rich annotation surface for return values, so the description carries the full burden — and it does, spelling out every returned field plus the single-volume special case. An agent has everything needed to call and interpret this tool.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100% and the enum on response_format is fully documented in the schema itself, so the description adds little parameter meaning. It provides an example call, which is mildly reinforcing but not new semantics — baseline 3 applies.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
States a specific verb+resource: list the volumes/parts of a multi-volume book, then enumerates the exact returned fields (is_multi_volume, total_pages, parts with part name/page_count/first_page_id/last_page_id). This lets an agent distinguish it from siblings like shamela_get_toc and shamela_get_book without opening any schema.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Gives a clear motivating context ('Useful to know whether a citation needs a part designator') and routes the agent to shamela_list_downloaded_books for obtaining book ids. It does not, however, state when to prefer this over shamela_get_toc or shamela_get_book, so no explicit exclusions are offered.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
shamela_get_book_sectionRead a book chapterARead-onlyIdempotentInspect
جلب باب من كتاب
Fetch every page under a chapter title. Resolves the chapter's start/end page range from the per-book SQLite (next-sibling-title boundary), then batch-reads the page contents. Capped at max_pages (default 30, max 100); sets truncated:true if the section is longer. Long sections also stop early on a character budget (even within max_pages) and return next_start_page_id + a _display hint to continue. Use shamela_get_toc to find title_ids, then this tool to read the matching section. Example: shamela_get_book_section({book_id:, title_id:}).
| Name | Required | Description | Default |
|---|---|---|---|
| book_id | Yes | The book id. | |
| title_id | Yes | The title id of the chapter / section to fetch (use shamela_get_toc to find IDs). | |
| keep_html | No | Preserve inline HTML markers. | |
| max_pages | No | Cap on pages to read (1–100, default 30). Sections longer than this are truncated with a flag. | |
| response_format | No | Output 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 |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already declare readOnly/idempotent/non-destructive, yet the description adds substantial context beyond them: truncation via max_pages, early stop on a character budget, the truncated flag, and continuation via next_start_page_id plus a _display hint. This more than meets the reduced bar annotations impose.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The definition is front-loaded with a short purpose statement followed by mechanism, limits, and workflow, and every sentence carries information. The bilingual opening is slightly redundant but not wasteful.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
With no output schema, the description carries the burden of describing returns and does so: it explains the truncated flag, next_start_page_id continuation, the _display hint, and how structuredContent/response_format interact. An agent has everything needed to call it correctly and to paginate through long sections.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100%, so the baseline is 3, but the description adds behavioral meaning to max_pages by tying it to the truncation flag and to continuation semantics. It does not go deeper on response_format, which the schema already documents thoroughly.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description opens with a specific verb+resource ('Fetch every page under a chapter title') and immediately clarifies the resolution mechanism (next-sibling-title boundary in per-book SQLite). This is clearly distinguishable from sibling tools like shamela_get_page (single page) and shamela_get_pages_range (arbitrary range) because it is keyed on a chapter title_id.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
It states the workflow explicitly ('Use shamela_get_toc to find title_ids, then this tool to read the matching section') and supplies a concrete invocation example. It does not, however, name when a caller should prefer a sibling (e.g. get_page or get_pages_range) instead, so it lacks exclusions.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
shamela_get_books_for_hadithBooks that contain a hadithARead-onlyIdempotentInspect
كتب تتضمَّن حديثًا
Given a Shamela hadith key (numeric identifier shared by all collections that record the same hadith), list every book that cites it. Uses Shamela's pre-built service/hadeeth.db join. By default filters to downloaded books only. Each result has book_id, book_name, author_name, page_id, downloaded flag. Pair with shamela_get_page to read the cited page. Useful for cross-collection hadith research (Bukhari + Muslim + Sunan + Musnad references for the same hadith).
| Name | Required | Description | Default |
|---|---|---|---|
| hadith_key | Yes | Numeric hadith key (the normalized identifier Shamela uses across collections — e.g. 1234). Different collections of the same hadith share this key. | |
| downloaded_only | No | If true (default), only return books actually downloaded on this machine. | |
| response_format | No | Output 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 |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already establish the safe, idempotent read profile, so the bar is lower; the description still adds real value by naming the backing mechanism (pre-built service/hadeeth.db join), the default downloaded-only filter, the per-result fields, and the response_format character-budget caveat. It does not state ordering or empty-result behavior, but the added context is substantive.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The lead sentence is front-loaded and the following sentences each carry distinct information (mechanism, default filter, result shape, pairing). Some overlap with the schema's own hadith_key explanation is the only redundancy.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
There is no output schema, and the description compensates by enumerating the result fields (book_id, book_name, author_name, page_id, downloaded flag). Combined with the downloaded_only default and the shamela_get_page handoff, an agent has enough to call it correctly; only result ordering and empty-case behavior are unstated.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100% and each parameter carries a detailed description, including the response_format capability requirement, so the schema does the heavy lifting. The description restates that hadith_key is a shared numeric identifier but adds no syntax or format detail beyond the schema, so the baseline 3 applies.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description gives a specific verb and resource ("list every book that cites" a given hadith key) and explains the underlying join, so the agent knows exactly what comes back. It pairs explicitly with shamela_get_page, but never contrasts itself with the close sibling shamela_search_hadith, which an agent might otherwise reach for.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Usage context is implied rather than stated: "Useful for cross-collection hadith research" sketches a scenario, and the downloaded_only default is disclosed. There is no explicit when-to-use-this-vs-shamela_search_hadith routing, which matters given a sibling with overlapping hadith scope.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
shamela_get_citationFormat a citationARead-onlyIdempotentInspect
صياغة إحالة
Format a citation in five styles. style='shamela' (default) replicates Shamela's UI copy-with-citation: «» (/ ):\n«». style='short' is a one-line inline reference: ، ، ص . style='full' is the long form with author death year and book composition year, plus a notes[] array listing missing citation-grade fields (edition/publisher/city/editor — master.db doesn't have these; never fabricate). style='bibtex' and style='ris' export a machine-readable record for Zotero/EndNote/Mendeley (Western digits, Arabic UTF-8, cite key shamelap, same missing-field notes[], no fabricated edition/publisher/city/editor). All other styles use Arabic-Indic digits. Examples: shamela_get_citation({book_id:, page_id:, style:'shamela'}), shamela_get_citation({book_id:, page_id:, text:'', style:'shamela'}).
| Name | Required | Description | Default |
|---|---|---|---|
| text | No | Optional quoted text. When provided in 'shamela' style, the output includes a two-line block: «<book>» (<part>/ <page>): «<text>». | |
| style | No | Citation style. 'shamela' replicates Shamela's UI copy-with-citation format (default). 'short' is a one-line inline reference. 'full' is the long form including author death year and book year, with notes listing missing fields (publisher/edition/etc are not in master.db). 'bibtex' and 'ris' are machine-readable exports for Zotero/EndNote/Mendeley (Western digits, Arabic UTF-8, stable cite key shamela<book_id>p<page_id>); they carry only fields master.db has, with the same missing-field notes[]. | shamela |
| book_id | Yes | The book id. | |
| page_id | No | Optional page_id. When omitted, the citation references the book without a specific page (e.g. for a book-level citation). | |
| response_format | No | Output 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 |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already cover the safety profile (readOnly, idempotent, closed-world, non-destructive), and the description goes well beyond them: it discloses the never-fabricate rule for missing bibliography fields, the notes[] array of gaps, the digit-system split (Western for bibtex/ris vs Arabic-Indic elsewhere), the stable cite key format, and the response_format/character-budget interaction.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
It is dense but front-loaded, leading with the five styles before details. There is noticeable overlap between the description and the already-thorough schema prose (style, text, response_format are all re-explained), plus a redundant Arabic heading, keeping it just short of a 5.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
With no output schema and five parameters, the description must carry the return-value burden itself, and it does: it documents the two-line shamela block, the notes[] gaps, the cite key, and the digit conventions across styles. Nothing an agent needs to call this correctly is missing.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so the schema already documents all five parameters including the style enum and the text param's two-line behavior. The description restates much of this rather than adding new semantics, so the baseline 3 applies; the examples of parameter combinations add only marginal value.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The title and opening line ('Format a citation in five styles') give a specific verb and resource, and the description then enumerates each of the five styles with their distinct output shapes. An agent can tell this is the citation-formatting tool rather than a retrieval sibling like shamela_get_page without opening any schema.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
It states exactly when to pick each style: 'shamela' for UI copy-with-citation, 'short' for one-line inline references, 'full' for long-form with death/composition years, and 'bibtex'/'ris' for Zotero/EndNote/Mendeley. It also flags the conditional behavior of the optional text param and supplies two concrete invocation examples, leaving little to inference.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
shamela_get_isnadA page's isnad and its chainsARead-onlyIdempotentInspect
إسناد الصفحة وطرقه
The isnād chain(s) printed on one page, resolved from Shamela's narrator ids to names and death years, plus the other routes (طرق) of the same ḥadīth in the other indexed books. This is the pivot from a search hit to who transmitted it: run shamela_search_pages, then pass a (book_id, page_id) here. A page can carry several chains, and variants follows Shamela's ḥadīth key outward — counting the routes is how you judge whether a report rests on one thread (غريب) or many (مشهور). Chains run ASCENDING: first link is the Companion, last is the collector; each link heard from the one before. Only ten ḥadīth books are indexed for isnād, so most pages return no_isnad_indexed:true — and no_isnad_reason then says WHICH kind of nothing it is: 'no_marker_on_page' (the page carries no isnād marker at all, read from its own service annotations) or 'marked_but_unindexed' (it does carry one, but this book is outside the ten). A page_id the book does not have is now an error rather than a third silent nothing. Pair a narrator id from the chain with shamela_get_narrator to see whether the critics accepted them.
| Name | Required | Description | Default |
|---|---|---|---|
| book_id | Yes | The book id. | |
| page_id | Yes | The page id. | |
| max_variants | No | Cap on returned variant routes (1-200, default 20). `variants.truncated` reports when more exist. | |
| response_format | No | Output 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 |
| include_variants | No | Also return the other routes (طرق) of the same ḥadīth from the other indexed books, matched on Shamela's ḥadīth key. This is what shows whether a report rests on one thread or many. |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already cover safety (readOnly/idempotent/non-destructive), but the description adds substantial context they do not: chain direction ('ASCENDING: first link is the Companion, last is the collector'), the ten-book indexing ceiling, the two distinct no-data outcomes with literal flag values ('no_marker_on_page' vs 'marked_but_unindexed'), and the changed error behavior for a nonexistent page_id. This is behavioral disclosure well beyond structured fields.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
It is front-loaded with the core purpose and every clause is informative, but it lands as a single dense paragraph rather than scannable segments, which makes it harder to navigate for a five-parameter tool. Slightly over-packed, though not padded.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
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 carries the burden of explaining the return surface — it names variants, no_isnad_indexed, variants.truncated, and no_isnad_reason with its enumerated values. Combined with the ordering semantics and next-step routing, an agent has everything needed to call and interpret this tool correctly.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so a 3 would be the floor, but the description adds interpretive meaning for include_variants — counting routes to judge whether a report is ghayr (غريب) or mashhūr (مشهور) — which the schema's own phrasing only gestures at. It does not add format/syntax detail beyond that, so it sits just above baseline.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
States a specific verb+resource (resolve the isnād chain(s) on one page plus the other ṭuruq of the same ḥadīth) and clearly separates itself from nearby siblings like shamela_search_pages (the feeder step) and shamela_get_narrator (the follow-on). The opening line alone lets an agent identify the tool without opening the schema.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Gives an explicit workflow: 'run shamela_search_pages, then pass a (book_id, page_id) here,' and names a follow-on ('Pair a narrator id from the chain with shamela_get_narrator'). It also states the scoping limitation (only ten ḥadīth books indexed) so the agent knows when this tool will be useful versus when it will return nothing.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
shamela_get_narratorNarrator biographyARead-onlyIdempotentInspect
ترجمة الراوي
The full dossier on one narrator: name and lineage, death year, ṭabaqa (generation per Taqrīb al-Tahdhīb), Ibn Ḥajar's and al-Dhahabī's grades, kunya/nasab/cities/relations, and — the heart of it — al-jarḥ wa-l-taʿdīl: the critics' verdicts, grouped by critic, each quoted verbatim WITH the book and volume/page it came from (e.g. «تهذيب التهذيب (1/ 101)»). Critics are PAGED (limit, default 10, and offset), because a heavily-documented narrator has dozens — al-Zuhrī has 56 critics and 184 verdicts — and the response reports total_critics/total_verdicts plus a cursor so you can tell a page from the whole file and reach the rest. 15,160 of the 18,989 narrators carry verdicts, from 2,821 named critics. Also returns hadith_notes (فوائد) on audition, irsāl and implicit tawthīq — the evidence for whether a chain is connected. With include_network (default true) it adds the transmission network computed live from the isnād index: how many chains name this narrator, in which of the ten indexed books, and their most frequent teachers (narrates_from) and students (narrates_to) with counts. Quote the verdicts as the critics worded them; do NOT synthesize a grade the register does not state. Get the id from shamela_search_narrators.
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | How many CRITICS of al-jarḥ wa-l-taʿdīl to return (1-100, default 10) — the only part of the dossier that is paged. al-Zuhrī has 56 critics and 184 verdicts; they do not fit one response, and `total_critics` says how many there are. | |
| top_n | No | How many teachers and how many students to return, most frequent first (1-100, default 15). | |
| offset | No | Critics to skip, for paging through the verdicts. Follow `next_offset` until `has_more` is false. | |
| narrator_id | Yes | The narrator id, as returned by shamela_search_narrators or inside a chain from shamela_get_isnad. | |
| include_network | No | Include the transmission network computed from the isnād index: how many chains this narrator carries, in which books, and their most frequent teachers and students. Set false to skip it when you only need the biography. | |
| response_format | No | Output 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 |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations carry the safety profile (readOnly, idempotent, non-destructive, closed-world), and the description adds substantial behavior beyond them: the critics list is paged with a cursor, total_critics/total_verdicts let you tell a page from the whole file, the network is computed live from the isnād index, and response_format.none requires a capability. This is unusually rich disclosure.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The content is dense but front-loaded, with the core dossier contents stated before operational details. It is long (a single sprawling paragraph) and includes some illustrative statistics, but nearly every sentence carries deciding information for an agent.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
With no output schema, the description still describes the return shape adequately: the dossier fields, the verdict grouping by critic with citations, and the network fields (narrates_from/narrates_to with counts). Nothing essential for correct invocation appears missing.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
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 still adds meaning: it flags that critics are the only paged section, explains the cursor/total semantics, and clarifies that total_critics lets the caller distinguish a page from the full file — context the schema does not carry.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
States a precise verb+resource ('the full dossier on one narrator') and enumerates what the dossier contains — lineage, death year, ṭabaqa, grades, kunya/nasab/cities, and al-jarḥ wa-l-taʿdīl verdicts. It is clearly distinguishable from shamela_search_narrators, which it explicitly points to for id acquisition.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Gives clear operational guidance: get the id from shamela_search_narrators, quote verdicts verbatim rather than synthesizing a grade, and set include_network=false when only the biography is needed. It lacks an explicit 'when not to use this vs. X' routing statement, but the id-sourcing prerequisite is spelled out.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
shamela_get_pageRead a pageARead-onlyIdempotentInspect
جلب صفحة
Fetch the full text of one Shamela page (book_id, page_id). Returns body (matn), foot (footnotes), comment (user notes), printed_page label, prev/next page ids, the chapter ancestor chain (root → leaf), and the category path. Set keep_html=true to preserve inline markers; default strips them. The book must be downloaded (BOOK_NOT_DOWNLOADED otherwise). For batch reads use shamela_get_pages_range; for full chapters use shamela_get_book_section. Long pages: the body is split into parts of ~4000 chars — body_part selects the 1-based part, and body_total_parts/body_has_more report the split (footnote/comment come with part 1; a _display hint advises when to ask the user how to show it).
| Name | Required | Description | Default |
|---|---|---|---|
| book_id | Yes | The book id. | |
| page_id | Yes | The page id (Lucene/SQLite internal id, not the printed page number). | |
| body_part | No | For long pages: when the body exceeds ~4000 characters it is split into parts. Pass the 1-based part to read (default 1). The response reports body_part/body_total_parts/body_has_more; request the next part by incrementing. The footnote/comment are returned with part 1. | |
| keep_html | No | If true, preserve inline HTML markers (e.g. <span data-type='title'>). Default false strips them for plain Arabic display. | |
| response_format | No | Output 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 |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already declare readOnly/idempotent/non-destructive, and the description adds substantial traits beyond that: the BOOK_NOT_DOWNLOADED failure condition, the ~4000-char body splitting with body_part/body_total_parts/body_has_more, footnotes/comment arriving with part 1, and the keep_html stripping behavior. This is rich, non-redundant behavioral context.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Dense and front-loaded, with the core action stated first and routing/edge cases following. The leading Arabic 'جلب صفحة' duplicates the title rather than adding information, a minor bit of waste in an otherwise efficient paragraph.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
With no output schema, the description carries the full burden of describing the return payload (body, foot, comment, printed_page, prev/next, chapter ancestor chain, category path) plus error and splitting behavior. Nothing essential for correct invocation is missing.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so baseline is 3. The description restates keep_html marker handling and body_part splitting that the schema already documents in full, adding only marginal meaning beyond the structured fields.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
Specific verb+resource: 'Fetch the full text of one Shamela page (book_id, page_id)'. It also names the exact operation's scope and differentiates from siblings by naming shamela_get_pages_range (batch) and shamela_get_book_section (chapters).
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Explicit routing: 'For batch reads use shamela_get_pages_range; for full chapters use shamela_get_book_section', plus the prerequisite that the book must be downloaded. An agent knows exactly when to pick this tool versus its alternatives.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
shamela_get_page_servicesPage cross-referencesARead-onlyIdempotentInspect
إشارات الصفحة
Read the per-page service markers (Qur'anic verses cited, hadith keys, isnād markers) for a specific (book_id, page_id). Returns has_services plus ayat (cumulative aya_ids), hadeeth (hadith keys), esnad and esnad_count. NOTE: esnad entries are Shamela's RAW markers — «02464 s 2651 3234 1580 …» is a hadith key, a marker, then internal narrator IDS, not names, and they mean nothing on their own; call shamela_get_isnad(book_id, page_id) to get the same chains resolved to narrator names, death years and variant routes. Many books — particularly non-hadith works — have no services and return has_services:false cleanly. Useful to pivot from a search hit to what it cites: pair aya_ids with shamela_get_aya, or hadith keys with shamela_get_books_for_hadith.
| Name | Required | Description | Default |
|---|---|---|---|
| book_id | Yes | The book id. | |
| page_id | Yes | The page id. | |
| response_format | No | Output 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 |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already declare readOnly/idempotent/non-destructive, so the bar is lower, but the description adds real behavioral value: it explains that esnad entries are Shamela's raw markers and 'mean nothing on their own', warns of the format, and discloses the clean has_services:false path for many books. It stops short of covering response shape or budget behavior beyond the schema's own note.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The key purpose and the raw-marker caveat are front-loaded, and each sentence carries information (return fields, warning, follow-up routes). It is denser than strictly necessary, but nothing is filler.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
With no output schema, the description fully carries the burden of explaining the return shape (has_services, ayat, hadeeth, esnad, esnad_count) plus the interpretation caveat and next-step tools. An agent has everything needed to call it and act on the result.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
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 identifies book_id/page_id and reused field meanings but adds no syntax or constraint detail beyond the schema; the response_format parameter's semantics live entirely in the schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The opening states a specific verb+resource: read per-page service markers (Qur'anic verses, hadith keys, isnād markers) for a (book_id, page_id). It enumerates the return fields and explicitly distinguishes itself from shamela_get_isnad, so an agent can separate it from siblings without opening a schema.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
It gives explicit when-to-use (pivot from a search hit to what the page cites), names the follow-up alternatives (shamela_get_aya for aya_ids, shamela_get_books_for_hadith for hadith keys, shamela_get_isnad for resolved chains), and warns when-not (non-hadith books return has_services:false). Nothing is left to inference.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
shamela_get_pages_rangeRead a range of pagesARead-onlyIdempotentInspect
جلب نطاق صفحات
Fetch N (1–20, default 5) consecutive pages from a downloaded book starting at start_page_id. Faster than calling shamela_get_page in a loop. Each page entry has page_id, printed_page, part, body, foot, comment. has_more flag indicates whether more pages exist after the returned range. Very long ranges are cut short to stay within a size budget; when that happens the response sets next_start_page_id and a _display hint — continue from there. For full chapters use shamela_get_book_section instead — it knows where the chapter ends. Example: shamela_get_pages_range({book_id:, start_page_id:1, count:5}). Find downloaded book ids via shamela_list_downloaded_books.
| Name | Required | Description | Default |
|---|---|---|---|
| count | No | How many consecutive pages to fetch (1–20, default 5). Use shamela_get_book_section for full chapter reads. | |
| book_id | Yes | The book id. | |
| keep_html | No | Preserve inline HTML markers. | |
| start_page_id | Yes | First page_id (inclusive). | |
| response_format | No | Output 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 |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already declare read-only, idempotent, non-destructive, closed-world behavior, yet the description still adds real context: the size-budget truncation rule, the next_start_page_id and `_display` continuation hint, and the has_more flag. It also enumerates the returned page fields, which no structured field supplies.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Front-loaded with the core action and bounded by an example, with each sentence carrying distinct information (defaults, truncation, alternative). Minor waste in the Arabic opener that restates the title rather than adding meaning.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
With no output schema, the description carries the return-shape burden and discharges it by naming the per-page fields, the has_more flag, and the truncation continuation keys. A caller has everything needed to invoke it and to resume a cut-short range.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100%, so the baseline is 3, but the description adds value the schema does not: it restates the 1–20/default-5 constraint in context and points to shamela_list_downloaded_books for obtaining book_id. count and start_page_id semantics are otherwise fully owned by the schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
States a specific verb and resource: fetch N consecutive pages from a downloaded book starting at start_page_id. It explicitly names two siblings it is not — shamela_get_page (loop) and shamela_get_book_section (full chapters) — so an agent can disambiguate without opening any schema.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Gives explicit when-to-use ('Faster than calling shamela_get_page in a loop'), a when-not with the alternative named ('For full chapters use shamela_get_book_section instead'), and the prerequisite discovery path via shamela_list_downloaded_books. Nothing about selection is left to inference.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
shamela_get_tafseer_of_ayaTafsir of an ayahARead-onlyIdempotentInspect
تفاسير آية
Given a Qur'anic verse, list every tafsir book in the catalog that has a page commenting on it. Uses Shamela's pre-built service/tafseer.db join. Pass either aya_id (1..6236) OR surah+aya. By default returns only books the user has downloaded locally (downloaded_only=true) — set to false to see the full catalog of tafsirs that COULD comment on this verse if downloaded. Each result has book_id, book_name, author_name, page_id, downloaded flag. Pair with shamela_get_page(book_id, page_id) to read the actual tafsir text. NOTE: this uses a CURATED service index that may omit downloaded tafsirs (many tafsirs carry no per-page aya markers) — on some installs it returns only al-Tabari. For the user's full tafsir picture, also list downloaded books in the tafsir categories via shamela_list_downloaded_books(category_id=3) and (category_id=4); see coverage_note in the result.
| Name | Required | Description | Default |
|---|---|---|---|
| aya | No | Aya within surah. | |
| surah | No | Surah number, paired with `aya`. | |
| aya_id | No | Aya id 1..6236. | |
| downloaded_only | No | If true (default), only return books the user has downloaded locally. | |
| response_format | No | Output 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 |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already cover the safety profile (readOnly/idempotent/non-destructive), and the description adds genuinely new behavioral context: it depends on a pre-built service/tafseer.db join, uses a CURATED index that can omit downloaded tafsirs, may degrade to only al-Tabari on some installs, and surfaces a coverage_note in the result. That is exactly the kind of limitation disclosure an agent needs before trusting the output.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Front-loaded with purpose, then addressing modes, default behavior, and the caveat. Dense but each sentence carries information. Slightly long, though the length is justified by the real coverage caveat rather than filler.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
No output schema exists, and the description compensates by enumerating the result fields (book_id, book_name, author_name, page_id, downloaded flag) and the coverage_note. Combined with the pairing instructions and index caveat, an agent has everything needed to call and interpret it.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
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 nonetheless adds meaning beyond the literal schema text, interpreting downloaded_only=false as 'the full catalog of tafsirs that COULD comment on this verse if downloaded', and clarifying the aya_id vs surah+aya addressing choice.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
States a specific verb and resource with scope: 'list every tafsir book in the catalog that has a page commenting on it' given a Qur'anic verse. The scope (books, not tafsir text) is clear. However, it never distinguishes itself from the near-identical sibling shamela_list_tafsirs_for_aya or from shamela_get_tafseer_texts, which an agent could easily confuse.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Explicitly states the two mutually exclusive addressing modes (aya_id OR surah+aya), the default filter behavior (downloaded_only=true) and when to flip it, and routes the agent to companions: shamela_get_page(book_id, page_id) to read the text, and shamela_list_downloaded_books(category_id=3)/(category_id=4) for the full picture. The condition under which each alternative applies is spelled out.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
shamela_get_tafseer_textsTafsir texts for an ayahARead-onlyIdempotentInspect
جلب نصوص تفسير آية
Fetch the actual tafsir texts of one aya across multiple sources in a single call. Strictly index-driven: fetches ONLY pages the curated service/tafseer.db maps to this aya (no text-search fallback — it misattributes verses via shared phrases and the basmala). Pass either aya_id OR surah+aya; optional book_ids restricts sources, max_sources (default 5) caps how many are fetched. Each source carries embedded attribution (book_name, author, death_year, printed_page, page_id) plus continuation: text_part/text_total_parts/text_has_more for long pages and next_page_id for commentary spanning pages — read the per-source note, which names the exact follow-up call, rather than assuming body_part=2. verse_located_in_page says whether the text was cut to START at your verse: when a tafsir quotes the same words several times on one page (a refrain like «فبأي آلاء ربكما تكذبان») and the printed verse numbers do not settle which copy is yours, it returns false with a note and gives you the whole page instead of confidently returning a neighbouring verse's commentary. Requested book_ids absent from the index get an explicit status ('not_indexed' / 'no_entry_for_this_aya') with no text. The overall response respects a character budget; when cut, remaining_book_ids + a _display hint say how to continue. Use shamela_list_tafsirs_for_aya first to see coverage. Examples: shamela_get_tafseer_texts({surah:2, aya:255}), shamela_get_tafseer_texts({surah:2, aya:255, book_ids:[<book_id from shamela_list_tafsirs_for_aya with status 'indexed_covers'>], max_sources:2}).
| Name | Required | Description | Default |
|---|---|---|---|
| aya | No | Aya within surah. | |
| surah | No | Surah number, paired with `aya`. | |
| aya_id | No | Aya id 1..6236. | |
| book_ids | No | Restrict to these tafsir books. Books not present in the curated index for this aya are reported with an explicit status instead of text. Use shamela_list_tafsirs_for_aya to see which books the index covers. | |
| max_sources | No | Maximum number of sources to fetch text for (1-10, default 5). | |
| response_format | No | Output 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 |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Far exceeds the readOnly/idempotent annotations: it explains the strict index-driven behavior, the deliberate absence of a text-search fallback and why (verse misattribution via shared phrases/basmala), explicit statuses for unindexed books, a character budget with continuation hints, and the semantics of verse_located_in_page and the per-source note. This is unusually rich behavioral disclosure.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Purpose is front-loaded in the opening line and the dense material is largely load-bearing (statuses, continuation, the verse_located_in_page rationale). It is still a very thick paragraph whose parenthetical explanations run long, so it is efficient but not maximally scannable.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
With no output schema, the description carries the full return-value burden and does so thoroughly: it enumerates the per-source attribution fields (book_name, author, death_year, printed_page, page_id), continuation fields (text_part/text_total_parts/text_has_more, next_page_id), status strings, and the budget/continuation protocol. An agent has what it needs to call and continue correctly.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100%, so the baseline is 3, but the description adds a genuine cross-parameter constraint the schema cannot express: pass EITHER aya_id OR surah+aya. It also restates max_sources default and explains book_ids status behavior, giving it an edge over pure schema duplication.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
States a specific verb and resource — 'Fetch the actual tafsir texts of one aya across multiple sources in a single call' — and adds scope detail (multi-source, index-driven). It routes away from the search tools but never explicitly distinguishes itself from the very close sibling shamela_get_tafseer_of_aya, leaving an ambiguity an agent must resolve on its own.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Gives a concrete workflow ('Use shamela_list_tafsirs_for_aya first to see coverage'), the alternative parameterization (aya_id OR surah+aya), and two worked examples. It clearly frames when the index-driven path is required versus a text search, but does not state when to prefer this over the near-identical sibling shamela_get_tafseer_of_aya.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
shamela_get_tocGet a book's table of contentsARead-onlyIdempotentInspect
جلب فهرس الكتاب
Fetch a downloaded book's table of contents. Two modes: (a) subtree mode (default) — pass parent_id (0 = top level) and depth (1–5) to get a tree of titles; (b) ancestor-chain mode — pass containing_page_id to get the root → leaf chapter chain that contains that page. Returns title_id, title_text, page_id, has_children for each entry. Use the title_id with shamela_get_book_section to read the section. Examples: shamela_get_toc({book_id:, depth:1}) lists top-level chapters; shamela_get_toc({book_id:, containing_page_id:17}) returns the chapter containing page 17. Find downloaded book ids via shamela_list_downloaded_books or shamela_resolve.
| Name | Required | Description | Default |
|---|---|---|---|
| depth | No | How many levels deep to recurse (1–5, default 1). | |
| book_id | Yes | The book id. | |
| parent_id | No | Title id whose children to expand. 0 (default) returns top-level chapters. | |
| response_format | No | Output 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 |
| containing_page_id | No | Alternate mode: instead of returning a subtree, return the ancestor chain (root → leaf chapter) for this page. |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already cover the safety profile (readOnly, idempotent, non-destructive), so the description's job is to add operational context — it discloses the return fields (title_id, title_text, page_id, has_children), the two-mode behavior, and depth recursion semantics. It stops short of discussing pagination or large-book limits, so it is strong but not exhaustive.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Front-loads the purpose, then modes, then return shape, then examples — a clean information hierarchy. Slightly long because it carries two examples and a mode enumeration, but each sentence earns its place. The duplicated Arabic title line is minor padding.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
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 carries the return-value burden and does so by enumerating the per-entry fields. Combined with dual-mode explanation, id-lookup guidance, and downstream usage, an agent has everything needed to invoke and interpret this correctly.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
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, but the description adds cross-parameter semantics the schema cannot express — that parent_id=0 means top level, that depth 1–5 controls tree recursion, and that containing_page_id switches modes entirely. Worked examples with concrete values reinforce this.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
States a specific verb+resource ('Fetch a downloaded book's table of contents') and explicitly distinguishes itself from sibling shamela_get_book_section, which it routes users to for reading the section. An agent can tell what this returns without opening the schema.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Gives explicit modes with the conditions that select each: subtree mode (default, via parent_id/depth) vs ancestor-chain mode (via containing_page_id). It also names the alternative tools for finding book ids (shamela_list_downloaded_books, shamela_resolve) and the downstream consumer (shamela_get_book_section).
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
shamela_list_categoriesList library categoriesARead-onlyIdempotentInspect
قائمة التصنيفات
List all 41 categories in Shamela's catalog. Categories are flat (no parent_id, no transitive expansion). Each entry has category_id, category_name, and book_count (total books in catalog under that category). Use category_id values with scope.category_ids in search_pages / search_books to narrow searches. Set include_counts=false to skip the book counts (slightly faster but counts are cached so cost is negligible). Each entry also reports downloaded_count (books in that category present on THIS machine), and downloaded_only=true lists only categories where the user has downloads — useful because Shamela is a 41-category library and tafsir alone spans categories 3 (التفسير), 4 (علوم القرآن وأصول التفسير), and 5 (التجويد والقراءات).
| Name | Required | Description | Default |
|---|---|---|---|
| include_counts | No | If true (default), include book_count for each category. Costs nothing — counts are precomputed. | |
| downloaded_only | No | If true, list only categories where the user has at least one book downloaded locally. Useful to see where this install's library is concentrated across the 41 categories. | |
| response_format | No | Output 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 |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already declare read-only, idempotent, closed-world, non-destructive, so the safety profile is covered. The description adds genuine behavioral context beyond that: counts are precomputed/cached so include_counts=false yields negligible savings, categories are flat with no transitive expansion, and downloaded_count is machine-local rather than catalog-wide.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Core purpose is front-loaded and the flag guidance is efficiently packed. There is mild redundancy — '41 categories' appears three times and the Arabic heading restates the title — but the tafsir example and cost note each earn their place.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
With no output schema, the description carries the return-value burden and does so, naming category_id, category_name, book_count, and downloaded_count. Combined with annotations covering safety and the schema fully describing all three parameters, an agent has everything needed to call this correctly.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
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 still adds meaning: it explains the performance tradeoff of include_counts and motivates downloaded_only with a concrete example (tafsir spanning categories 3, 4, and 5), which is information the enum/default schema alone does not convey.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The opening sentence states a specific verb and resource (list all 41 categories in Shamela's catalog) and adds the flat-structure detail, which distinguishes it from any hierarchy/expansion query. It doesn't name a sibling alternative, but the operation is unambiguous against neighbors like shamela_search_titles or shamela_get_toc.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description explicitly tells the agent what to do with the output ('Use category_id values with scope.category_ids in search_pages / search_books') and when each flag helps ('downloaded_only=true ... useful because ...'). It stops short of saying when to prefer this tool over sibling catalog/search tools, so it's clear context without exclusions.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
shamela_list_tafsirs_for_ayaTafsir coverage of an ayahARead-onlyIdempotentInspect
تغطية تفاسير آية
Per-aya tafsir coverage report: cross-references the user's DOWNLOADED tafsir shelves (categories 3 AND 4 — tafsir spans both) against the curated service/tafseer.db index and reports an honest tri-state per book. status='indexed_covers' — the index maps this aya to a page in this book (page_id + printed page included); 'indexed_no_entry_for_this_aya' — the book participates in the index but has no entry for this aya; 'not_indexed_coverage_unknown' — the book is absent from the curated index, so coverage CANNOT be determined (explicitly NOT evidence the book lacks commentary on the verse). Index hits outside categories 3/4 (e.g. mawsuʿat) are included and marked in_tafsir_categories:false. Pass either aya_id (1..6236) OR surah+aya. Returns totals per status and a note about the curated-index limitation. Never text-searches; navigate unknown-status books via shamela_get_toc. Examples: shamela_list_tafsirs_for_aya({surah:2, aya:255}), shamela_list_tafsirs_for_aya({aya_id:262}).
| Name | Required | Description | Default |
|---|---|---|---|
| aya | No | Aya within surah. | |
| surah | No | Surah number, paired with `aya`. | |
| aya_id | No | Aya id 1..6236. | |
| response_format | No | Output 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 |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already declare safe read-only idempotency, and the description adds substantial semantics beyond them: the exact tri-state vocabulary and what each state means, the warning that 'not_indexed_coverage_unknown' is explicitly NOT evidence of missing commentary, the category 3/4 scoping and the in_tafsir_categories:false marker for out-of-category hits. It also discloses the return shape (totals per status plus a curated-index caveat note).
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Front-loaded with the purpose, then the tri-state definitions, then parameters, navigation escape hatch, and examples. The tri-state enumeration is dense but each clause carries load; the bilingual Arabic title line is mildly redundant with the English title.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
No output schema exists, yet the description covers the return contents (per-book tri-state with page_id and printed page, totals per status, index-limitation note) and the idempotent read semantics. An agent has everything needed to call it and interpret the result correctly.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100%, so the baseline is 3, but the description adds the mutual-exclusivity/alternative semantics (aya_id OR surah+aya) that the all-optional, zero-required schema does not itself express, plus concrete value examples. The response_format capability requirement is already fully documented in the schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
States a specific verb and resource — a per-aya tafsir coverage report that cross-references the user's downloaded tafsir shelves (categories 3 and 4) against the curated tafseer.db index. It also draws its boundary against siblings by declaring 'Never text-searches', distinguishing it from shamela_get_tafseer_of_aya and shamela_get_tafseer_texts.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Gives explicit calling modes ('Pass either aya_id (1..6236) OR surah+aya'), two concrete examples, and routes the agent to shamela_get_toc for books in unknown-status. It does not, however, explicitly say when to prefer this over the tafseer-text siblings, leaving that to inference from 'Never text-searches'.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
shamela_reconSurvey a topic across the libraryARead-onlyIdempotentInspect
استكشاف: حجم الموضوع في المكتبة وأين يقع
Round-zero reconnaissance: how much does this library actually hold on a topic, and on which shelves, BEFORE a retrieval plan is committed to. Same measurement as shamela_root_stats but mode defaults to 'literal' — counting pages that carry the WORD as written rather than every AlKhalil root reading of it. That difference is the point: «الاستصناع» reports 393,498 pages across 7,405 books morphologically and 1,510 literally, and the first answer says every shelf holds the topic, which is not a plan. Returns the EXACT page total plus the distribution by category, Hijri century, book and author, in 6-9 ms. Read the distribution as corpus size PLUS topic, never as authority: التفسير tops nearly every profile because tafsir is simply the largest body of text here, not because it is where the question is answered. Use the by_category ranking to choose scope.category_ids for the searches that follow. Examples: shamela_recon({root:'الاستصناع'}), shamela_recon({root:'التيمم', scope:{citable_only:true}}).
| Name | Required | Description | Default |
|---|---|---|---|
| mode | No | 'literal' counts pages carrying the WORD as written (plus the ordinary spelling folds). 'morphological' expands it to every AlKhalil root reading and counts those — which is far broader than most callers expect: «الاستصناع» reports 393,498 pages across 7,405 books morphologically against 1,510 literally, an answer that says every shelf holds the topic. Use 'literal' to size a topic before planning retrieval; use 'morphological' to trace a ROOT through its derivations. | literal |
| root | Yes | Arabic root or base word to profile (e.g. «صبر»، «رحم»، «علم»). Under mode='morphological' it is matched via the AlKhalil analyzer, so all derived forms (صابر، يصبر، اصطبار…) are counted, not just the literal string. | |
| scope | No | Restrict the profile to specific books, authors, categories, or a Hijri date range. Use shamela_list_categories / shamela_resolve to find IDs. Omit to profile the whole downloaded library. | |
| response_format | No | Output 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 |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Although annotations already declare the safety profile, the description adds substantial behavioral context: exact return composition, runtime (6–9 ms), the literal-vs-morphological counting difference with a concrete worked example, and a crucial interpretation caveat about tafsir inflating profiles. That goes well beyond what the 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.
Is the description appropriately sized, front-loaded, and free of redundancy?
The purpose is front-loaded and most sentences carry weight, including the comparison, return description, warning, and examples. It is somewhat long for a description and could be trimmed, but the complexity of the tool and nested scope justify the additional length.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
There is no output schema, so the description must carry the return-value burden, and it does: it describes the exact page total, distribution dimensions, and speed. Combined with the 100%-covered input schema and annotations covering safety, the description 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.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100%, so the schema already documents all parameters in depth. The description adds operational meaning by explaining that the by_category output should drive scope.category_ids in later searches and by showing scope usage in the examples, but it does not add much syntax beyond the schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description names a specific operation (round-zero reconnaissance) and a clear resource (topic coverage across the library), and explicitly distinguishes it from shamela_root_stats by noting the different default mode. An agent can tell what the tool produces and how it differs from the nearest sibling without opening either schema.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
It states the precise moment to use the tool: before committing to a retrieval plan. It also gives mode-selection guidance, warns against reading distribution as authority, and directs the caller to use the by_category ranking to set scope.category_ids for follow-up searches, which is explicit when-to-use and how-to-continue guidance.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
shamela_resolveResolve a name to an idARead-onlyIdempotentInspect
تحويل اسم إلى معرِّف
Disambiguate Arabic name fragments to book_ids and/or author_ids. Uses the pre-built s_book/ + s_author/ n-gram indexes for fast partial matching. type='book' searches only books, 'author' only authors, 'any' (default) both. Returns up to limit results per type with confidence scores. Use this BEFORE search_pages / search_books / search_authors when the user mentions a name but doesn't know the exact ID. Examples: shamela_resolve({query:'ابن قدامة'}) → returns the matching author_id(s) with confidence; shamela_resolve({query:'روضة الناظر'}) → returns book matches.
| Name | Required | Description | Default |
|---|---|---|---|
| type | No | 'book' searches the s_book/ index, 'author' searches s_author/, 'any' (default) searches both. | any |
| limit | No | Maximum results per type (1–20, default 5). | |
| query | Yes | Arabic name fragment to resolve. Use partial names: 'ابن قدامة' resolves Ibn Qudamah, 'الروضة' resolves books with that word in their title. | |
| response_format | No | Output 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 |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already declare readOnly/idempotent/non-destructive, so safety is covered. The description adds real behavioral context beyond that: it uses pre-built s_book/s_author n-gram indexes for partial matching and returns per-type results with confidence scores. It stops short of describing result ordering or ambiguity handling, but the value added is genuine.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The body is tight and front-loads the mechanism, the type behavior, and the redirect to sibling tools. The opening Arabic line "تحويل اسم إلى معرِّف" duplicates the title verbatim, which is a small piece of dead weight in an otherwise efficient description.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
With no output schema, the description carries the return-value burden and does state that it returns up to `limit` results per type with confidence scores, which is what an agent needs to consume the result. It could go slightly further on ordering/tie-breaking, but the essentials are present for this read-only resolver.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100% and both enums are documented in-schema, so the description's explanation of type='book'/'author'/'any' largely restates it. The examples for query add marginal color but the schema already carries the semantics. Baseline 3 is appropriate when the schema does the heavy lifting.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
States a specific verb (disambiguate/resolve) and resource (Arabic name fragments to book_ids/author_ids), and the opening line tells the agent exactly what outcome to expect. It distinguishes itself from search_pages/search_books/search_authors, which it explicitly names as the tools it precedes.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
"Use this BEFORE search_pages / search_books / search_authors when the user mentions a name but doesn't know the exact ID" gives an explicit when-to-use rule plus the alternative tools it replaces in that scenario. Nothing is left to inference.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
shamela_resolve_printed_pagePrinted page to library pageARead-onlyIdempotentInspect
ردُّ رقم الصفحة المطبوعة إلى صفحات البرنامج
Turn a printed citation — «vol. 4, p. 405» — into the internal page ids that carry it, in one indexed query. A printed page number and a page_id are different things with no arithmetic between them, so estimating an id and correcting it by reading is both slow and unreliable. Returns page_ids[]: ONE printed page routinely maps to SEVERAL ids (part='1', page=6 is ids 9, 10 and 11 in the fixture book) because Shamela splits a long printed page across records — read them all, since the first alone is a fragment quoted as the page. Failure is specific rather than null: 'book_not_downloaded', 'no_printed_pagination' (Shamela paginates this entry itself, so no printed page exists to find), 'part_not_found' (with available_parts), 'page_not_in_part' (with the range that does exist). citable false means the numbers are Shamela's own, not a published edition's. Omit part for a single-volume work or a citation with no volume; parts_matched then reports whether the number was ambiguous across volumes. Different printings paginate differently — resolve the title with shamela_resolve_work first and use the printing the citation came from. Examples: shamela_resolve_printed_page({book_id:1681, part:'1', page:6}), shamela_resolve_printed_page({book_id:6910, part:'4', page:405}).
| Name | Required | Description | Default |
|---|---|---|---|
| page | Yes | The PRINTED page number as the citation gives it (e.g. 405). | |
| part | No | The volume/part label as the book uses it, usually a bare number ('4'). Omit when the citation names no volume or the work is single-volume: the search then runs across every part and the response reports which parts matched, so an ambiguous page number is visible rather than silently resolved to the first volume. | |
| book_id | Yes | The book. Resolve a cited title with shamela_resolve_work first — and note that different printings of one work paginate differently, so the book_id must be the printing the citation came from. | |
| response_format | No | Output 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 |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Adds substantial context beyond the readOnly/idempotent/destructive annotations: the cardinality warning that one printed page maps to several ids and all must be read, the specific error taxonomy ('book_not_downloaded', 'no_printed_pagination', 'part_not_found', 'page_not_in_part'), and the meaning of `citable` false. This is exactly the behavior an agent cannot 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.
Is the description appropriately sized, front-loaded, and free of redundancy?
Front-loaded with the core purpose and the cardinality warning early, then failure modes, then parameter notes and examples. It is dense and nearly every sentence earns its place, though the leading Arabic line restating the title is redundant padding.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
There is no output schema, yet the description discharges that burden by naming the return field (`page_ids[]`), its multiplicity semantics, and supporting fields (`parts_matched`, `citable`). Combined with the failure taxonomy, an agent has everything needed to call and interpret the result.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100%, so the schema already documents the four parameters; the description nonetheless adds meaning the schema lacks, notably that different printings paginate differently, that omitted `part` triggers an ambiguity report via `parts_matched`, and worked examples of parameter shapes. It repeats some schema content but the incremental value is real.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
States a specific verb and resource ('turn a printed citation into the internal page ids') and explicitly frames the transformation problem (a printed page number and a page_id have no arithmetic between them), which distinguishes it from siblings like shamela_get_page and shamela_resolve_work. An agent can tell exactly what this tool produces without opening the schema.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Gives clear prerequisites and routing: resolve the title with shamela_resolve_work first, use the printing the citation came from, and omit `part` for single-volume works. It doesn't explicitly state when NOT to use the tool, so it stops short of the top band, but the workflow guidance is concrete.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
shamela_resolve_workIdentify a cited workARead-onlyIdempotentInspect
تحديد الكتاب المُحال إليه
Resolve a CITED work — title, optional author, optional edition — to the catalogue entry it names, or refuse. Use this instead of shamela_resolve whenever a citation is being verified: shamela_resolve RANKS, and a ranking always produces a winner, so an ambiguous request comes back as a confident wrong answer. Three guarantees. (1) The requested title must be a PREFIX of the candidate's title: «شرح صحيح البخاري», «المدخل إلى صحيح البخاري» and «عمدة القاري شرح صحيح البخاري» all contain the work's name and none of them IS the work — a commentary is another author writing about it, and quoting one as the work attributes his words to al-Bukhari. (2) author is a FILTER, not a hint: a candidate whose author cannot be reconciled with it is rejected and listed in rejected[], never ranked down. (3) A requested edition that no entry carries returns status='not_found' with reason='edition_not_found' plus available_editions[] — never a different book. status is 'exact' (one entry, in match), 'ambiguous' (several — ambiguity:'edition' means one work in several printings, so pass every book_id as one scope; ambiguity:'work' means DIFFERENT books, and nothing may choose between them: «المغني» is al-Dhahabi's book of weak narrators and Ibn Qudama's fiqh), or 'not_found'. Catalogue-only, no index, no library read. Examples: shamela_resolve_work({title:'صحيح البخاري - ط السلطانية'}), shamela_resolve_work({title:'المغني', author:'ابن قدامة'}).
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Maximum candidates to report (1-50, default 20). | |
| title | Yes | The work's title as cited, e.g. «صحيح البخاري», «المغني», «فتح الباري». Leading words only — the title, not a description of it. You may include the catalogue's own edition tail, with the « - » («صحيح البخاري - ط السلطانية») or without it («مسند أحمد ط الرسالة»), and it will be read as `edition`. An author name appended instead («صحيح البخاري محمد بن إسماعيل البخاري», «الهداية للمرغيناني») is read as `author`. Where a title is held by more than one author, a trailing edition is NOT read as one until you also pass `author` — «صحيح البخاري ت البغا» alone is refused, «صحيح البخاري ت البغا» + author «البخاري» resolves. | |
| author | No | The author as cited, when known. This is a FILTER, not a hint: a candidate whose author cannot be reconciled with it is rejected rather than ranked down, because that is exactly how a commentary gets returned as the work it comments on. | |
| edition | No | A specific printing, as the catalogue names it: 'ط السلطانية', 'ت البغا', 'ط التأصيل'. If no entry carries it you get status='not_found' with reason='edition_not_found' and the editions that DO exist — never a different book. | |
| response_format | No | Output 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 |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already declare readOnly/idempotent/closed-world, and the description adds genuinely non-obvious behavior on top: three prefix/author/edition guarantees, the refusal contract, the `rejected[]` vs ranked-down distinction, the ambiguity:'edition' vs ambiguity:'work' split, and the explicit 'catalogue-only, no index, no library read' scope limit.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Front-loaded with the key contrast against `shamela_resolve`, then the three numbered guarantees, then status semantics, then examples — a sensible order. It is long and repeats some schema content, but for a tool with three subtle matching rules and no output schema, most sentences carry weight.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
With no output schema, the description carries the full burden of describing returns — status values ('exact'/'ambiguous'/'not_found'), the reason code, `match`, `rejected[]`, and `available_editions[]` are all explained. Combined with the refusal contract and scope limits, an agent has everything needed to call and interpret it.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100% and each parameter already carries a rich description (title's edition-tail/author-append rules, author-as-FILTER, edition miss behavior, response_format capability). The description largely restates this, adding the concrete example calls but no syntax or constraints the schema lacks — baseline 3 is appropriate.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
States a specific verb and resource — resolving a CITED work (title + optional author/edition) to a catalogue entry — and explicitly distinguishes itself from sibling `shamela_resolve`, noting that the other RANKS while this one refuses ambiguity. An agent can pick between the two siblings without opening either schema.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Gives an explicit when-to-use rule ('Use this instead of `shamela_resolve` whenever a citation is being verified') plus the reason (ranking always produces a confident winner, so ambiguity yields a wrong answer). When-not semantics are implicit in the refusal behavior but the routing condition is unambiguous.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
shamela_root_statsArabic root frequency across the libraryARead-onlyIdempotentInspect
انتشار جذر في المكتبة
Profile how widely an Arabic root spreads across the DOWNLOADED library, aggregated by category / Hijri century / book / author. Runs ONE morphological (AlKhalil) page search for the root — all derived forms are counted (صابر/يصبر/اصطبار for صبر) — and returns the DISTRIBUTION only, not snippets. total_hits is EXACT; the by-category/century/book/author breakdown is built from at most 5,000 top-scoring hits (COVERAGE_CAP), so when coverage_capped is true the bucket counts are floors and shares are indicative. Morphology accuracy on classical Arabic is ~0.80 — read counts as reach, not exact tallies. Pass scope to profile a slice. Examples: shamela_root_stats({root:'صبر'}), shamela_root_stats({root:'رحم', scope:{category_ids:[17]}}).
| Name | Required | Description | Default |
|---|---|---|---|
| mode | No | 'literal' counts pages carrying the WORD as written (plus the ordinary spelling folds). 'morphological' expands it to every AlKhalil root reading and counts those — which is far broader than most callers expect: «الاستصناع» reports 393,498 pages across 7,405 books morphologically against 1,510 literally, an answer that says every shelf holds the topic. Use 'literal' to size a topic before planning retrieval; use 'morphological' to trace a ROOT through its derivations. | morphological |
| root | Yes | Arabic root or base word to profile (e.g. «صبر»، «رحم»، «علم»). Under mode='morphological' it is matched via the AlKhalil analyzer, so all derived forms (صابر، يصبر، اصطبار…) are counted, not just the literal string. | |
| scope | No | Restrict the profile to specific books, authors, categories, or a Hijri date range. Use shamela_list_categories / shamela_resolve to find IDs. Omit to profile the whole downloaded library. | |
| response_format | No | Output 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 |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already declare a safe read profile, so the bar is lower; yet the description adds substantial context beyond them: it discloses the one-search execution, the 5,000-hit COVERAGE_CAP and that bucket counts become floors, that total_hits is exact, and the ~0.80 morphological accuracy caveat. This is exactly the behavioral context an agent needs to interpret results correctly.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Front-loads the core purpose, then tight caveats (cap, accuracy, scope), then two concrete call examples. Every sentence earns its place and nothing is redundant.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given a nested scope object, no output schema, and a mutation-free read operation, the description covers purpose, cost/cap behavior, accuracy limits, and scoping, including worked examples. Nothing essential for correct invocation or interpretation is missing.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100% and includes rich enum/mode semantics, so the baseline is 3. The description adds the derived-forms example (صابر/يصبر/اصطبار) and scope slicing, but mostly reiterates what the schema already documents in depth.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
States a specific verb (profile) and resource (Arabic root distribution across the library), with an explicit enumerated aggregation (by category / Hijri century / book / author). This clearly distinguishes it from search/retrieval siblings like shamela_search_pages or shamela_get_page, which return snippets rather than a distribution.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Implies when to use it (profiling spread of a root, not retrieving snippets) and gives examples plus scope slicing. However it never names an alternative sibling for the closely related task of actually retrieving pages on a topic, leaving some routing inference to the agent.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
shamela_search_authorsSearch the author catalogueARead-onlyIdempotentInspect
بحث في فهرس المؤلفين
Search Shamela's ~3,200-author catalog by name or biography text. Pre-built index — no downloads needed. No scope (authors aren't scoped by category/period). Returns author name, Hijri death year, and book count. options.sort:'chronological' orders by death year, earliest first. Arabic scholars go by several name forms — when a query misses, try the kunya, nisba, and shuhra variants before concluding absence (جرّب الكنية والنسبة والشهرة: ابن قدامة / الموفق / المقدسي). Use the resulting author_id with shamela_get_author for full details, or with scope.author_ids in shamela_search_pages/_books to filter by that author. Examples: shamela_search_authors({query:'ابن قدامة'}), shamela_search_authors({query:'الشافعي', options:{wildcards:false}}).
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Maximum number of results to return (1-100, default 20). | |
| query | Yes | Arabic search phrase matched against author name + biography. | |
| offset | No | Number 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. | |
| options | No | morphology / wildcards. No scope (authors aren't scoped by category/period). | |
| response_format | No | Output 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 |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already establish readOnly/idempotent/non-destructive, so the description's job is to add context — which it does by disclosing the pre-built index (no downloads), the absence of scope filtering, the exact return shape, and the chronological sort behavior. It doesn't discuss result-set size limits or how absence/misses surface beyond the naming heuristic, so it falls slightly short of full behavioral coverage.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Purpose is front-loaded, the bilingual heading is compact, and the workflow plus examples are ordered sensibly. It loses a point for redundancy: 'No scope (authors aren't scoped by category/period)' appears both in the body and verbatim inside the options description.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a 5-parameter nested-object search with no output schema, the description covers what is searched, what is returned, the sort semantics, the naming-variant edge case, and the next tool to call — while annotations carry the safety profile. 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.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, with limit/offset/options fully documented in the schema, so the baseline is 3. The description reinforces options.sort ('chronological' orders by death year, earliest first) and demonstrates options.wildcards in an example, but adds no parameter detail the schema lacks.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
States a specific verb and resource ('Search Shamela's ~3,200-author catalog by name or biography text'), names the return fields (author name, Hijri death year, book count), and differentiates itself from the page/book search siblings by noting authors carry no category/period scope. An agent can tell exactly what this tool does without opening the schema.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Explicitly routes the agent downstream: use the resulting author_id with shamela_get_author for details, or with scope.author_ids in shamela_search_pages/_books. It also gives a concrete recovery heuristic for misses (try kunya, nisba, shuhra variants before concluding absence) and two runnable examples.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
shamela_search_batchBatch search (several queries)ARead-onlyIdempotentInspect
بحث مجمَّع بعدة استعلامات
Run up to 12 scoped searches in ONE call and get back a single merged, deduplicated result set. Built for assembling evidence for one question from several wordings at once: each probe is {query, mode:'and'|'phrase'|'near', scope, limit}, they execute concurrently, and pages found by more than one probe are returned ONCE with every probe id that found them (probe_ids) — which is corroboration across wordings, not a duplicate. Every row carries match_quality ('exact_phrase'|'near'|'all_terms'|'relaxed') and matched_in_section ('body'|'footnote'|'both') so a near miss can never be read as a located quotation once results are merged, and a modern editor's footnote is never quoted as the author's own words. Every row also carries work_group_id, and edition_groups names any work present here under several catalog entries — read those as ONE source, not as several that corroborate each other. scope is REQUIRED on every probe (one of book_ids/author_ids/category_ids/madhab): unscoped, Lucene ranks by term frequency across all 8,594 books, so «التيمم» returns a poetry anthology ahead of the fiqh manuals. A probe that fails or times out is reported in its own slot and does NOT discard the others; incomplete is then true and a thin result must NOT be read as the library being silent. Each completed probe carries qualifiers — terms_truncated, zero_hit_terms, respelled_terms, paging_ceiling, coverage.at_cap, candidate_cap_hit, scope_resolution, unattributable_books — the same caveats the single-call search returns, per probe; the block is present only on status:'ok', so a probe WITHOUT it has not been checked and must not be recorded as searched. scope_resolution.dropped lists book ids the catalogue does not hold, which were never searched — the guard against reading an invented id's silence as the library's. Example: shamela_search_batch({probes:[{query:'الوتر واجب', scope:{category_ids:[14,19], citable_only:true}}, {query:'حكم صلاة الوتر', mode:'near', distance:5, scope:{madhab:'hanafi'}}]}).
| Name | Required | Description | Default |
|---|---|---|---|
| shape | No | How much of each hit to return. 'full' (default) is every field on every row, including the snippets — ask for this when the answer will QUOTE the page. 'brief' keeps book_id/page_id, printed_page, match_quality and matched_in_section and hoists book metadata into a top-level `books` dictionary keyed by book_id, but carries NO snippet: it answers which pages these are, how well each matched and how to cite them, for a fraction of the characters, so far more rows survive the budget. 'index' returns book_id/page_id only, for choosing what to read before paying to read it. Requires the 'shape.full_brief_index' capability (see shamela_brief). | full |
| probes | Yes | The searches to run. They execute concurrently and their results are merged, deduped by (book_id, page_id) and attributed back to the probes that found each page. | |
| deadline_ms | No | Wall-clock budget for the whole batch. Probes still running when it expires are reported with status='timeout' and contribute nothing. A timeout is NOT a negative finding — it means the question was not fully asked. | |
| response_format | No | Output 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 |
| max_total_passages | No | Hard cap on merged rows returned. Rows are ordered by match quality then probe agreement before the cut, so the cap drops the weakest evidence rather than an arbitrary tail. `truncated` says whether it fired. |
Output Schema
| Name | Required | Description |
|---|---|---|
| books | No | |
| probes | No | |
| by_book | No | |
| results | No | |
| truncated | No | |
| incomplete | No | |
| rows_dropped | No | |
| edition_groups | No | |
| truncation_message | No | |
| total_unique_passages | No |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations cover safety (readOnly, idempotent, etc.), but the description adds substantial operational context: a probe failure does not discard the others, `incomplete` flags a thin result, `qualifiers` are present only on status:'ok' and a probe without them has not been checked, `scope_resolution.dropped` exposes invented ids, and deduplication is by (book_id, page_id) with `probe_ids` showing corroboration. This is exactly the kind of behavior beyond annotations that helps an agent interpret results correctly.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is long but front-loaded: the first sentence states the purpose and scale, the second explains the merge and deduplication, and the third describes the output metadata. It is dense but each sentence carries unique, useful information. The example at the end is helpful. Slightly over-long for a description, but the length is justified by the tool's complexity and the need to prevent misreading of merged results.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's complexity (batch of up to 24 probes, nested scope objects, merged output with metadata like `match_quality`, `matched_in_section`, `probe_ids`, `work_group_id`), the description is remarkably complete. It explains execution model, scope requirements, deduplication, timeout handling, and how to interpret caveats. With an output schema present, it appropriately does not repeat field returns but instead teaches how to read them correctly in a merged context.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100%, so the baseline is 3. However, the description adds meaning beyond the schema by explaining the required nature of `scope` ('unscoped, Lucene ranks by term frequency across all 8,594 books...') and the practical impact of `limit`, `max_total_passages`, and `deadline_ms` (timeout behavior). It also clarifies `mode` semantics and the concurrent execution model, which are not obvious from field names alone.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
Opens with a specific verb and resource: 'Run up to 12 scoped searches in ONE call and get back a single merged, deduplicated result set.' It then distinguishes itself from the sibling single-query search tools by naming the exact use case – assembling evidence for one question from several wordings at once – which is something shamela_search_pages or shamela_search_phrase cannot do.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Explicitly when-to-use ('Built for assembling evidence for one question from several wordings at once') and when-not-to-use ('do not read absence as "no school said this"; for comparative questions leave madhab unset and scope by category instead'). It also warns that a timeout is not a negative finding, which is a critical selection rule.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
shamela_search_booksSearch the book catalogueARead-onlyIdempotentInspect
بحث في فهرس الكتب
Search Shamela's catalog of ~8,500 books by name, author, bibliography text, OR the editorial description of what the book is about (1,729 entries carry one, averaging ~1,500 characters). That last field is what finds a book by SUBJECT rather than title: «الرجز» matches 0 titles and 2 descriptions. Each hit reports matched_in: 'bibliography' (title/author/publication line) or 'description'. Pre-built index — works even before any books are downloaded. scope.book_ids is not accepted (the catalog IS the universe); use scope.author_ids, category_ids, period_*, downloaded_only. Returns paginated results with book name, author, category, book_date, downloaded flag, and a snippet showing the matched text. Examples: shamela_search_books({query:'الأصول'}), shamela_search_books({query:'فقه', scope:{category_ids:[17], downloaded_only:true}}).
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Maximum number of results to return (1-100, default 20). | |
| query | Yes | Arabic search phrase matched against the book name + author + bibliography concatenation. | |
| scope | No | Optional: restrict to specific authors, categories, periods, or downloaded-only. | |
| offset | No | Number 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. | |
| options | No | morphology / wildcards / relax_when_empty / preserve_*. | |
| response_format | No | Output 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 |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already cover the safe-read profile, yet the description adds substantial behavior: the `matched_in` field distinguishing bibliography from description hits, the pre-built index working before any download, and the full shape of a paginated result (name, author, category, book_date, downloaded flag, snippet). This is real value beyond the structured annotations.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Front-loaded with the core purpose and the subject-search insight, and the examples are placed at the end so they do not obstruct the first read. It is dense but nearly every clause adds a distinct fact; the duplicated Arabic title line is minor overhead.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
With no output schema, the description carries the return-value burden and does so: it names the fields each hit reports, the snippet behavior, and the pagination contract. Together with the rich input schema, an agent has everything needed to call it correctly.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
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 adds meaning by explaining the subject-vs-title semantics of the query field, the matched_in discriminator, and the explicit rejection of scope.book_ids. It stops short of adding the full wildcard/morphology reasoning that lives in the schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
States a specific verb and resource (search the Shamela catalogue of ~8,500 books) and specifies the exact indexed fields (name, author, bibliography, editorial description). It also carves out its niche against siblings by contrasting subject-search versus title-search and noting pre-built index scope.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Gives concrete guidance: use the description field to find a book by SUBJECT, and lists which scope filters apply (author_ids, category_ids, period_*, downloaded_only) while explicitly ruling out scope.book_ids. It provides runnable examples but does not explicitly name which sibling to use instead when the target is page content or chapter titles.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
shamela_search_booleanBoolean search (and / or / not)ARead-onlyIdempotentInspect
بحث منطقي (و/أو/دون)
Boolean search the AND-only regular search lacks — combines OR (any_of) and NOT (none_of) with AND (all_of). all_of: terms that must ALL appear (intersection). any_of: at least ONE must appear (union), intersected with all_of. none_of: pages containing ANY of these are excluded. At least one of all_of/any_of is required. The whole expression is ONE Lucene BooleanQuery evaluated over the entire index — all_of as MUST, any_of as SHOULD-min-1, none_of as MUST_NOT — so total_hits is an exact count and the exclusion is exhaustive, not a sample. scope is still worth passing for speed on a large library, not for correctness. If a term has no entry in the index at all it is named in zero_hit_terms: a zero then means that word is not in the library as spelled, which is different from the expression having no match. Examples: shamela_search_boolean({all_of:['الوقف'], any_of:['المسجد','المقبرة'], none_of:['البيع'], scope:{category_ids:[17]}}).
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Maximum number of results to return (1-100, default 20). | |
| scope | No | Restrict to books/authors/categories/period. Recommended: an unscoped boolean search over a large library is exhaustive but slow. Use shamela_list_categories / shamela_resolve to find IDs. | |
| all_of | No | AND — terms that must ALL appear on the page (each term is itself AND-searched, so a multi-word term must co-occur). Intersection of every term's hit set. Leave empty to rely on any_of. | |
| any_of | No | OR — at least ONE of these terms must appear on the page. Union of every term's hit set, then intersected with the all_of result. Leave empty to rely on all_of. | |
| offset | No | Number 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. | |
| none_of | No | NOT — pages containing ANY of these terms are excluded, across the whole index (a MUST_NOT clause, not a subtraction inside a sampled window). Optional. | |
| search_in | No | Which page sections each sub-search looks in: body (matn), foot (footnotes), comment. Default ['body','foot']. | |
| response_format | No | Output 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 |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already declare read-only/idempotent/non-destructive, and the description adds material behavior: the whole expression is one Lucene BooleanQuery over the entire index (exact total_hits, exhaustive MUST_NOT, not a sample), the zero_hit_terms distinction, and the scope-for-speed caveat. This is exactly the extra context annotations cannot carry.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Dense and front-loaded, with the Boolean semantics explained before the example and the scope rationale. The leading Arabic restatement of the title is redundant, but the body sentences all carry information.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For an 8-parameter search tool with a nested scope object and no output schema, the description covers query semantics, return-count meaning, empty-term handling, and scoping tradeoffs. It stops short of explaining pagination/output shape, but the schema covers has_more/next_offset and response_format.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100%, so the baseline is 3, but the description adds a real constraint not in the schema ('At least one of all_of/any_of is required') and clarifies the scope/filter semantics and intersection behavior. The remaining parameter detail is already well covered by the schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
States a specific verb and resource (Boolean search combining AND/OR/NOT) and explicitly positions it against the 'AND-only regular search' it extends. The named parameters (all_of/any_of/none_of) let an agent distinguish it from shamela_search_exact or shamela_search_pages without opening schemas.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Gives a clear condition for use (when you need OR/NOT beyond AND-only search) and a worked example call, plus a note that scope is for speed not correctness. It refers to the alternative only as 'the AND-only regular search' without naming the specific sibling, so routing is slightly less than explicit.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
shamela_search_exactExact search (diacritics, hamzas, digits)ARead-onlyIdempotentInspect
بحث مطابق مع التشكيل والهمزات والأرقام
Exactness-preserving search the regular search cannot do: it honors diacritics (التشكيل), hamza/alef forms (ٱآأإ vs bare ا, plus ؤ ئ ء ى ة), and digit systems (Arabic-Indic ٠-٩ vs Western 0-9). shamela_search_pages folds all of these away (preserve_* return OPTION_NOT_SUPPORTED). Two-stage, no index change: (1) normalized AND-search gathers candidates; (2) each candidate's FULL raw SQLite text is verified in Node, folding ONLY the features you did NOT ask to preserve. Type the query WITH the diacritics/hamza/digits to enforce; enable at least one flag in preserve. Broad searches may miss matches outside the bounded candidate window (candidate_cap_hit/total_candidates_scanned report it) — pass scope for large libraries. Examples: shamela_search_exact({query:'أحمد', preserve:{preserve_hamza:true}}) won't match «احمد»; shamela_search_exact({query:'عِلْم', preserve:{preserve_diacritics:true}}) won't match «عَلَم».
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Maximum number of results to return (1-100, default 20). | |
| query | Yes | The exact Arabic string to find. Type it WITH the diacritics / hamza form / digit system you want preserved (the query is NOT auto-diacritized). Multiple words are matched as written; the `preserve` flags decide which distinctions are enforced. | |
| scope | No | Restrict to books/authors/categories/period. Strongly recommended for large libraries so the candidate window covers the topic. | |
| offset | No | Number 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. | |
| preserve | Yes | Which distinctions to enforce during stage-2 verification. At least one must be true. | |
| response_format | No | Output 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 |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already cover safety (readOnlyHint, idempotentHint, destructiveHint=false), and the description layers on genuinely new behavior: the two-stage normalized-candidate then raw-SQLite-verification pipeline, the folding rule, the bounded candidate window with candidate_cap_hit/total_candidates_scanned reporting that broad searches may miss matches, and the OPTION_NOT_SUPPORTED error path. That is rich, non-obvious behavioral detail beyond the structured fields.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The purpose and the routing constraint are front-loaded, and the concrete examples are high-value. It is dense and slightly long with some restated ideas, but nearly every sentence earns its place given the tool's complexity; no filler.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a 6-parameter, nested-schema, two-stage tool with no output schema, the description covers mechanism, limits, required flags, error signals, and examples. It references response fields (candidate_cap_hit, structuredContent) but does not fully frame the return shape, which is the only notable gap.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100%, so the baseline is 3, but the description adds real meaning beyond the schema: the query is NOT auto-diacritized and must be typed with the target form, at least one preserve flag must be true, and scope matters specifically to widen the candidate window. It does not add much syntax for limit/offset, but it meaningfully enriches the two mandatory and the scoping parameters.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
States a specific verb and resource (exactness-preserving search over pages) and pinpoints the distinguishing feature in the title and first sentence: honor diacritics, hamza/alef forms, and digit systems. It explicitly separates itself from the sibling shamela_search_pages, so an agent can route without opening either schema.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Names the alternative (shamela_search_pages), states exactly what that tool cannot do (folds these distinctions, preserve_* returns OPTION_NOT_SUPPORTED), and gives operational conditions: type the query WITH the features to enforce, enable at least one preserve flag, and pass scope for large libraries. This is explicit when/when-not/alternative guidance.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
shamela_search_hadithFind a hadith by its wordingARead-onlyIdempotentInspect
بحث عن حديث بنصه
Find a hadith by its TEXT (not its numeric key). Text-searches the hadith shelves (كتب السنة، شروح الحديث، التخريج والأطراف، علوم الحديث — 1,957 books here, reported as books_searched) across matn + footnotes, reads each matching page's service annotations for hadith keys, then resolves each key's cross-collection takhrij via hadeeth.db. Keep the two numbers apart: the TEXT search covers those shelves, while takhrij keys exist only in the books hadeeth.db indexes (key_index_books — ten on this install), so a hadith can be found on 1,746 pages and still yield takhrij from ten books. takhrij[].books counts distinct BOOKS and index_entries the pages behind them. Returns matched pages (snippets often show the printed takhrij «رواه البخاري ومسلم») plus cross-book takhrij where service keys exist. Scoping to those shelves is deliberate: unscoped, term-frequency ranking fills the scan window with fiqh/usul works that merely QUOTE the hadith and carry no service keys, so no takhrij is found. Pass search_all_categories:true to find who CITES a hadith across the whole library instead of who NARRATES it. Example: shamela_search_hadith({query:'إنما الأعمال بالنيات'}).
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Maximum number of results to return (1-100, default 20). | |
| query | Yes | The hadith text (or a distinctive part of it). AND-combines words across matn + footnotes. | |
| response_format | No | Output 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 |
| max_pages_scanned | No | How many matching pages to scan for hadith service keys. | |
| search_all_categories | No | Search the ENTIRE library instead of the hadith shelves (كتب السنة، شروح الحديث، التخريج، علوم الحديث). Off by default because unscoped ranking buries the collections under works that merely quote the hadith. Turn on to find who CITES a hadith (e.g. in fiqh or tafsir) rather than who NARRATES it. |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already cover the safety profile (readOnly, idempotent, openWorld=false, non-destructive), and the description adds substantial context beyond them: the deliberate shelf scoping and its ranking rationale, the distinction between `books_searched` (text-search scope) and takhrij key books, and what `takhrij[].books` vs `index_entries` count. This tells the agent how to interpret the result rather than just that it is safe.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The core selector ('by its TEXT, not its numeric key') is front-loaded, and the discussion of scoping and the two counts each earns its place by preventing a common misread. It is nonetheless dense, with install-specific figures ('ten on this install', '1,746 pages') that are illustrative rather than necessary for invocation.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
There is no output schema, so the description carries the burden of describing returns — and it does, explaining matched pages with snippets (e.g. the printed takhrij «رواه البخاري ومسلم») plus cross-book takhrij, and the two distinct counts. For a 5-parameter search with no output schema, nothing an agent needs to call or interpret it is missing.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so each of the five parameters is already documented in the schema (including the rationale for search_all_categories and the response_format budget guidance). The description largely reiterates rather than extends parameter meaning, so the baseline 3 applies; the two-number framing adds interpretation context but no new argument syntax.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The opening line states a precise verb+resource: find a hadith by its TEXT, explicitly 'not its numeric key', which cleanly separates it from key-based siblings like shamela_get_books_for_hadith. It further scopes the operation to the hadith shelves (كتب السنة، شروح الحديث، التخريج، علوم الحديث) and names the return shape (matched pages + takhrij). An agent can select this over the other search_* siblings without opening a schema.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
It gives an explicit when-to-use branch: default scoping finds who NARRATES, while search_all_categories:true finds who CITES across fiqh/tafsir. It also justifies the default (unscoped ranking buries collections under quoting works with no service keys), effectively stating when-not to widen. The only minor gap is that it does not name a specific sibling as the alternative for key-based lookup, but the behavioral boundary is unambiguous.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
shamela_search_isnadSearch isnadsARead-onlyIdempotentInspect
بحث في الأسانيد
Search the 45,220 isnād chains Shamela indexes across ten ḥadīth books (Bukhārī 1681, Muslim 711, Abū Dāwūd 654, Tirmidhī 7895, Nasāʾī 829, Muwaṭṭaʾ 28107, Ṭayālisī 1456, Ibn al-Jārūd 627/13071, ʿIlal al-Tirmidhī 642). Two constraints, both taking narrator ids from shamela_search_narrators: contains requires the narrators to appear ANYWHERE in the chain, and transmission takes [teacher_id, student_id] pairs that must be ADJACENT and in that order — direct audition with nobody in between. transmission is the strictly stronger claim and the one ʿilm al-rijāl asks: «did X actually hear from Y». Every result gives book, page and the chain resolved to names and death years, so a claim can be checked against the printed page with shamela_get_page. Chains run ASCENDING: chain[0] is the Companion, the last link is the collector. At least one constraint is required. Examples: shamela_search_isnad({transmission:[[1580,2779]]}) — chains where Shuʿba heard from al-Ḥakam b. ʿUtayba; shamela_search_isnad({contains:[2779], scope_book_ids:[1681]}) — Shuʿba's chains in al-Bukhārī.
| Name | Required | Description | Default |
|---|---|---|---|
| offset | No | Chains to skip, for paging. | |
| contains | No | Narrator ids that must ALL appear in the chain, at any position and in any order. Use for «which reports pass through both X and Y». | |
| max_results | No | Chains to return per page (1-100, default 20). | |
| transmission | No | Pairs [teacher_id, student_id] that must appear ADJACENT and in that order — direct transmission, the student having heard from the teacher with nobody in between. This is the question «did X really narrate from Y», and it is strictly stronger than listing both in `contains`. All pairs are ANDed. | |
| scope_book_ids | No | Restrict to these books. The isnād index covers only ten: صحيح البخاري (1681), صحيح مسلم (711), سنن أبي داود (654), سنن الترمذي (7895), سنن النسائي (829), موطأ مالك (28107), مسند الطيالسي (1456), المنتقى لابن الجارود (627 و13071), وعلل الترمذي (642). | |
| response_format | No | Output 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 |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already cover the read-only/idempotent safety profile, but the description adds substantial behavioral context: the mandatory-constraint rule, ascending chain order (chain[0] is the Companion, last is the collector), what each result contains (book, page, resolved names and death years), and the response_format character-budget tradeoff.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Front-loaded with the resource and scope, then constraints, then examples. Dense and mostly waste-free, though the single long paragraph packs a lot and could be slightly tighter; every clause still carries substantive information.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
With no output schema, the description compensates by describing exactly what results include (book, page, resolved chain with names and death years) and how to verify them. It covers the constraint requirement, ordering, examples, and output-format behavior, leaving no significant gap for calling the tool correctly.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100%, so baseline is 3. The description adds value beyond the schema by giving worked examples (transmission:[[1580,2779]], contains:[2779] with scope_book_ids) and emphasizing the ordering/adjacency semantics and the capability requirement for response_format='none'.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
States a specific verb and resource (search isnād chains) with concrete scope: 45,220 chains across ten named ḥadīth books. It clearly differentiates itself from siblings like shamela_search_narrators (source of the ids) and shamela_get_page (for verifying against the printed page).
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Explicitly explains when to use each constraint: `contains` for narrators anywhere in the chain, `transmission` for adjacent teacher→student pairs, and notes `transmission` is the strictly stronger claim. It also states 'At least one constraint is required' and routes the agent to shamela_search_narrators for ids and shamela_get_page for verification.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
shamela_search_narratorsSearch isnad narratorsARead-onlyIdempotentInspect
بحث في رجال الأسانيد
Find a ḥadīth narrator (راوٍ) by name in Shamela's rijāl register — 18,989 narrators with death years 2-774 AH. This is the entry point for ʿilm al-rijāl: every other narrator/isnād tool takes the narrator_id this returns. The query is folded the same way page search folds Arabic, so «شعبه» finds «شعبة» and tashkeel is ignored; tokens are ANDed and match anywhere in the short name, the full lineage, or the shuhra / laqab / kunya / nisba — so «الزهري» and «الأعمش», which are how these men are actually cited, now find them. Results are ordered by how much the register documents a man (the size of his jarḥ-wa-taʿdīl dossier), death year breaking ties: the narrator an isnād would actually name comes ahead of an obscure namesake. Names are common in this corpus — always check the death year and grade before deciding which «محمد بن إسماعيل» you have. Examples: shamela_search_narrators({query:'شعبة بن الحجاج'}), shamela_search_narrators({query:'الزهري'}).
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Maximum narrators to return (1-50, default 10). | |
| query | Yes | Part of the narrator's name, in Arabic. Matched against the short name, the full lineage, and the register's الشهرة / اللقب / الكنية / النسب — so «الزهري» and «الأعمش» reach the men known by those nisbas even though neither appears in their recorded name. Folding is the same the page search uses, so «شعبه» finds «شعبة» and tashkeel is ignored. Tokens are ANDed and match anywhere, so «شعبة الحجاج» works even though the name reads «شعبة بن الحجاج». Results are ordered by how much al-jarḥ wa-l-taʿdīl the register holds on each man — the most-discussed «الزهري» first — with the earliest death year breaking ties. | |
| offset | No | Narrators to skip, for paging. Common names match in the thousands — «محمد بن» matches 3,620 — so page with this or narrow the query. | |
| response_format | No | Output 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 |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already cover the safety profile (readOnlyHint=true, destructiveHint=false, idempotentHint=true), yet the description adds substantial behavior beyond them: the Arabic-folding rules that make «شعبه» find «شعبة», AND-token matching across name/lineage/nisba fields, the ranking rule (dossier size, death-year tiebreak), and an explicit warning that common names must be disambiguated by death year and grade.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Front-loaded with the Arabic title and the core purpose before diving into folding, ranking, and examples. It is dense but nearly every sentence carries distinct information; it runs slightly long, which keeps it off a 5.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a search tool whose annotations already declare it a safe read, the description covers everything an agent needs: the resource, normalization behavior, result ranking, disambiguation pitfalls, and example invocations. No output schema exists, but the caller consumes narrator_ids, which the description explains, so nothing material is missing.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100% and each parameter is already documented in the schema, so the baseline is 3. The description mostly restates the schema's own folding/AND/ordering text rather than adding new parameter-level meaning, though it does add the paging motivation with a concrete figure («محمد بن» matches 3,620).
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
States a specific verb and resource — find a ḥadīth narrator by name in Shamela's rijāl register — and pins down the scope (18,989 narrators, death years 2-774 AH). It also distinguishes itself from siblings by declaring itself 'the entry point for ʿilm al-rijāl: every other narrator/isnād tool takes the narrator_id this returns.'
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Clearly frames when to reach for it (searching for a narrator by name, before calling any narrator/isnād tool that needs a narrator_id) and supplies two concrete call examples. It stops short of explicit when-not guidance, so it falls just under a 5.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
shamela_search_pagesSearch page text (body and footnotes)ARead-onlyIdempotentInspect
بحث في صفحات الكتب
Search the body (matn) and footnotes (الحواشي) of every Shamela page the user has downloaded locally. AND-combines tokens; each token can match in any of the search_in fields. Default scope is the full downloaded library; pass scope (book_ids/author_ids/category_ids/period_*/downloaded_only/madhab/book_type/citable_only) to narrow. scope.madhab ('hanafi'|'maliki'|'shafii'|'hanbali') answers a school-specific fiqh question — it uses Shamela's school categories AND the main author's school, so it reaches مسائل فقهية and الفقه العام where no school is filed; books whose school is unknown are excluded, so leave it unset for comparative questions. scope.book_type excludes what is not an authored book (transcript/thesis/journal/electronic/manuscript), and scope.citable_only keeps only books whose page numbers match a real printed edition — set it whenever the answer will quote a page as a citation. options controls morphology (Arabic root expansion via AlKhalil — NOTE Arabic roots are ambiguous and the analyzer keeps every reading, so «كتب» also searches تبب/توب/وتب, i.e. perdition and repentance; the response returns morphology_expanded_to naming exactly what was searched, and results are a SUPERSET of the word you asked for), wildcards (*/? per token, cannot combine with morphology), and search_in subset (body/foot). Returns total_hits + paginated results with book name, author, printed-page label, and a snippet with ... around matches; coverage rolls up by category/century/book/author — EXACT (every matching page counted) whenever coverage.sample_is_complete is true, and otherwise a top-scoring sample of coverage.sampled_hits of total_hits, whose shares are then indicative rather than a census. by_category/by_century cover the whole sample; by_book/by_author are the largest coverage.top_n only, so they do not sum to it. Plus edition_groups whenever hits landed in two or more catalog entries of one work (several editions of the same book) — read those as one source, not several. preserve_diacritics/_hamza/_digits return OPTION_NOT_SUPPORTED here — use shamela_search_exact for those. Use shamela_search_titles for chapter title search instead. Examples: shamela_search_pages({query:'الكلام'}), shamela_search_pages({query:'استصناع', scope:{category_ids:[17]}}), shamela_search_pages({query:'كلم', options:{morphology:true}}).
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Maximum number of results to return (1-100, default 20). | |
| query | Yes | Arabic search phrase. Multiple words are AND-combined; each can match in body or footnotes. If a word does not exist in the library under the spelling you used, the spelling the books DO use is searched instead and reported in `respelled_terms` — say so when you quote the result, because the source writes the word differently. | |
| scope | No | Restrict the search to specific books, authors, categories, or a Hijri date range. Use shamela_list_categories / shamela_resolve to find IDs. | |
| shape | No | How much of each hit to return. 'full' (default) is every field on every row, including the snippets — ask for this when the answer will QUOTE the page. 'brief' keeps book_id/page_id, printed_page, match_quality and matched_in_section and hoists book metadata into a top-level `books` dictionary keyed by book_id, but carries NO snippet: it answers which pages these are, how well each matched and how to cite them, for a fraction of the characters, so far more rows survive the budget. 'index' returns book_id/page_id only, for choosing what to read before paying to read it. Requires the 'shape.full_brief_index' capability (see shamela_brief). | full |
| offset | No | Number 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. | |
| options | No | Search options: morphology, wildcards, sort, search_in (body/foot), relax_when_empty. Defaults to body+foot, no toggles. preserve_* redirect to shamela_search_exact. | |
| exclude_pages | No | Exact pages to keep out — the pages a previous round already returned. Excluding these rather than whole books is what lets a follow-up search find MORE evidence in a book that has already contributed some. | |
| response_format | No | Output 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 |
| exclude_book_ids | No | Book ids to keep out of the results entirely. | |
| exclude_author_ids | No | Exclude every book by these authors. | |
| exclude_category_ids | No | Exclude every book on these shelves. | |
| exclude_work_group_ids | No | Exclude every catalogue entry of these works — all printings at once. This is the one to use after a round returned «صحيح البخاري - ط السلطانية»: excluding that book_id alone leaves the other seven entries of group 1681 free to return the same text again as if it were a second source. |
Output Schema
| Name | Required | Description |
|---|---|---|
| books | No | |
| query | No | |
| offset | No | |
| results | No | |
| coverage | No | |
| has_more | No | |
| returned | No | |
| truncated | No | |
| total_hits | No | |
| next_offset | No | |
| scope_count | No | |
| rows_dropped | No | |
| paging_ceiling | No | |
| zero_hit_terms | No | |
| respelled_terms | No | |
| terms_truncated | No | |
| relaxed_of_terms | No | |
| scope_resolution | No | |
| normalized_tokens | No | |
| relaxed_min_match | No | |
| truncation_message | No | |
| morphology_fallback | No | |
| unattributable_books | No | |
| morphology_expanded_to | No |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already declare readOnly/idempotent/non-destructive, and the description goes well beyond them: it discloses that morphology yields a SUPERSET with ambiguous roots (with the كتب→تبب/توب/وتب example), that coverage is EXACT only when coverage.sample_is_complete and otherwise a top-scoring sample, that by_book/by_author are truncated to top_n so shares are non-censal, and that edition_groups are one work in several printings.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Long but front-loaded, with the core scope statement first and the routing/exclusions after. Nearly every clause carries operational detail an agent needs; the main cost is some duplication of schema text, which is the only thing keeping it from a 5.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
With an output schema present, a 100%-covered input schema, and full annotations, the description still covers everything an agent needs to call correctly: scope semantics, morphology/wildcard caveats, citation-citability flag, response shape, coverage interpretation, and cross-tool redirects.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100%, so the baseline is 3, but the description adds genuine meaning beyond the schema: it summarizes scope keys, explains the interplay of scope.madhab with school categories, warns that wildcards cannot combine with morphology, and notes preserve_* return OPTION_NOT_SUPPORTED here. It largely restates the schema's own parameter text, which caps it below 5.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
States a specific verb+resource (search) and scope (body/footnotes of locally downloaded Shamela pages), and explicitly distinguishes itself from siblings by naming shamela_search_exact for preserve_* options and shamela_search_titles for chapter-title search. An agent can route to it without opening another schema.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Gives concrete when-to-use rules: set scope.madhab for school-specific fiqh but leave it unset for comparative questions, set citable_only whenever quoting a page, and route to shamela_search_exact/shamela_search_titles when the wrong tool would be chosen. Alternatives and exclusions are explicit, not implied.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
shamela_search_phraseExact phrase and proximity searchARead-onlyIdempotentInspect
بحث بالعبارة والتقارب
Exact-phrase and proximity search the regular search lacks. mode='phrase' matches the query words as a CONSECUTIVE phrase (e.g. «خيار المجلس» only where those two words are adjacent). mode='near' matches pages where the words occur within distance words of each other in any order (e.g. «بيع» near «قبض» within 5 words) — ideal for fiqh questions where related terms sit close but not adjacent. Two-stage: finds candidate pages where all words co-occur, then verifies adjacency/proximity in the full page text. Pass scope (book_ids/author_ids/category_ids) to cover large libraries reliably. Returns book name, author, printed page, and a snippet. Examples: shamela_search_phrase({query:'خيار المجلس'}), shamela_search_phrase({query:'بيع قبض', mode:'near', distance:5, scope:{category_ids:[17]}}).
| Name | Required | Description | Default |
|---|---|---|---|
| mode | No | 'phrase' = exact consecutive words (default). 'near' = words within `distance` words, any order. | phrase |
| limit | No | Maximum number of results to return (1-100, default 20). | |
| query | Yes | Arabic phrase. In mode='phrase' the words must appear consecutively (exact phrase). In mode='near' the words must appear within `distance` words of each other in any order. | |
| scope | No | Restrict to books/authors/categories/period. Strongly recommended to scope large libraries. | |
| shape | No | How much of each hit to return. 'full' (default) is every field on every row, including the snippets — ask for this when the answer will QUOTE the page. 'brief' keeps book_id/page_id, printed_page, match_quality and matched_in_section and hoists book metadata into a top-level `books` dictionary keyed by book_id, but carries NO snippet: it answers which pages these are, how well each matched and how to cite them, for a fraction of the characters, so far more rows survive the budget. 'index' returns book_id/page_id only, for choosing what to read before paying to read it. Requires the 'shape.full_brief_index' capability (see shamela_brief). | full |
| offset | No | Number 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. | |
| distance | No | For mode='near': maximum word span from the FIRST to the LAST query word, counted inclusively — distance=1 means adjacent, distance=2 allows one word between two query words. Ignored for mode='phrase'. | |
| search_in | No | Which page sections to verify the phrase in: body (matn), foot (footnotes), comment. | |
| exclude_pages | No | Exact pages to keep out — the pages a previous round already returned. Excluding these rather than whole books is what lets a follow-up search find MORE evidence in a book that has already contributed some. | |
| response_format | No | Output 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 |
| exclude_book_ids | No | Book ids to keep out of the results entirely. | |
| exclude_author_ids | No | Exclude every book by these authors. | |
| exclude_category_ids | No | Exclude every book on these shelves. | |
| exclude_work_group_ids | No | Exclude every catalogue entry of these works — all printings at once. This is the one to use after a round returned «صحيح البخاري - ط السلطانية»: excluding that book_id alone leaves the other seven entries of group 1681 free to return the same text again as if it were a second source. |
Output Schema
| Name | Required | Description |
|---|---|---|
| mode | No | |
| books | No | |
| query | No | |
| offset | No | |
| results | No | |
| distance | No | |
| has_more | No | |
| returned | No | |
| truncated | No | |
| next_offset | No | |
| scope_count | No | |
| rows_dropped | No | |
| total_verified | No | |
| zero_hit_terms | No | |
| scope_resolution | No | |
| candidate_cap_hit | No | |
| truncation_message | No | |
| unattributable_books | No | |
| total_candidates_scanned | No |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already cover the safety profile (readOnly, idempotent, non-destructive), so the bar is lower. The description adds real behavioral context: the two-stage execution (find co-occurring candidate pages, then verify adjacency/proximity in full page text) and the reliability implication of using `scope` on large libraries. It does not discuss rate limits or cost beyond the 'regular search lacks' framing.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Front-loaded with the core distinction, then mode semantics, then the two-stage mechanism, then scoping advice, then return fields and examples — a logical order for a 14-parameter tool. It is appropriately sized, though the bilingual Arabic header duplicates the English title and the return-fields sentence overlaps with the output schema.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
With 14 parameters, a 100%-covered schema, an output schema, and full annotations, the description only needs to supply the conceptual layer — mode choice, execution model, scoping advice — and it does exactly that with worked examples. 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.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so baseline is 3, but the description goes further by showing a full invocation example with `query`, `mode`, `distance`, and nested `scope:{category_ids:[17]}`, which clarifies how the parameters compose. It does not add semantics for the many exclusion/shape/pagination params, all of which the schema handles.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description states a precise verb+resource ('exact-phrase and proximity search') and immediately defines the two modes with concrete Arabic examples («خيار المجلس» for phrase, «بيع» near «قبض» within 5 words). It also distinguishes itself from 'the regular search' by naming what that search lacks, so an agent can tell what this tool adds without opening the schema.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
It clearly states when to pick phrase vs near ('ideal for fiqh questions where related terms sit close but not adjacent') and recommends scoping for large libraries. However it never names the closest siblings (shamela_search_exact, shamela_search_boolean) or states when NOT to use this tool, so the routing guidance is strong but not exhaustive.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
shamela_search_quranSearch the QuranARead-onlyIdempotentInspect
بحث في القرآن
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.
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Maximum number of results to return (1-100, default 20). | |
| query | Yes | Arabic 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. | |
| offset | No | Number 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. | |
| options | No | Currently only the `wildcards` flag is honored. The Quranic index ships pre-built and zero-config. | |
| response_format | No | Output 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 |
TDQS
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.
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.
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.
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.
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.
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.
shamela_search_titlesSearch chapter headingsARead-onlyIdempotentInspect
بحث في عناوين الفصول
Search Shamela's title/ Lucene index for chapter and section titles. Same query/scope/options/pagination shape as shamela_search_pages but matches title text rather than page bodies. After finding a matching title, use shamela_get_book_section(book_id, title_id) to read the full section. Examples: shamela_search_titles({query:'باب الصيام'}), shamela_search_titles({query:'تعريف', scope:{book_ids:[]}}).
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Maximum number of results to return (1-100, default 20). | |
| query | Yes | Arabic search phrase. Matches against chapter / section title text. | |
| scope | No | Same scope filter as shamela_search_pages (book_ids, author_ids, category_ids, period_*, downloaded_only). | |
| offset | No | Number 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. | |
| options | No | morphology / wildcards / preserve_* (preserve_* deferred to v1.1). search_in is ignored — titles are a single field. | |
| response_format | No | Output 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 |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already declare readOnlyHint, idempotentHint and destructiveHint=false, so safety is settled. The description adds real behavioral value beyond that: it names the Lucene index being queried, notes the shared parameter shape with shamela_search_pages, and specifies the follow-up read workflow. It does not describe result format or pagination behavior, which is the main remaining gap.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Front-loaded with the core purpose, then sibling differentiation, then routing, then two concrete invocation examples. Tight and no filler; the bilingual heading is minor redundancy but the rest is well ordered and earns its space.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a search tool with a nested scope object, six parameters and no output schema, the description supplies the two things an agent most needs: how it differs from shamela_search_pages and what to call next. Return-value shape is left to the response_format parameter and structuredContent, which is acceptable.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so the schema already documents query, scope, options and pagination in depth. The description's examples show the query and scope.book_ids shape in use, which adds slight context, but does not explain parameter semantics beyond what the schema provides. Baseline 3 is appropriate.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
States a specific verb and resource ('Search Shamela's title/Lucene index for chapter and section titles') and immediately distinguishes the tool from its closest sibling: it matches title text rather than page bodies, unlike shamela_search_pages. An agent can tell this apart from the many other shamela_search_* tools without opening the schema.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Explicitly names the sibling it shadows (shamela_search_pages) and clarifies the selecting condition (title text vs page bodies), then routes the agent onward with shamela_get_book_section to read the section found. It lacks a when-NOT-to-use clause, but the sibling differentiation is clear.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
39 tool updates
- First observed
fetch - First observed
search - First observed
search_library - First observed
shamela_books_by_period - First observed
shamela_brief - First observed
shamela_get_author - First observed
shamela_get_aya - First observed
shamela_get_book - First observed
shamela_get_book_parts - First observed
shamela_get_book_section - First observed
shamela_get_books_for_hadith - First observed
shamela_get_citation - First observed
shamela_get_isnad - First observed
shamela_get_narrator - First observed
shamela_get_page - First observed
shamela_get_page_services - First observed
shamela_get_pages_range - First observed
shamela_get_tafseer_of_aya - First observed
shamela_get_tafseer_texts - First observed
shamela_get_toc - First observed
shamela_list_categories - First observed
shamela_list_tafsirs_for_aya - First observed
shamela_recon - First observed
shamela_resolve - First observed
shamela_resolve_printed_page - First observed
shamela_resolve_work - First observed
shamela_root_stats - First observed
shamela_search_authors - First observed
shamela_search_batch - First observed
shamela_search_books - First observed
shamela_search_boolean - First observed
shamela_search_exact - First observed
shamela_search_hadith - First observed
shamela_search_isnad - First observed
shamela_search_narrators - First observed
shamela_search_pages - First observed
shamela_search_phrase - First observed
shamela_search_quran - First observed
shamela_search_titles
Publisher details
- Operator
- Quran Gallery · Publisher source
- Operator website
- https://qurangallery.com · Publisher source
- Vendor relationship
- First-party · Publisher source
- Documentation
- https://github.com/qurangallery/kb-mcp · Publisher source
- Trust center
- Not available
- Restrictions
- No account, API key or paid plan needed. Keyless use is limited to 10 tool calls a minute and 200 a day per IP; an optional free key raises this to 60 a minute. Queries must be in Arabic. · Publisher source
Related MCP Servers
- AlicenseAqualityCmaintenanceEnables brand visibility monitoring across major AI platforms like ChatGPT, Claude, Gemini, and Perplexity. It allows users to track visibility scores, analyze competitor data, and receive actionable insights to improve AI-generated brand recommendations.1611 npm1MIT
- AlicenseCqualityBmaintenanceCompetitor Monitor AI - MCP server providing AI-powered tools and automation by MEOK AI Labs117 npm54 PyPIMIT
- AlicenseAqualityCmaintenanceRevnuvo Company Intelligence tells AI agents what changed at a company, with evidence. It observes company websites, technologies, and DNS over time and returns timestamped, confidence-aware changes, signals, and monitoring.9MIT

industrylens-mcpofficial
AlicenseNot gradedqualityBmaintenanceBrowse IndustryLens's published competitive-intelligence reports and head-to-head competitor comparisons from any AI agent — real, source-backed data.MIT
Glama MCP Gateway
Add one secure layer between your agents and this server.