Skip to main content
Glama
This connector has been deprecated

Format a citation or resolve a printed page

shamela_cite
Read-onlyIdempotent

Citations. mode=citation (default): build one for a book, optionally a page and quoted text — Shamela's copy format, short inline, full with death year, or BibTeX/RIS. Call it whenever you attribute a quote; it needs only the catalogue, plus the installed text for a page's printed number. Read page_resolved, components.auto_numbered and notes[] before presenting. mode=printed_page: map a printed citation («vol. 4, p. 405») to the page_ids carrying it — no arithmetic relates the two, and one printed page often spans several ids: read them all, in order, with shamela_read(unit='page'). Resolve the work with shamela_find(kind='work') first; holding a page_id already, skip this. Failures come back as status; citable:false = Shamela's own numbering. Error: BOOK_NOT_FOUND.

Input Schema

NameRequiredDescriptionDefault
modeNoSelects what the call does: citation | printed_page. Default citation.
pageNoThe PRINTED page number as the citation gives it (e.g. 405). Example: {book_id:6910, part:'4', page:405}; {book_id:1681, part:'1', page:6}. (mode=printed_page only.)
partNoThe volume/part label as the book uses it, usually a bare number ('4'). Omit when the citation names no volume or the work is single-volume: the search then runs across every part and the response reports which parts matched, so an ambiguous page number is visible rather than silently resolved to the first volume. (mode=printed_page only.)
textNoOptional quoted text. Used by the 'shamela' style only, which then prints a two-line block: «<book>» (<part>/ <page>): «<text>». Other styles ignore it. (mode=citation only.)
styleNoCitation 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[]. 'short' reads <author>، <book>، ص <page>. Every style but bibtex/ris uses Arabic-Indic digits. (mode=citation only.)
book_idNo[mode=citation] The book id, from shamela_find(kind='book'), shamela_find(kind='work') or shamela_find(kind='name'). [mode=printed_page] The book. Resolve a cited title with shamela_find(kind='work') first — and note that different printings of one work paginate differently, so the book_id must be the printing the citation came from.
page_idNoOptional page_id. When omitted, the citation references the book without a specific page and page_resolved is null. A page id that is missing, has no printed number, or belongs to a book whose text is not installed here yields a book-level citation with page_resolved:false and a note. Example: {book_id:1681, page_id:10}, or with text:'<quoted passage>', style:'shamela'. (mode=citation only.)
response_formatNoFormat of the human-readable text: 'markdown' (default) for display; 'json' the same data as one JSON code block; 'none' only a one-line pointer, leaving structuredContent as the whole answer. structuredContent is always returned, so a caller that parses it should pass 'none': the character budget counts both channels, and the unread copy otherwise spends most of it. Requires the 'response_format.none' capability (see shamela_get_brief).

Output Schema

NameRequiredDescriptionDefault
notesNo[mode=citation] Missing citation fields and fallbacks; never fill them in. [mode=printed_page] Guidance on reading the result.
styleNo'shamela', 'short', 'full', 'bibtex' or 'ris'. (mode=citation only.)
statusNo'ok', 'book_not_downloaded', 'no_printed_pagination' (Shamela paginates this entry itself: no printed page exists), 'part_not_found' or 'page_not_in_part'. (mode=printed_page only.)
book_idNoCatalogue book id. (mode=printed_page only.)
citableNoFalse when the numbers are Shamela's own, not a printed edition's. (mode=printed_page only.)
matchesNoOne row per page id. (mode=printed_page only.)
page_idsNoEvery page id carrying the printed page, in reading order; read them all. Shamela splits a long printed page across records, so one page routinely has several ids (part '1', page 6 of book 1681 = ids 9, 10, 11 in the fixture). (mode=printed_page only.)
book_nameNoCatalogue title of the book (Arabic). (mode=printed_page only.)
formattedNoThe citation text in the requested style. (mode=citation only.)
truncatedNo
componentsNoThe parts the citation was built from. (mode=citation only.)
page_rangeNoOn page_not_in_part: the printed range that exists in that part. (mode=printed_page only.)
rows_droppedNo
page_resolvedNoTrue when the page and its printed number were found; false when the citation fell back to book level (see notes) and must not be presented as a page reference; null when no page_id was given. (mode=citation only.)
parts_matchedNoDistinct parts matched; more than one means the number is ambiguous across volumes. (mode=printed_page only.)
requested_pageNoPrinted page requested. (mode=printed_page only.)
requested_partNoPart label requested; null when omitted. (mode=printed_page only.)
available_partsNoOn part_not_found: the part labels the book uses. (mode=printed_page only.)
truncation_messageNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already declare readOnly/idempotent/non-destructive, but the description adds behavior beyond them: failures surface via `status`, citable:false means Shamela's own numbering, BOOK_NOT_FOUND as an error, no arithmetic links printed number to page_id, and one printed page often spans several ids. It also flags which output fields (page_resolved, components.auto_numbered, notes[]) to inspect, though this overlaps somewhat with the existing output schema.

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-loads mode=citation before mode=printed_page and every sentence carries information. It is dense to the point of being hard to parse (fragments like 'Citations.', heavy em-dashes and « » glyphs), so it is efficient but not maximally scannable.

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 an 8-parameter, two-mode tool with an output schema, the description covers both modes, their dependencies, error surfaces, and the ambiguity case (omitting `part` reports matched parts instead of silently resolving). Nothing an agent needs in order to call it correctly appears to be missing.

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

Parameters3/5

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

Schema description coverage is 100% and the schema itself already annotates mode-specific applicability ('mode=citation only') and the full style enum. The description's parameter-level contribution is largely redundant ('it needs only the catalogue, plus the installed text'), so the baseline 3 applies even though the description is well-written.

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?

The title and first paragraph state specific verbs and resources for both modes: mode=citation builds a citation for a book/page, mode=printed_page maps a printed citation to page_ids. It explicitly separates the two behaviors and names the sibling tools (shamela_find, shamela_read) it cooperates with, so an agent can distinguish it from the lookup and read tools without opening any 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?

It gives explicit when-to-use ('Call it whenever you attribute a quote') and explicit routing ('Resolve the work with shamela_find(kind=work) first; holding a page_id already, skip this'), plus a mode-selection rule (holding a page_id → skip printed_page). Alternatives and their preconditions are named rather than left to inference.

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