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 controlled-vocabulary subject labels and their URIs. Use the returned label as the subject filter in libofcongress_search — LCSH uses precise, standardized terms that differ from natural language (e.g., "World War, 1939-1945" not "World War II"; "Photography, Aerial" not "Aerial photography"). Running this tool before a subject-filtered libofcongress_search dramatically improves result quality.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNoMaximum number of subject headings to return. Default 10, max 50.
queryYesKeyword or partial subject heading to search for (e.g., "civil war", "immigration", "jazz").

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
capNoThe limit applied to this response — maximum headings the API will return.
errorNoPresent when the call failed. Absent on success.
shownNoNumber of subject headings returned in this response.
totalNoNumber of subject headings returned.
noticeNoRecovery 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.
subjectsNoLCSH 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.
truncatedNoTrue when results were capped at the requested limit. Increase limit or refine the query to surface additional headings.
effectiveQueryNoThe keyword query as submitted to the id.loc.gov suggest endpoint, after trimming.

Schema Changelog

Changes observed during successful MCP inspections.

  1. 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"
      -}
  2. First observed

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already mark the tool read-only and open-world. The description adds meaningful behavioral context by disclosing that LCSH terms are standardized and differ from natural language, and by stating the return value shape (labels and URIs). It doesn't discuss pagination or response size, but the output schema and limit parameter cover enough.

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?

Four sentences, with the action and deliverable front-loaded and a well-placed example pair. The closing sentence is partly persuasive ('dramatically improves result quality') but reinforces the usage guidance rather than adding clutter.

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 read-only lookup with a full input and output schema, the description is complete: it covers what the tool finds, what it returns, why the vocabulary differs from natural language, and how to chain it into libofcongress_search. No critical calling information is 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 coverage is 100%: both query and limit carry clear descriptions, so the description need not repeat them. It adds example natural-language queries and clarifies that the returned label, not the raw query, should be used downstream, but this is usage context rather than new parameter semantics.

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 description opens with a specific verb and resource: 'Search Library of Congress Subject Headings (LCSH) by keyword.' It then states the concrete deliverable ('controlled-vocabulary subject labels and their URIs'), which clearly separates this vocabulary-lookup tool from the general libofcongress_search sibling.

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 an explicit when-to-use directive: 'Use the returned label as the subject filter in libofcongress_search' and says running it before a subject-filtered search improves quality. It also teaches the key distinction with examples ('World War, 1939-1945' not 'World War II'), so an agent knows not to pass natural-language terms directly.

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.