Skip to main content
Glama
pietermyb

mcp-pdf-reader

list-pdf-metadata

Extract and display metadata from PDF files, including title, author, and creation date, to analyze document properties.

Instructions

List metadata of an open PDF

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pdf_idYesID of the PDF to get metadata for

Implementation Reference

  • The handler function for the 'list-pdf-metadata' tool. It retrieves the PDF reader for the given pdf_id, extracts the metadata, formats it as text, and returns it wrapped in TextContent.
    elif name == "list-pdf-metadata":
        pdf_id = arguments.get("pdf_id")
        if not pdf_id or pdf_id not in pdfs:
            raise ValueError("Invalid PDF ID")
    
        reader = pdfs[pdf_id]
        metadata = reader.metadata
    
        if metadata:
            metadata_text = "\n".join([f"{k}: {v}" for k, v in metadata.items()])
        else:
            metadata_text = "No metadata available"
    
        return [
            types.TextContent(
                type="text",
                text=f"Metadata for '{os.path.basename(pdf_paths[pdf_id])}':\n\n{metadata_text}",
            )
        ]
  • Registration of the 'list-pdf-metadata' tool in the list_tools handler, including name, description, and input schema requiring 'pdf_id'.
    types.Tool(
        name="list-pdf-metadata",
        description="List metadata of an open PDF",
        inputSchema={
            "type": "object",
            "properties": {
                "pdf_id": {"type": "string", "description": "ID of the PDF to get metadata for"},
            },
            "required": ["pdf_id"],
        },
    ),
    types.Tool(
  • JSON schema for the input parameters of the 'list-pdf-metadata' tool, specifying 'pdf_id' as required.
    inputSchema={
        "type": "object",
        "properties": {
            "pdf_id": {"type": "string", "description": "ID of the PDF to get metadata for"},
        },
        "required": ["pdf_id"],
    },
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions 'open PDF', implying a prerequisite state, but doesn't detail what metadata is returned (e.g., author, creation date, page count), error handling, or performance aspects. This leaves significant gaps in understanding the tool's behavior.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that directly states the tool's purpose without unnecessary words. It is front-loaded and appropriately sized for a simple tool, making it easy to parse and understand quickly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a tool with no annotations and no output schema, the description is incomplete. It doesn't explain what metadata is returned (e.g., structured data like JSON or plain text), potential errors, or how it interacts with sibling tools. This lack of context makes it inadequate for fully understanding the tool's use in complex scenarios.

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?

The input schema has 100% description coverage, clearly documenting the 'pdf_id' parameter. The description adds no additional meaning beyond this, such as format examples or constraints. Given the high schema coverage, a baseline score of 3 is appropriate, as the schema adequately handles parameter semantics.

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 clearly states the verb ('List') and resource ('metadata of an open PDF'), making the purpose specific and understandable. However, it doesn't explicitly differentiate from sibling tools like 'get-pdf-page-count' or 'open-pdf', which might also involve PDF metadata or operations, leaving some ambiguity about its unique role.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives, such as when to prefer 'list-pdf-metadata' over 'open-pdf' or other siblings. It lacks context on prerequisites (e.g., the PDF must be open) or exclusions, offering minimal usage direction.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/pietermyb/mcp-pdf-reader'

If you have feedback or need assistance with the MCP directory API, please join our Discord server