/ra-mcp-tools:view-document-guidefrom ra-mcp-tools
Opens an interactive document viewer for Riksarkivet reference codes, IIIF manifests, or raw image URLs. Supports zoom, text-layer overlays, search, and fullscreen.
Ships in ra-mcp-tools. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Three tools open the interactive document viewer. Choose based on what you have:
| Tool | When to use |
|---|---|
view_document | You have a Riksarkivet reference code (e.g. from search results) |
view_manifest | You have a IIIF manifest URL (e.g. from SDHK/MPO search or any IIIF source) |
view_document_urls | You already have raw image URLs and text layer XML URLs |
All tools render the same interactive viewer with zoomable images, text-layer overlays (when ALTO XML is available), search, info panel, and fullscreen.
view_document — From Reference CodeResolves a Riksarkivet reference code into IIIF image URLs and ALTO XML text layers automatically via BrowseOperations.
| Argument | Type | Description |
|---|---|---|
reference_code | string | Archive reference code (e.g. "SE/RA/420422/01") |
pages | string | Page spec: "5", "1-10", or "5,7,9" |
| Argument | Type | Default | Description |
|---|---|---|---|
highlight_term | string | null | Pre-populate search bar and highlight matches |
max_pages | int | 20 | Maximum pages to retrieve (max: 20) |
{"reference_code": "SE/RA/420422/01", "pages": "7"}
{"reference_code": "SE/RA/420422/01", "pages": "1-10", "highlight_term": "Stockholm"}
{"reference_code": "SE/RA/310187/1", "pages": "5,7,9"}
view_manifest — From IIIF Manifest URLFetches a IIIF manifest, extracts page images and ALTO text layers (from seeAlso), and opens the viewer. Works with any IIIF Presentation API v3 manifest — Riksarkivet, Wellcome Collection, or other providers.
| Argument | Type | Description |
|---|---|---|
manifest_url | string | Full IIIF manifest URL |
| Argument | Type | Default | Description |
|---|---|---|---|
highlight_term | string | null | Pre-populate search bar and highlight matches |
max_pages | int | 20 | Maximum pages to load (max: 20) |
Riksarkivet police records (with ALTO transcription):
{"manifest_url": "https://lbiiif.riksarkivet.se/arkis!30002056/manifest"}
SDHK medieval charter (image only, no transcription):
{"manifest_url": "https://lbiiif.riksarkivet.se/sdhk!85/manifest"}
SDHK with Transkribus transcription (from Hugging Face):
{"manifest_url": "https://huggingface.co/buckets/Riksarkivet/sdhk_hack/resolve/transkribus/manifests/sdhk_R0001691.json"}
Wellcome Collection (external provider, with ALTO):
{"manifest_url": "https://iiif.wellcomecollection.org/presentation/b18035723", "max_pages": 10}
Note: Documents with ALTO XML in the manifest's seeAlso will have text overlays and transcription. Documents without show images only.
view_document_urls — From Raw URLsUse when you already have image and text layer URLs (e.g. from external sources or manual construction). Prefer view_manifest when you have a manifest URL.
| Argument | Type | Description |
|---|---|---|
image_urls | list[string] | One image URL per page (JPEG or PNG) |
text_layer_urls | list[string] | One XML URL per page (ALTO/PAGE), paired 1:1 with image_urls. Use "" for pages without transcription |
Both lists must have the same length.
| Argument | Type | Default | Description |
|---|---|---|---|
document_info | string | null | Markdown-formatted document metadata for the info panel |
highlight_term | string | null | Pre-populate search bar and highlight matches |
{
"image_urls": ["https://lbiiif.riksarkivet.se/arkis!R0001203_00007/full/max/0/default.jpg"],
"text_layer_urls": ["https://sok.riksarkivet.se/dokument/alto/R000/R0001203/R0001203_00007.xml"]
}
With document info:
{
"image_urls": ["https://example.com/page1.jpg", "https://example.com/page2.jpg"],
"text_layer_urls": ["https://example.com/page1.xml", ""],
"document_info": "## My Document\n\n**Date:** 1902\n\n**Source:** Example archive"
}
viewer_go_to_page — Jump to a Page in Open ViewerUse this when the user asks to "go to page 3" or "show page 5". Does NOT replace the loaded pages — just scrolls to that page within the already-loaded document.
| Argument | Type | Description |
|---|---|---|
page | integer | Page number (1-based) |
{"page": 3}
viewer_set_highlight — Change Highlight in Open ViewerIMPORTANT: Use this instead of calling view_document/view_document_urls again when the viewer is already open and the user just wants to highlight a different term. Calling the original tools again creates a duplicate viewer.
| Argument | Type | Description |
|---|---|---|
highlight_term | string | Search term to highlight. Use "" to clear. |
{"highlight_term": "göteborg"}
viewer_navigate — Navigate to Different Pages in Open ViewerIMPORTANT: Use this instead of calling view_document again when the viewer is already open and the user wants to see different pages. Calling the original tool again creates a duplicate viewer.
| Argument | Type | Description |
|---|---|---|
reference_code | string | Archive reference code |
pages | string | Page spec: "5", "1-10", or "5,7,9" |
highlight_term | string (optional) | Search term to highlight |
{"reference_code": "SE/RA/420422/01", "pages": "20-30", "highlight_term": "Stockholm"}
search_transcribed, search_metadata, or diplomatics:search_sdhk to find documents.browse_document to read the transcription text.view_document (reference code), view_manifest (IIIF URL), or view_document_urls (raw URLs).viewer_set_highlight or viewer_navigate to change what's displayed without creating a new viewer.| Scenario | Tool |
|---|---|
| Have a reference code from search | view_document |
| Have a IIIF manifest URL (SDHK, MPO, Wellcome, etc.) | view_manifest |
| Have raw image/ALTO URLs | view_document_urls |
| User asks to "go to page 3" | viewer_go_to_page |
| User asks to highlight/search a different term | viewer_set_highlight |
| User says "show the viewer again" / "open the document" | viewer_reopen |
| User asks to load a different set of pages | viewer_navigate or viewer_navigate_urls |
| User asks to view a completely different document | view_document, view_manifest, or view_document_urls |
Key rule: Never call the entry-point tools twice in the same conversation if the viewer is already open. Use the update tools instead.
| Mistake | Fix |
|---|---|
Calling view_document again to change the highlight | Use viewer_set_highlight — it updates the existing viewer without creating a duplicate. |
Calling view_document again to show different pages | Use viewer_navigate — it updates the existing viewer. |
Using view_document with a manifest URL | Use view_manifest for IIIF manifest URLs. view_document takes reference_code + pages. |
Using view_document with a manifest ID like 30002056 | Use a full reference code like SE/RA/.... Get it from search results. |
Mismatched list lengths in view_document_urls | Every image_urls entry needs a corresponding text_layer_urls entry. |
Forgetting "" for missing text layers | Use an empty string — do not omit the entry or use null. |
Using highlight_term on pages without text layers | Highlights require ALTO/PAGE XML. Pages with "" text layers won't have matches. |
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub ai-riksarkivet/ra-mcp --plugin ra-mcp-tools8 skills in this plugin
/archival-guideWhich Swedish records exist and where — maps a research topic to the right Förvaltningshistorik chapter (served as MCP resources), so you know what record type answers a question and which authority created it. Use when the user asks where to find records about something, what a record type is, or about court, church, tax, military, or population records (folkbokföring, bouppteckning, dombok, husförhörslängd, mantalslängd).
/archive-researchHow to browse, cite, and present archival findings — load AFTER search, when reading documents or reporting results. Covers research-integrity rules (never fabricate reference codes, always cite the exact page), old-Swedish translation, and the browse→synthesize workflow. Use when the user wants to browse or read pages, examine or interpret a document, translate old Swedish, or have findings cited and presented.
/archive-searchHow to query the Riksarkivet search tools — load BEFORE calling search_transcribed or search_metadata. Picks the right tool and builds queries with the fuzzy, wildcard, and old-Swedish-spelling tactics that AI transcription errors demand. Use when the user wants to search, find, or look up documents, people, places, or events in the Swedish National Archives (Riksarkivet) — including terms like trolldom, häxprocess, bouppteckning, or dombok.
/feedback-lsSend document pages to Label Studio for human review — pre-annotated tasks from ALTO XML, or blank image-only tasks to annotate from scratch. Use when the user wants human review, correction, or quality assurance of transcriptions or line/region segmentation, or wants to build annotation tasks from browse results.
/htr-transcriptionTranscribe handwritten historical documents with the HTRflow MCP tools — batch images into one htr_transcribe call and present the interactive viewer. Use when the user wants to transcribe or OCR handwriting, read old handwriting, or digitize a manuscript.
/pdf-guideSearches and reads Riksarkivet's archival PDF guides (medieval Sweden, governance 1520-1920, Sami history). Use when user asks about Swedish history, archives, medieval charters, governance, Sami, or wants to open/search PDF guides. Provides section-level references with page numbers for citation.Other plugins' skills for the same job