Books by period (composition and death year)
shamela_books_by_periodكتب حسب المدة (تأليفًا ووفاةً)
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.
Input Schema
| 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 |