Skip to main content
Glama

Convert PDF to JSON

pdf_to_json
Read-onlyIdempotent

Convert a PDF to JSON with metadata, page count, and each page's text. Use when you need page structure or a JSON file for other tools.

Instructions

Convert a local PDF into structured JSON: document metadata (title, author...), page count, and the text of each page. Use read_file for a quick plain-text read; use this when you need page structure, metadata, or a JSON file other tools can consume (e.g. json_query).

Args:

  • path (string): The PDF file.

  • output_path (string): Optional .json destination. If set, the full JSON is written there and only a summary is returned — best for large PDFs.

Returns { source, total_pages, metadata, pages: [{ page, text }] }.

Example: { "path": "/papers/attention.pdf", "output_path": "/papers/attention.json" }

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYesPDF file path
output_pathNoOptional .json file to write the result to
Behavior4/5

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

Annotations already indicate readOnlyHint=true and destructiveHint=false. The description adds behavioral details: it returns a structured JSON with source, total_pages, metadata, and pages array, and explains the output behavior when output_path is set (writes file, returns summary). No contradictions.

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?

Description is concise and well-structured: first paragraph explains purpose and differentiation, second describes parameters, third shows return format and example. No unnecessary words, every sentence contributes.

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?

Given the annotations and full schema coverage, the description is nearly complete. It covers return structure, parameter behavior, and usage alternatives. Could mention error cases (e.g., file not found) but not required for basic operation.

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 provides 100% coverage with descriptions. Description adds value: 'path' is clarified as 'The PDF file' and 'output_path' explains the conditional behavior (if set, writes JSON and returns summary). This enriches the schema information.

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 clearly states the tool converts a local PDF into structured JSON, enumerating document metadata, page count, and text per page. It distinguishes itself from the sibling tool 'read_file' by specifying the additional capabilities.

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?

Explicit guidance on when to use this tool versus the alternative 'read_file': 'Use read_file for a quick plain-text read; use this when you need page structure, metadata, or a JSON file other tools can consume.' This provides clear context for tool selection.

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/highercomve/mcptools'

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