Skip to main content
Glama

get_document_metadata

Read-onlyIdempotent

Retrieve document properties such as title, author, dates, page count, and file size without reading content; returns full PDF-specific fields for PDF files.

Instructions

Get document metadata including title, author, dates, page count, and file size. Use this when you need document properties without reading its content; returns full PDF-specific fields (subject, creator, producer, version) for PDF files. Read-only.

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": {
      "filename": "<filename>"
    },
    "name": "get_document_metadata"
  }
}

Input Schema

NameRequiredDescriptionDefault
filenameYesThe document filename to get metadata for

Output Schema

NameRequiredDescriptionDefault
pagesYes
titleYes
authorYes
creatorYes
subjectYes
producerYes
pdf_versionYes
creation_dateYes
file_size_bytesYes
modification_dateYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv1.4.1
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "additionalProperties": false,
      +  "properties": {
      +    "author": {
      +      "type": "string"
      +    },
      +    "creation_date": {
      +      "type": "string"
      +    },
      +    "creator": {
      +      "type": "string"
      +    },
      +    "file_size_bytes": {
      +      "type": "integer"
      +    },
      +    "modification_date": {
      +      "type": "string"
      +    },
      +    "pages": {
      +      "type": "integer"
      +    },
      +    "pdf_version": {
      +      "type": "string"
      +    },
      +    "producer": {
      +      "type": "string"
      +    },
      +    "subject": {
      +      "type": "string"
      +    },
      +    "title": {
      +      "type": "string"
      +    }
      +  },
      +  "required": [
      +    "title",
      +    "author",
      +    "subject",
      +    "creator",
      +    "producer",
      +    "creation_date",
      +    "modification_date",
      +    "pages",
      +    "file_size_bytes",
      +    "pdf_version"
      +  ],
      +  "type": "object"
      +}
  2. First observedv0.1.0

TDQS

A3.9/5.0
Behavior4/5

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

Annotations already declare readOnlyHint, idempotentHint, destructiveHint=false and openWorldHint=false, so the trailing 'Read-only.' is largely redundant. The description does add genuine behavioral context beyond the annotations by disclosing that PDF files return extra PDF-specific fields (subject, creator, producer, version).

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?

Two sentences, front-loaded with the return contents and then the usage condition, with no filler. The closing 'Read-only.' restates an annotation and is the one phrase that does not earn its place.

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?

With an output schema present, the description need not explain return values, and it still flags the PDF-specific extension of those values. For a single-parameter, read-only lookup the definition is nearly complete; the only gap is disambiguation from get_document_summary.

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?

There is only one parameter and schema description coverage is 100%, so the schema fully documents 'filename'. The description adds no meaning beyond it, such as whether a path, extension, or document ID is expected, so the baseline 3 applies.

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 names a specific verb and resource ('Get document metadata') and enumerates the fields returned (title, author, dates, page count, file size), which clearly separates it from content-reading siblings like read_document. It does not, however, distinguish itself from the close-sounding sibling get_document_summary, leaving an agent to infer the boundary.

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?

'Use this when you need document properties without reading its content' gives a clear selection condition against content-reading tools. It stops short of naming an explicit alternative or exclusion, so the get_document_summary versus metadata choice is left unstated.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.