Skip to main content
Glama

Get Subject

openlibrary_get_subject
Read-only

Browse works by subject. Returns matching works with edition counts and cover IDs, the total work count, and the subject type. Case and spacing are normalized before lookup, so "Science Fiction" and "science_fiction" are the same request. Prefix a value with place:, person:, or time: to browse a place, person, or time period, passing a value from openlibrary_get_work's subject_places, subject_people, or subject_times verbatim after the prefix (e.g., "place:London (England)"); a space after the colon is dropped. Subject tags are user-contributed and the vocabulary varies — when a subject returns no works, try a different word form (singular/plural), a synonym, or a broader term.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "subject": "<subject>"
    },
    "name": "openlibrary_get_subject"
  }
}

Input Schema

NameRequiredDescriptionDefault
limitNoMax works to return; values above 1000 apply 1000 when limit clamping is enabled. Subject pages typically show 12 at a time.
offsetNoZero-based offset for pagination.
subjectYesSubject name, or a place:, person:, or time: prefix followed by a place, person, or time-period value (e.g., "place:London (England)", "person:Elizabeth Bennet", "time:19th century"). Normalized before lookup — trimmed, lowercased, whitespace after a place:, person:, or time: prefix dropped, and remaining whitespace converted to underscores (e.g., " Science Fiction " → "science_fiction", "place: London" → "place:london") — so varying case or spacing does not change the result.

Output Schema

