Skip to main content
Glama

libofcongress-mcp-server

Search LOC Items

libofcongress_search_items
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, catalog.loc.gov records, hdl.loc.gov finding aids) with no item record — open their url instead. Use libofcongress_search_subjects to find an LCSH heading for the subject filter. To discover the subject and location values the filters accept for a search, set include_facets to get its top subject_facets and location_facets.

Input Schema

NameRequiredDescriptionDefault
pageNo1-indexed page number for paginating results.
limitNoResults per page. Default 25. A page holds at most 100 results: a larger limit (up to 1000) is served as a 100-result page, and page then counts 100-result pages.
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 filter: an LCSH heading from libofcongress_search_subjects (e.g., "World War, 1939-1945", "United States--History--Civil War, 1861-1865") or a subject term from subject_facets (include_facets) or libofcongress_get_item subject_terms (e.g., "world war"). LOC indexes headings by their parts, so the value is split at "--" into lowercase terms with dates dropped, and an item must carry every term.
date_endNoEnd year for date filter, inclusive (e.g., 1930). Omit to run through the current year.
locationNoGeographic location filter (e.g., "oklahoma", "washington d.c."). Lowercase, matches LOC location facets; location_facets (include_facets) lists values for a search.
date_startNoStart year for date filter, inclusive (e.g., 1920). Omit for no lower bound.
include_facetsNoAlso return subject_facets and location_facets: LOC's top subject and location terms across every match, with counts — the values the subject and location filters accept. Default false: facets add time to each search, so request them when you need filter values to narrow by.
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

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, subject terms and location included, and suggests how to broaden — plus disclosure of a capped limit or of the retrieval ceiling. Absent on ordinary 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.
effectiveLimitNoThe page size actually served when limit exceeded the per-call cap of 100. Absent when limit was within the cap.
effectiveQueryNoThe query as submitted to the LOC API, after trimming.
subject_facetsNoLOC's top subject terms across every item matching this search (up to 10), most frequent first. Pass a value as the subject filter to narrow the search. Present only when include_facets is true; empty when LOC reports none.
location_facetsNoLOC's top location terms across every item matching this search (up to 10), most frequent first. Pass a value as the location filter to narrow the search. Present only when include_facets is true; empty when LOC reports none.
effectiveSubjectTermsNoThe subject terms the subject filter was sent as, all required to match. Absent when no subject filter was given.
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. Changed3 schema fields changed
    • changedOutput schema / properties / items / items / properties / date / description
      Previous value: -"Publication or creation date as LOC catalogs it: free text, a year, or a full date (e.g., \"c1915 Feb. 19.\", \"1912\")."New value: +"Publication or creation date as LOC catalogs it: free text, a year, or a full date (e.g., \"c1915 Feb. 19.\", \"1912\"). Absent when LOC records only a coded value (\"uuuu\", \"||||\") or none."
    • changedOutput schema / properties / items / items / properties / id / description
      Previous value: -"LOC identifier for this result. When is_item is true, pass it to libofcongress_get_item for full metadata. When is_item is false it is a non-item resource (a collection, exhibit, guide, or newspaper page), not a get_item input — open url instead."New value: +"LOC identifier for this result: an item ID, or the bare LCCN of a record whose url is an lccn.loc.gov permalink. When is_item is true, pass it to libofcongress_get_item for full metadata. When is_item is false it is a non-item resource (a collection, exhibit, guide, newspaper page, catalog.loc.gov record, or hdl.loc.gov finding aid), not a get_item input — open url instead."
    • changedOutput schema / properties / items / items / properties / is_item / description
      Previous value: -"True when this result is a catalog item whose id resolves through libofcongress_get_item. False for collections, exhibits, research guides, newspaper pages, and other non-item results, which have no get_item record — follow url instead. Always present on every result."New value: +"True when this result is a catalog item whose id resolves through libofcongress_get_item, including records LOC links by an lccn.loc.gov permalink. False for collections, exhibits, research guides, newspaper pages, catalog.loc.gov records, hdl.loc.gov finding aids, and other non-item results, which have no get_item record — follow url instead. Always present on every result."
  2. Changed14 schema fields changed
    • changedInput schema / properties / date_end / description
      Previous value: -"End year for date filter, inclusive (e.g., 1930). Omit for no upper bound."New value: +"End year for date filter, inclusive (e.g., 1930). Omit to run through the current year."
    • addedInput schema / properties / include_facets
      Added value: +{
      +  "default": false,
      +  "description": "Also return subject_facets and location_facets: LOC's top subject and location terms across every match, with counts — the values the subject and location filters accept. Default false: facets add time to each search, so request them when you need filter values to narrow by.",
      +  "type": "boolean"
      +}
    • changedInput schema / properties / limit / description
      Previous value: -"Results per page. Default 25, max 100."New value: +"Results per page. Default 25. A page holds at most 100 results: a larger limit (up to 1000) is served as a 100-result page, and page then counts 100-result pages."
    • changedInput schema / properties / limit / maximum
      Previous value: -100New value: +1000
    • changedInput schema / properties / location / description
      Previous value: -"Geographic location filter (e.g., \"oklahoma\", \"washington d.c.\"). Lowercase, matches LOC location facets."New value: +"Geographic location filter (e.g., \"oklahoma\", \"washington d.c.\"). Lowercase, matches LOC location facets; location_facets (include_facets) lists values for a search."
    • changedInput schema / properties / subject / description
      Previous value: -"Subject heading filter. Use the exact label from libofcongress_search_subjects results for best precision. Example: \"World War, 1939-1945\"."New value: +"Subject filter: an LCSH heading from libofcongress_search_subjects (e.g., \"World War, 1939-1945\", \"United States--History--Civil War, 1861-1865\") or a subject term from subject_facets (include_facets) or libofcongress_get_item subject_terms (e.g., \"world war\"). LOC indexes headings by their parts, so the value is split at \"--\" into lowercase terms with dates dropped, and an item must carry every term."
    • addedOutput schema / properties / effectiveLimit
      Added value: +{
      +  "description": "The page size actually served when limit exceeded the per-call cap of 100. Absent when limit was within the cap.",
      +  "type": "number"
      +}
    • addedOutput schema / properties / effectiveSubjectTerms
      Added value: +{
      +  "description": "The subject terms the subject filter was sent as, all required to match. Absent when no subject filter was given.",
      +  "items": {
      +    "type": "string"
      +  },
      +  "type": "array"
      +}
    • changedOutput schema / properties / error / properties / data / properties / reason / description
      Previous value: -"Machine-readable failure mode. Declared by this tool: `invalid_date_range`: date_start is later than date_end. `incompatible_filters`: format and collection_slug were both supplied; each selects a different LOC endpoint, so only one can apply. `collection_not_found`: collection_slug does not resolve to a LOC collection. Reported on page 1; a later page gets the out-of-range notice, since LOC answers both cases the same way there. `rate_limit_exceeded`: LOC API rate limit exceeded; requests are blocked for approximately 1 hour. `server_busy`: More Library of Congress requests are queued on this server than can start within this call's time budget. `request_timed_out`: The Library of Congress did not respond within the 50-second request budget. Other values are possible when a failure originates below the handler."New value: +"Machine-readable failure mode. Declared by this tool: `invalid_date_range`: date_start is later than date_end, or date_start is given alone and is later than the current year. `incompatible_filters`: format and collection_slug were both supplied; each selects a different LOC endpoint, so only one can apply. `collection_not_found`: collection_slug does not resolve to a LOC collection. Reported on page 1; a later page gets the out-of-range notice, since LOC answers both cases the same way there. `rate_limit_exceeded`: LOC API rate limit exceeded; requests are blocked for approximately 1 hour. `server_busy`: More Library of Congress requests are queued on this server than can start within this call's time budget. `request_timed_out`: The Library of Congress did not respond within the 50-second request budget. `upstream_unavailable`: The Library of Congress could not be reached, or answered with an error status, a bot challenge or other HTML page, or an unreadable response instead of its JSON. Other values are possible when a failure originates below the handler."
    • changedOutput schema / properties / error / properties / data / properties / reason / examples
      Previous value: -[
      -  "invalid_date_range",
      -  "incompatible_filters",
      -  "collection_not_found",
      -  "rate_limit_exceeded",
      -  "server_busy",
      -  "request_timed_out"
      -]New value: +[
      +  "invalid_date_range",
      +  "incompatible_filters",
      +  "collection_not_found",
      +  "rate_limit_exceeded",
      +  "server_busy",
      +  "request_timed_out",
      +  "upstream_unavailable"
      +]
    • changedOutput schema / properties / items / items / properties / date / description
      Previous value: -"Publication or creation date."New value: +"Publication or creation date as LOC catalogs it: free text, a year, or a full date (e.g., \"c1915 Feb. 19.\", \"1912\")."
    • addedOutput schema / properties / location_facets
      Added value: +{
      +  "description": "LOC's top location terms across every item matching this search (up to 10), most frequent first. Pass a value as the location filter to narrow the search. Present only when include_facets is true; empty when LOC reports none.",
      +  "items": {
      +    "additionalProperties": false,
      +    "description": "One location facet value.",
      +    "properties": {
      +      "count": {
      +        "description": "Matching items carrying this location term.",
      +        "type": "number"
      +      },
      +      "value": {
      +        "description": "The location term, as the location filter accepts it.",
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "value",
      +      "count"
      +    ],
      +    "type": "object"
      +  },
      +  "type": "array"
      +}
    • changedOutput schema / properties / notice / description
      Previous value: -"Recovery 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."New value: +"Recovery hint when results are empty or a page is out of range — echoes applied filters, subject terms and location included, and suggests how to broaden — plus disclosure of a capped limit or of the retrieval ceiling. Absent on ordinary result pages."
    • addedOutput schema / properties / subject_facets
      Added value: +{
      +  "description": "LOC's top subject terms across every item matching this search (up to 10), most frequent first. Pass a value as the subject filter to narrow the search. Present only when include_facets is true; empty when LOC reports none.",
      +  "items": {
      +    "additionalProperties": false,
      +    "description": "One subject facet value.",
      +    "properties": {
      +      "count": {
      +        "description": "Matching items carrying this subject term.",
      +        "type": "number"
      +      },
      +      "value": {
      +        "description": "The subject term, as the subject filter accepts it.",
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "value",
      +      "count"
      +    ],
      +    "type": "object"
      +  },
      +  "type": "array"
      +}
  3. Added

TDQS

A4.8/5.0
Behavior5/5

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

Annotations declare only readOnlyHint and openWorldHint; the description goes well beyond them by disclosing the is_item routing contract, the concrete non-item resource types (collections, exhibit/research-guide pages, newspaper pages, catalog.loc.gov records, hdl.loc.gov finding aids), and the cost tradeoff that facets add time to each search.

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?

Purpose and primary filters are front-loaded, then routing rules and facet guidance follow in a logical order with no filler. The long parenthetical enumerating non-item resource types is dense but earns its place by telling the agent what to do with those results.

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 a 10-parameter, mixed-result search tool with an output schema already present, the description covers everything an agent needs to act: filter sourcing, facet discovery, the collection_slug/format conflict, and how to dispatch each result type. Return-value shape is left to the output schema, which is correct.

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, but the description adds real semantics the schema does not: the subject value is split at "--" into lowercase terms with dates dropped and an item must carry every term, and collection_slug must be a slug from libofcongress_browse_collections because it is not derivable from a title. It stops short of explaining limit/page interaction, which the schema already handles.

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?

Opens with a specific verb+resource pair ("Search the Library of Congress digital collections by keyword") and immediately enumerates the filter axes available. It explicitly names the sibling tools it routes to (libofcongress_get_item, libofcongress_search_subjects) and distinguishes itself from them, so an agent can place it without opening a 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?

Gives explicit when-to-use routing: pass is_item=true ids to libofcongress_get_item, open url for is_item=false resources, use libofcongress_search_subjects to source an LCSH heading, and set include_facets to discover subject/location filter values. It also states a hard exclusion — collection_slug cannot be combined with format — which is exactly the kind of constraint that prevents a failed call.

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.