Skip to main content
Glama

Convert a document to clean, AI-ready Markdown

convert_document

Convert PDF, DOCX, PPTX, XLSX, CSV, or JSON files from a local path or public URL into clean, compact, AI-ready Markdown, with optional OCR for scanned PDFs.

Instructions

Convert a document (PDF, DOCX, PPTX, XLSX, CSV, JSON) into clean, compact, AI-ready Markdown using PackForAI. Provide either a local file path or a public url. Returns the compact Markdown plus a token comparison, ready to read or paste into a prompt. Use ocr: true for scanned / image-only PDFs.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "convert_document"
  }
}

Input Schema

NameRequiredDescriptionDefault
ocrNoForce OCR for scanned or image-only PDFs (Pro). Defaults to false.
urlNoPublic https URL of a document to fetch and convert.
fullNoReturn the full document.md (e.g. complete spreadsheet tables) instead of the compact version. Defaults to false.
pathNoAbsolute path to a local document file to convert.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.9/5.0
Behavior3/5

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

With no annotations, the description carries the full behavioral burden. It helpfully discloses the return payload (compact Markdown plus a token comparison) and that OCR is a Pro-tier capability, but omits file-size limits, network/privacy implications of fetching a URL, error behavior, and whether the conversion is a remote third-party call via PackForAI.

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, front-loaded with the capability and then the input modes and the OCR tip. Close to optimal, though "clean, compact, AI-ready Markdown" and "compact Markdown" restate the same value proposition twice.

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?

For a four-parameter, zero-required-parameter conversion tool, the description covers capability, input sourcing, output shape (compensating for the absent output schema), and the OCR flag. Remaining gaps are edge-case behavior such as missing input, size limits, and failure modes.

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 description coverage is 100%, so the schema already documents all four parameters, and the baseline is 3. The description adds modest value by framing `path` and `url` as an either/or choice and by reiterating the OCR condition, but it adds nothing about `full` or the format constraints on `url`.

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 ("Convert a document ... into ... Markdown") and enumerates the supported input formats (PDF, DOCX, PPTX, XLSX, CSV, JSON), so an agent knows exactly what the tool does and accepts. No sibling tools exist to differentiate against, so there is nothing further to disambiguate.

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 concrete usage conditions: supply either a local `path` or a public `url`, and set `ocr: true` for scanned or image-only PDFs. It stops short of explicit when-not-to-use guidance or stating what happens when both/neither input source is supplied, which keeps it out of the top band.

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

Deploy Server

Other Tools