# MCP for developers: How to read a Shamela MCP search result

Source: https://qurangallery.com/docs/mcp/reading-results

> Two fields decide what a result actually proves: whether the words were in the main text or a footnote, and whether the exact phrase was found.

A citation that is real but misread is still a wrong answer. Two fields on every result decide what it proves, and both are easy to skip past.

## `matchedIn` — the main text, or an editor's note?

Modern printings of classical works carry two layers on the page: the author's text (the _matn_), and the editor's footnotes — cross-references, gradings, and quotations from other scholars.

Your words may have been found in either.

| Value      | What it means                                                     |
| ---------- | ----------------------------------------------------------------- |
| `body`     | The words are in the author's own text.                           |
| `footnote` | The words are in an **editor's footnote**, not the author's text. |
| `both`     | They appear in both layers on that page.                          |
| `unknown`  | The source did not say.                                           |

This distinction changes the claim entirely. Searching `إنما الأعمال بالنيات` in `hadith-primary` returns a hit in _Sunan Abi Dawud_, page 3/526 — with `matchedIn: "footnote"`. Reading it shows why: the words are in a note quoting **al-Khattabi's commentary** on the hadith. Abu Dawud did not write that sentence. Presenting it as the matn of Abu Dawud would be a fabrication built entirely out of true parts: a real book, a real page, a real quotation, and a false attribution.

> When `matchedIn` is `footnote`, say so. "An editor's note in _Sunan Abi Dawud_ quotes al-Khattabi as saying…" is accurate. "Abu Dawud says…" is not.

## `relaxedToTokens` — how close was the match?

| Value   | What was found                                                         |
| ------- | ---------------------------------------------------------------------- |
| `false` | Your **exact phrase**, in order, as you wrote it.                      |
| `true`  | The phrase was **not found**. These pages carry your words separately. |

When it is `true`, the result also carries a `note` saying so in plain language:

> _The exact phrase was not found. These pages carry the words separately, so they answer a weaker question than the one asked._

This is the difference between "this wording is printed here" and "these words appear near each other on this page." Both are useful; only the first supports a quotation. A page found by the looser pass may be discussing something else entirely and merely share vocabulary.

## When nothing is found

If neither pass finds anything, you get an empty `passages` list and:

> _Neither the exact phrase nor its words together appear anywhere in this scope._

**This is a finding, not a failure.** A negative result from a scope of 8 edition-pinned hadith collections is genuine evidence — it means that wording is not in those eight books, which is often precisely what someone wants to know about a quotation circulating online.

It is not, however, evidence about the whole library. Say which scope was searched. "Not in the eight primary collections" is a real claim; "does not exist" is not one this tool can support.

## Reading the excerpt

The `arabic` field is the passage as printed, with all markup removed. A leading `…` means the excerpt begins mid-sentence — it is a window onto the page, not the whole page. A trailing `…` means it was truncated at the length cap.

Quote it as it stands. Do not repair, re-point, or modernise the Arabic; if it looks odd, that is usually the printing, and altering it breaks the one guarantee the excerpt carries.

## What a result proves, in one line

A result proves that **this passage is printed in this book at this page in this edition**. Everything beyond that — that it is authentic, that it is the majority view, that it answers the question asked — is a separate judgement the tool does not make and cannot make for you.

## Next steps

- [Open Quran Gallery MCP](https://qurangallery.com/mcp)
- [Why scope matters: one search on one shelf and on all](https://qurangallery.com/docs/mcp/why-scope-matters)
- [Verify an AI-quoted passage against the printed page](https://qurangallery.com/docs/mcp/verify-a-quotation)
- [MCP server for Islamic texts: what it does](https://qurangallery.com/docs/mcp/overview)
