Format a citation
shamela_get_citationصياغة إحالة
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'}).
Input Schema
| 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 |