Skip to main content
Glama

libofcongress-mcp-server

Search LC Subject Headings

libofcongress_search_subjects
Read-only

Search Library of Congress Subject Headings (LCSH) by keyword. Returns authorized subject headings and their URIs, ranked by relevance with a heading that exactly matches the query first; a partial word with no keyword match returns the headings that begin with it. Use the returned label as the subject filter in libofcongress_search_items — LCSH uses precise, standardized terms that differ from natural language (e.g., "World War, 1939-1945" not "World War II"; "Aerial photography" not "Photography, Aerial"). Running this tool before a subject-filtered libofcongress_search_items dramatically improves result quality.

Input Schema

NameRequiredDescriptionDefault
limitNoMaximum number of subject headings to return. Default 10. A call returns at most 50 headings; a larger limit (up to 1000) returns up to 50.
queryYesKeyword or partial subject heading to search for (e.g., "civil war", "immigration", "jazz").

Output Schema

NameRequiredDescriptionDefault
capNoThe heading limit applied to this response.
errorNoPresent when the call failed. Absent on success.
shownNoNumber of subject headings returned in this response.
totalNoNumber of subject headings returned.
noticeNoRecovery hint when no heading matched; how many headings matched when more exist than this response holds; disclosure of a capped limit. Absent when every matching heading was returned.
subjectsNoLCSH subject headings matching the query, ordered by relevance, an exact match first. To see how many LOC items carry a heading, pass its label as the libofcongress_search_items subject filter and read total.
truncatedNoTrue when more headings match than this response holds. Refine the query to see others, or raise limit when it is below 50.
effectiveLimitNoThe heading count actually applied when limit exceeded the per-call cap of 50. Absent when limit was within the cap.
effectiveQueryNoThe query as submitted to the id.loc.gov subject suggest endpoint, after trimming.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed10 schema fields changed
    • changedInput schema / properties / limit / description
      Previous value: -"Maximum number of subject headings to return. Default 10, max 50."New value: +"Maximum number of subject headings to return. Default 10. A call returns at most 50 headings; a larger limit (up to 1000) returns up to 50."
    • changedInput schema / properties / limit / maximum
      Previous value: -50New value: +1000
    • changedOutput schema / properties / cap / description
      Previous value: -"The limit applied to this response — maximum headings the API will return."New value: +"The heading limit applied to this response."
    • addedOutput schema / properties / effectiveLimit
      Added value: +{
      +  "description": "The heading count actually applied when limit exceeded the per-call cap of 50. Absent when limit was within the cap.",
      +  "type": "number"
      +}
    • changedOutput schema / properties / effectiveQuery / description
      Previous value: -"The keyword query as submitted to the id.loc.gov suggest endpoint, after trimming."New value: +"The query as submitted to the id.loc.gov subject suggest endpoint, after trimming."
    • changedOutput schema / properties / error / properties / data / properties / reason / description
      Previous value: -"Machine-readable failure mode. Declared by this tool: `request_timed_out`: The Library of Congress subject heading service 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: `request_timed_out`: The Library of Congress subject heading service did not respond within the 50-second request budget. `upstream_unavailable`: The Library of Congress subject heading service could not be reached, or answered with an error status, an 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: -[
      -  "request_timed_out"
      -]New value: +[
      +  "request_timed_out",
      +  "upstream_unavailable"
      +]
    • changedOutput schema / properties / notice / description
      Previous value: -"Recovery hint when results are empty, or when the upstream candidate cap under-filled the request. Distinguishes \"exhausted by ranking\" (retry with a more specific query) from \"no LCSH coverage\", and suggests inverted-form strategies. Absent when the full requested set was returned."New value: +"Recovery hint when no heading matched; how many headings matched when more exist than this response holds; disclosure of a capped limit. Absent when every matching heading was returned."
    • changedOutput schema / properties / subjects / description
      Previous value: -"LCSH subject headings matching the query, ordered by relevance. To see how many LOC items carry a heading, pass its label as the libofcongress_search_items subject filter and read total."New value: +"LCSH subject headings matching the query, ordered by relevance, an exact match first. To see how many LOC items carry a heading, pass its label as the libofcongress_search_items subject filter and read total."
    • changedOutput schema / properties / truncated / description
      Previous value: -"True when results were capped at the requested limit. Increase limit or refine the query to surface additional headings."New value: +"True when more headings match than this response holds. Refine the query to see others, or raise limit when it is below 50."
  2. Changed4 schema fields changed
    • changedOutput schema / properties / error / properties / data / properties / reason / description
      Previous value: -"Machine-readable failure mode."New value: +"Machine-readable failure mode. Declared by this tool: `request_timed_out`: The Library of Congress subject heading service did not respond within the 50-second request budget. Other values are possible when a failure originates below the handler."
    • addedOutput schema / properties / error / properties / data / properties / reason / examples
      Added value: +[
      +  "request_timed_out"
      +]
    • changedOutput schema / properties / subjects / description
      Previous value: -"LCSH subject headings matching the query, ordered by relevance. To see how many LOC items carry a heading, pass its label as the libofcongress_search subject filter and read total."New value: +"LCSH subject headings matching the query, ordered by relevance. To see how many LOC items carry a heading, pass its label as the libofcongress_search_items subject filter and read total."
    • changedOutput schema / properties / subjects / items / properties / label / description
      Previous value: -"Standardized LCSH heading — use this exact string in the libofcongress_search subject filter."New value: +"Standardized LCSH heading — use this exact string in the libofcongress_search_items subject filter."
  3. Changed2 schema fields changed
    • changedOutput schema / properties / subjects / description
      Previous value: -"LCSH subject headings matching the query, ordered by relevance."New value: +"LCSH subject headings matching the query, ordered by relevance. To see how many LOC items carry a heading, pass its label as the libofcongress_search subject filter and read total."
    • removedOutput schema / properties / subjects / items / properties / count
      Removed value: -{
      -  "description": "Approximate number of LOC items carrying this heading. Omitted when unavailable.",
      -  "type": "number"
      -}
  4. First observed

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already declare readOnlyHint and openWorldHint, so safety is covered. The description goes further than the structured data by disclosing ranking behavior (exact match first), fallback behavior for partial words, and the shape of the result (headings plus URIs). It omits any note on the 50-result cap, but that ceiling is carried in the 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-loaded with purpose, then ranking behavior, then the cross-tool workflow. Dense and mostly waste-free, though the closing sentence about improving result quality partly restates the earlier instruction to use the label as a filter.

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 two-parameter lookup tool with an output schema, an explicit safety annotation set, and a fully described schema, the description supplies everything an agent needs: what it returns, how results are ordered, and how they feed a sibling tool.

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%, so both parameters are already documented in the schema, including the limit cap and the query semantics. The description reinforces query intent with example terms but adds no syntax or format detail beyond what the schema provides, so the baseline 3 applies.

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?

States a specific verb and resource ('Search Library of Congress Subject Headings (LCSH) by keyword') and immediately characterizes the return (authorized headings and URIs). An agent can distinguish it from libofcongress_search_items, which searches items rather than the heading vocabulary.

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?

Explicitly tells the agent to run this before a subject-filtered libofcongress_search_items and to feed the returned label in as the subject filter. It names the alternative tool and the condition that selects it, leaving nothing 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.