Skip to main content
Glama

Parse document

mcpParse
Read-only

Parse a document into structured blocks, Markdown, HTML or A2UI, or a short summary of it. Give the document ONE way: fileRef: an uploaded file (mcp-file://docparse/file_...). The same user can use it again for 30 minutes after the first use (more parts, another format), then it is deleted. file: in ChatGPT, the file the user attached (ChatGPT fills it in). filepath: an https:// URL of a publicly reachable document, or a sample id from mcpFormats such as "sample_docx_formatting". content + filename: short text only (Markdown, HTML, CSV); the filename's extension picks the parser. outputFormat: blocks (default), markdown, html, a2ui, or summary (counts, the first 50 headings, warnings: a few KB). Look with summary first when a document may be large. Large documents come in parts: when the result has page.nextCursor, call mcpParse again with the same fileRef/filepath and cursor= for the next part; read every part before answering about the whole document. maxChars sets the part size as a string of digits (default "80000", "2000".."120000"). pdfBackend: leave empty for PDFs with a text layer. Set "ai" when the result is PDF_TEXT_LAYER_SPARSE (a scanned PDF): each page is read by an AI model, about 5 seconds a page, and the call counts as an AI request. Pass the same pdfBackend with every cursor call. Which way to send a file: a file in your sandbox or workspace: call createUpload (one token PER FILE; set count for several) and run its curl line, then call this tool with the fileRef the upload prints. curl fails with a network error, or the user wants to pick a file: call uploadDocument; the user chooses it in the AILANG Parse card, which uploads it and gives you its fileRef. a public https:// link: filepath. Short text: content. Never parse the file yourself (your own script, or your own reading of it) and present that as this tool's result: if the file cannot be sent, tell the user.

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": "mcpParse"
  }
}

Input Schema

NameRequiredDescriptionDefault
fileNo
apiKeyNo
cursorNo
contentNo
fileRefNo
filenameNo
filepathNo
maxCharsNo
requestIdNo
pdfBackendNo
outputFormatNo
contentEncodingNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / properties / pdfBackend
      Added value: +{
      +  "type": "string"
      +}
  2. Changed2 schema fields changed
    • addedInput schema / properties / cursor
      Added value: +{
      +  "type": "string"
      +}
    • addedInput schema / properties / maxChars
      Added value: +{
      +  "type": "string"
      +}
  3. Changed2 schema fields changed
    • addedInput schema / properties / file
      Added value: +{
      +  "additionalProperties": false,
      +  "properties": {
      +    "download_url": {
      +      "type": "string"
      +    },
      +    "file_id": {
      +      "type": "string"
      +    },
      +    "file_name": {
      +      "type": "string"
      +    },
      +    "mime_type": {
      +      "type": "string"
      +    }
      +  },
      +  "required": [
      +    "download_url",
      +    "file_id"
      +  ],
      +  "type": "object"
      +}
    • addedInput schema / properties / fileRef
      Added value: +{
      +  "type": "string"
      +}
  4. Changed4 schema fields changed
    • addedInput schema / properties / content
      Added value: +{
      +  "type": "string"
      +}
    • addedInput schema / properties / contentEncoding
      Added value: +{
      +  "type": "string"
      +}
    • addedInput schema / properties / filename
      Added value: +{
      +  "type": "string"
      +}
    • changedInput schema / required
      Previous value: -[
      -  "filepath",
      -  "outputFormat"
      -]New value: +[]
  5. Changed1 schema field changed
    • changedInput schema / required
      Previous value: -[
      -  "filepath",
      -  "outputFormat",
      -  "apiKey",
      -  "requestId"
      -]New value: +[
      +  "filepath",
      +  "outputFormat"
      +]
  6. First observed

TDQS

A4.8/5.0
Behavior5/5

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

Goes well beyond the annotations: it discloses the 30-minute fileRef lifetime and deletion, that AI-mode PDF parsing costs ~5s per page and counts as an AI request, that pdfBackend must be repeated across cursor calls, and that all parts must be read before answering about the whole document. These are exactly the non-obvious behavioral costs and constraints an agent needs, and they are consistent with readOnlyHint/openWorldHint/idempotentHint=false.

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 the purpose, then organized into labeled sections (input routes, outputFormat, pagination, pdfBackend, how to send a file) with indented bullets that make scanning easy. It is longer than most descriptions, but nearly every line conveys a distinct operational rule; the repetition of fileRef/filepath in the cursor paragraph is minor.

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 12-parameter, branching tool with no output schema, the description covers input selection, output format semantics, pagination protocol, cost/speed implications, and cross-tool routing. The only real gaps are the auxiliary parameters (apiKey, requestId, contentEncoding) and error-shape detail, which are secondary given the tool's complexity is otherwise fully addressed.

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?

With 0% schema description coverage the description carries the load well, explaining fileRef format, filepath accepted values, content+filename extension-driven parsing, outputFormat options, cursor usage, maxChars default and range, and pdfBackend values. However apiKey, requestId, and contentEncoding are never mentioned, so three of twelve parameters remain undocumented anywhere.

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?

Names a specific verb and resource ('parse a document') and enumerates the concrete outputs (blocks, markdown, html, a2ui, summary), which lets an agent distinguish it from mcpConvert and mcpFormats named in the sibling list. An agent knows exactly what it gets back without opening the schema.

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?

Explicitly says 'Give the document ONE way' and then routes each situation: fileRef for already-uploaded files, file for ChatGPT attachments, filepath for public URLs or sample ids, content+filename for short text, plus a decision tree pointing to createUpload or uploadDocument when the file isn't reachable otherwise. It also advises calling with summary first for large documents and warns never to substitute your own parsing, leaving almost nothing to inference.

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.