NameRequiredDescriptionDefault
errorNoPresent when the call failed. Absent on success.
worksNoWorks under this subject, up to limit.
noticeNoRecovery guidance when work_count is 0 or the offset is at or past work_count, composed with requested/applied page limits and next offset when the limit was reduced to 1000. Absent when none applies.
offsetNoZero-based offset of the first returned result — echoes the requested offset, so an empty page still records the offset that produced it.
totalCountNoTotal works tagged with this subject across all pages.
work_countNoTotal works tagged with this subject.
subject_keyNoNormalized subject key (lowercase, underscores).
subject_nameNoCanonical subject name as stored on Open Library.
subject_typeNoHow Open Library reads the key: "place", "person", or "time" for those prefixes, "subject" for anything else, an unrecognized prefix included. Absent when Open Library omits it.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changed
    • changedInput schema / properties / limit / description
      Previous value: -"Max works to return. Subject pages typically show 12 at a time."New value: +"Max works to return; values above 1000 apply 1000 when limit clamping is enabled. Subject pages typically show 12 at a time."
    • changedInput schema / properties / subject / description
      Previous value: -"Subject name. Normalized before lookup — trimmed, lowercased, and internal whitespace converted to underscores (e.g., \" Science Fiction \" → \"science_fiction\") — so varying case or surrounding whitespace does not change the result."New value: +"Subject name, or a place:, person:, or time: prefix followed by a place, person, or time-period value (e.g., \"place:London (England)\", \"person:Elizabeth Bennet\", \"time:19th century\"). Normalized before lookup — trimmed, lowercased, whitespace after a place:, person:, or time: prefix dropped, and remaining whitespace converted to underscores (e.g., \" Science Fiction \" → \"science_fiction\", \"place: London\" → \"place:london\") — so varying case or spacing does not change the result."
    • changedOutput schema / properties / notice / description
      Previous value: -"Recovery guidance when work_count is 0, composed with requested/applied page limits and next offset when the limit was reduced to 100. Absent when neither applies."New value: +"Recovery guidance when work_count is 0 or the offset is at or past work_count, composed with requested/applied page limits and next offset when the limit was reduced to 1000. Absent when none applies."
    • addedOutput schema / properties / subject_type
      Added value: +{
      +  "description": "How Open Library reads the key: \"place\", \"person\", or \"time\" for those prefixes, \"subject\" for anything else, an unrecognized prefix included. Absent when Open Library omits it.",
      +  "type": "string"
      +}
  2. Changed5 schema fields changed
    • changedInput schema / properties / limit / maximum
      Previous value: -100New value: +9007199254740991
    • changedInput schema / properties / subject / description
      Previous value: -"Subject name. Normalized before lookup — lowercased with spaces converted to underscores (e.g., \"Science Fiction\" → \"science_fiction\") — so varying case or spacing does not change the result."New value: +"Subject name. Normalized before lookup — trimmed, lowercased, and internal whitespace converted to underscores (e.g., \" Science Fiction \" → \"science_fiction\") — so varying case or surrounding whitespace does not change the result."
    • 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: `invalid_subject`: The subject is empty after trimming whitespace. Other values are possible when a failure originates below the handler."
    • addedOutput schema / properties / error / properties / data / properties / reason / examples
      Added value: +[
      +  "invalid_subject"
      +]
    • changedOutput schema / properties / notice / description
      Previous value: -"Recovery guidance when work_count is 0 — echoes the subject and suggests alternatives. Absent when works are found."New value: +"Recovery guidance when work_count is 0, composed with requested/applied page limits and next offset when the limit was reduced to 100. Absent when neither applies."
  3. Changed2 schema fields changed
    • changedOutput schema / anyOf
      Previous value: -[
      -  {
      -    "not": {
      -      "required": [
      -        "error"
      -      ]
      -    },
      -    "required": [
      -      "subject_name",
      -      "subject_key",
      -      "work_count",
      -      "works"
      -    ]
      -  },
      -  {
      -    "required": [
      -      "error"
      -    ]
      -  }
      -]New value: +[
      +  {
      +    "not": {
      +      "required": [
      +        "error"
      +      ]
      +    },
      +    "required": [
      +      "subject_name",
      +      "subject_key",
      +      "work_count",
      +      "offset",
      +      "works"
      +    ]
      +  },
      +  {
      +    "required": [
      +      "error"
      +    ]
      +  }
      +]
    • addedOutput schema / properties / offset
      Added value: +{
      +  "description": "Zero-based offset of the first returned result — echoes the requested offset, so an empty page still records the offset that produced it.",
      +  "type": "number"
      +}
  4. Changed6 schema fields changed
    • changedInput schema / $schema
      Previous value: -"http://json-schema.org/draft-07/schema#"New value: +"https://json-schema.org/draft/2020-12/schema"
    • addedInput schema / additionalProperties
      Added value: +false
    • changedOutput schema / $schema
      Previous value: -"http://json-schema.org/draft-07/schema#"New value: +"https://json-schema.org/draft/2020-12/schema"
    • addedOutput schema / anyOf
      Added value: +[
      +  {
      +    "not": {
      +      "required": [
      +        "error"
      +      ]
      +    },
      +    "required": [
      +      "subject_name",
      +      "subject_key",
      +      "work_count",
      +      "works"
      +    ]
      +  },
      +  {
      +    "required": [
      +      "error"
      +    ]
      +  }
      +]
    • addedOutput schema / properties / error
      Added value: +{
      +  "additionalProperties": {},
      +  "description": "Present when the call failed. Absent on success.",
      +  "properties": {
      +    "code": {
      +      "description": "JSON-RPC error code for this failure.",
      +      "maximum": 9007199254740991,
      +      "minimum": -9007199254740991,
      +      "type": "integer"
      +    },
      +    "data": {
      +      "additionalProperties": {},
      +      "properties": {
      +        "reason": {
      +          "description": "Machine-readable failure mode.",
      +          "type": "string"
      +        },
      +        "recovery": {
      +          "additionalProperties": {},
      +          "description": "Actionable next step for the caller.",
      +          "properties": {
      +            "hint": {
      +              "type": "string"
      +            }
      +          },
      +          "required": [
      +            "hint"
      +          ],
      +          "type": "object"
      +        },
      +        "retryable": {
      +          "description": "Whether retrying may succeed.",
      +          "type": "boolean"
      +        }
      +      },
      +      "type": "object"
      +    },
      +    "message": {
      +      "description": "Human-readable description of what went wrong.",
      +      "type": "string"
      +    }
      +  },
      +  "required": [
      +    "code",
      +    "message"
      +  ],
      +  "type": "object"
      +}
    • removedOutput schema / required
      Removed value: -[
      -  "subject_name",
      -  "subject_key",
      -  "work_count",
      -  "works"
      -]
  5. Changed1 schema field changed
    • changedInput schema / properties / subject / description
      Previous value: -"Subject name. Spaces are converted to underscores internally (e.g., \"science fiction\" → \"science_fiction\"). Use lowercase for best results."New value: +"Subject name. Normalized before lookup — lowercased with spaces converted to underscores (e.g., \"Science Fiction\" → \"science_fiction\") — so varying case or spacing does not change the result."
  6. Changed1 schema field changed
    • addedOutput schema / properties / totalCount
      Added value: +{
      +  "description": "Total works tagged with this subject across all pages.",
      +  "type": "number"
      +}
  7. Changed2 schema fields changed
    • removedOutput schema / properties / message
      Removed value: -{
      -  "description": "Recovery hint when work_count is 0 — echoes the subject and suggests alternatives. Absent when works are found.",
      -  "type": "string"
      -}
    • addedOutput schema / properties / notice
      Added value: +{
      +  "description": "Recovery guidance when work_count is 0 — echoes the subject and suggests alternatives. Absent when works are found.",
      +  "type": "string"
      +}
  8. First observed

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already cover the safety profile (readOnlyHint, openWorldHint), and the description adds genuinely non-structured behavior: case/spacing normalization, the dropped space after a prefix colon, and the caveat that subject tags are user-contributed with inconsistent vocabulary, which is the main failure mode. Return shape is partly described but is also covered by the output schema, so the added value is bounded.

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 and return shape, then prefix mechanics, then the empty-result fallback — a sensible progression with little waste. The normalization sentence re-explains in prose what the schema already documents at length, which is the only padding.

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 three-parameter read tool with full schema coverage, an output schema, and read-only annotations, nothing an agent needs in order to call it correctly is absent — lookup forms, normalization, expected return content, and recovery from a zero-result response are all covered.

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 above that by tying the subject parameter to fields on openlibrary_get_work and emphasizing verbatim reuse and the space-after-colon drop. The normalization examples are largely a restatement of the schema text, so it does not climb higher.

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+resource ("Browse works by subject") and immediately enumerates the return payload (works with edition counts and cover IDs, total work count, subject type). It is distinguishable from a free-text book search and it names the related tool whose subject_places/subject_people/subject_times fields feed its prefixed queries.

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?

It gives clear operational guidance: when to use the place:/person:/time: prefixes, where to source those values verbatim (openlibrary_get_work), and what to do when results are empty (try singular/plural, a synonym, or a broader term). What is missing is explicit routing away from this tool toward a sibling such as openlibrary_search_books when the agent has free-text instead of a subject tag.

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.