Skip to main content
Glama
This connector has been deprecated

Search the classical Islamic library

shamela_search_library
Read-onlyIdempotent

Search one named shelf of the classical Islamic library (8,594 works) for quotable passages: verbatim Arabic with book, author, printed volume/page, edition and a link to the page in the Quran Gallery Maktabah reader. The default first search for hadith, tafsir, fiqh or creed. Not for isnads, narrators or diacritic-exact wording. Use shamela_search (match "words") to pin books or categories or to page past 10 results, shamela_read (unit "page") to read a whole page. Scope is one shelf per call; call again with another shelf to widen. Ranking: exact phrase first, then all the words; a madhhab scope asks that school's own books first; main text before footnote. relaxedToTokens and note flag a weaker match; no passages means absent from that scope, not from the library. A non-Arabic query or unknown scope returns a tool error naming the fix.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "query": "<query>",
      "scope": "<scope>"
    },
    "name": "shamela_search_library"
  }
}

Input Schema

NameRequiredDescriptionDefault
limitNoMaximum passages to return (max 10).
queryYesArabic search text. A quoted wording works best; a topic also works.
scopeYeshadith-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

NameRequiredDescriptionDefault
noteNoPresent only when the result needs a caveat; carry it with the passages.
scopeNoThe scope searched, as sent.
passagesNoBest evidence first: exact phrase before word matches, main text before footnote, the school's own shelf before the wider one. Empty when nothing in the scope matched.
totalMatchesNoMatching pages the library verified in the scope before the limit, or null.
booksSearchedNoBooks in the searched scope, or null when the library did not say.
relaxedToTokensNoTrue when the exact phrase was not found and a looser word search answered.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedOutput schema / properties / passages / items / properties / sourceUrl / description
      Previous value: -"The same page on shamela.ws."New value: +"The same page in the Quran Gallery Maktabah reader."
  2. Added

TDQS

A4.6/5.0
Behavior4/5

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

Annotations already declare this a safe, idempotent, closed-world read, so the description's job is to add operational context, and it does: result ranking order (exact phrase, then all words, madhhab-first for a school scope, main text before footnote), the relaxedToTokens/note weakened-match flag, and the crucial negative-result semantics (no passages means absent from that scope, not the library). It also discloses error behavior for non-Arabic queries and unknown scopes. Not a 5 only because the cap interaction with paging is left to the sibling reference rather than spelled out.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loaded with purpose and payload, then usage, then ranking and edge cases — a sensible order with no filler sentences. It is dense and clause-heavy in places (the ranking and madhhab notes are packed into single sentences), which costs a little readability against a genuine 5, but every sentence carries information an agent needs.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a tool with a 12-value scope enum, a hard limit cap, and a non-obvious negative-result meaning, the description covers the decisions an agent must make: which shelf, when to widen scope, how results are ordered, how to read weak matches, and how errors surface. An output schema exists, so return-shape explanation is optional, yet the passage fields are still summarized helpfully.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the baseline is 3, but the description adds real meaning beyond the schema: scope is one shelf per call and must be re-called to widen, and a madhhab scope ranks that school's own books first, which is a ranking behavior the enum text does not state. Query phrasing guidance (quoted wording works best) duplicates the schema slightly rather than extending it, keeping this from a 5.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb (search) and scoped resource (one named shelf of the classical Islamic library, 8,594 works) and names the payload returned: verbatim Arabic with book, author, volume/page, edition and a reader link. It explicitly contrasts itself with shamela_search and shamela_read, so an agent can place it among 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.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives an explicit when-to-use ("the default first search for hadith, tafsir, fiqh or creed"), explicit exclusions (isnads, narrators, diacritic-exact wording), and names the alternatives with the exact condition that selects each: shamela_search with match "words" for pinning books/categories or paging past 10, shamela_read with unit "page" for full pages. The one-shelf-per-call rule plus "call again with another shelf to widen" removes the main usage ambiguity.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources