Skip to main content
Glama

libofcongress-mcp-server

Search LOC Collections

libofcongress_search
Read-only

Search the Library of Congress digital collections by keyword. Optionally filter by material format (photos, maps, newspapers, audio, etc.), date range, subject heading, or geographic location, or scope the search to a single curated collection with collection_slug. Returns item summaries with titles, dates, descriptions, LOC IDs, and format tags. Each result carries is_item: pass the id of a result where is_item is true to libofcongress_get_item for full metadata; results where is_item is false are non-item resources (collections, exhibit and research-guide pages, newspaper-page results) with no item record — open their url instead. Use libofcongress_search_subjects first to find the exact LCSH heading spelling before applying a subject filter.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pageNo1-indexed page number for paginating results.
limitNoResults per page. Default 25, max 100.
queryYesFull-text search across metadata and available descriptive text.
formatNoMaterial type filter. Options: photo, map, newspaper, manuscript, audio, film, book, notated-music. Omit to search all formats.
subjectNoSubject heading filter. Use the exact label from libofcongress_search_subjects results for best precision. Example: "World War, 1939-1945".
date_endNoEnd year for date filter, inclusive (e.g., 1930). Omit for no upper bound.
locationNoGeographic location filter (e.g., "oklahoma", "washington d.c."). Lowercase, matches LOC location facets.
date_startNoStart year for date filter, inclusive (e.g., 1920). Omit for no lower bound.
collection_slugNoScope the search to one curated collection. Use a slug exactly as returned by libofcongress_browse_collections (e.g., "aaron-copland") — slugs are not derivable from the collection title. Cannot be combined with format; omit format and read each result's format field instead. Omit to search all of LOC.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
pageNoCurrent 1-indexed page number.
errorNoPresent when the call failed. Absent on success.
itemsNoItem summaries matching the search query and filters.
pagesNoTotal retrievable pages. For result sets larger than LOC will page through (~100,000 items) this is capped, and a notice discloses how to reach the rest (partition by date/subject/location).
totalNoTotal number of matching items across all pages.
noticeNoRecovery hint when results are empty or a page is out of range — echoes applied filters and suggests how to broaden. Absent on successful result pages.
has_nextNoTrue when a retrievable next page follows this one. Never promises a page past LOC's ~100,000-item retrieval ceiling.
totalCountNoTotal matching items across all pages — mirrors output.total for agent reasoning.
effectiveQueryNoThe query as submitted to the LOC API, after trimming.
effectiveCollectionSlugNoThe collection the search was scoped to, after trimming. Absent when the search covered all of LOC.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.1/5.0
Behavior4/5

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

Annotations mark the tool as read-only, and the description adds useful behavioral context: results are item summaries, each carries an is_item flag, and non-item resources must be handled by opening their URL rather than requesting an item record. No contradiction with readOnlyHint or openWorldHint.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description uses five sentences, each with a distinct job: search purpose, filter options, return content, result-handling workflow, and subject-filter prerequisite. It is front-loaded with the central verb and resource and contains no filler.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a 9-parameter search tool with an output schema, the description covers the essential return semantics and result routing, while the schema covers parameter details. It omits guidance about the sibling libofcongress_search_newspapers, which is relevant because this tool accepts 'newspaper' as a format.

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

Parameters4/5

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

Schema coverage is 100%, so the baseline is 3; the description earns extra credit by explaining that subject headings must use exact LCSH spelling from libofcongress_search_subjects and by framing collection_slug as a scope limiter to a single curated collection. These hints go beyond the schema descriptions.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states a specific action: 'Search the Library of Congress digital collections by keyword,' and lists the available filters. It references several siblings such as libofcongress_get_item and libofcongress_search_subjects, but does not explicitly differentiate itself from libofcongress_search_newspapers even though 'newspaper' is an accepted format, leaving a small sibling ambiguity.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description gives concrete routing guidance: use libofcongress_search_subjects first for subject filters, pass is_item-true IDs to libofcongress_get_item, and open the URL for non-item results. However, it does not say when to prefer the dedicated libofcongress_search_newspapers tool over this general search for newspaper queries.

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.