Skip to content
Search docs
Search docs…

Hadith takhrij with MCP: find a hadith across collections

Locate a hadith in the primary collections with its isnad and printed page using the Quran Gallery MCP tools and the takhrij_hadith prompt. No grading.

On this page

Takhrīj (تخريج الحديث) here means locating where a hadith is recorded, with its chains of transmission (isnād, إسناد) and the exact printed pages. It does not mean grading it. The server never calls a hadith ṣaḥīḥ, ḥasan or ḍaʿīf, and gives no rulings; see Grounding rules.

The ready-made prompt

Your client lists a prompt called takhrij_hadith, with one argument, text: the wording of the hadith. In clients that show MCP prompts, pick it and paste the wording. The prompt tells the model to find the hadith across the collections, report each isnād, and answer in your language without grading. Without prompt support, use the steps below.

Steps by hand

  1. Search the primary collections. Call search_library with the Arabic wording and scope: "hadith-primary" (scopes). Read matchedIn and relaxedToTokens: only body with an exact phrase shows that the wording is printed there (Reading a result).
  2. Find every collection that records it. Use shamela_search_hadith with the wording to list the collections carrying it, and shamela_get_books_for_hadith with the hadith’s shared key to list the books that record the same hadith.
  3. Read the chains. shamela_get_isnad returns the chain or chains printed on one page, with narrator names resolved. shamela_search_isnad searches the indexed chains across ten hadith books.
  4. Identify the narrators. shamela_search_narrators finds a narrator by name and shamela_get_narrator returns the dossier (lineage, death year, ṭabaqa). Where a dossier quotes critics’ gradings, they are the critics’ words, and are to be reported as quoted.
  5. Open the page. shamela_get_page returns the full page with the footnotes, and the passage’s sourceUrl links to it on shamela.ws.
  6. Cite each collection as in Grounding rules: book, edition, volume and page, main text or footnote.

What a good answer contains

  • Each collection and page where the hadith is printed, with its isnād as printed.
  • Wording differences between collections, quoted exactly.
  • Which hits are in the author’s text and which are in an editor’s footnote.
  • A statement of what was searched, so a miss is read as a miss in that scope only.

It does not contain a verdict on authenticity. For that, consult a qualified scholar and the books themselves.

Example

Ask your assistant: Use takhrij_hadith for «إنما الأعمال بالنيات». In the primary collections the search finds, among others, Ṣaḥīḥ al-Bukhārī (ط السلطانية, 1/6), and a footnote in Sunan Abī Dāwūd (3/526) that quotes al-Khaṭṭābī’s commentary on it. The first is the author’s text; the second is not Abu Dawud’s own wording.

Edit this page on GitHub