Documents

Read a PDF

documents_read_pdf · Reads only · Markdown

The text of a PDF in the store, page by page, up to 50 pages a call.

Free*

*Free up to 1,000,000 reads a month for the whole account, then $0.50 per 10,000 reads.

An example

What do the delivery terms from our freight company say about damaged goods?

Your agent callsdocuments_read_pdfFree*

The example business is Hansen & Voss, a restaurant-equipment wholesaler in Hamburg with 60 staff. The reply is the one the tool really gives.

With these arguments
{
  "file_id": "7e9a1c3e-5b7d-4f9b-8d1f-4a6c8e0a2b5f"
}
What comes back
{
  "pages": [
    {
      "page": 1,
      "text": "Delivery terms"
    },
    {
      "page": 2,
      "text": "7. Damaged goods: report visible damage on the delivery receipt at once, hidden damage within 7 days in writing."
    }
  ],
  "page_count": 2
}

Use it when

A PDF's words are needed: terms, a contract, a report.

What it does

The text of a PDF in the store, page by page (up to 50 pages a call; ask for later pages with first_page). Scanned pages without a text layer come back empty: files_ocr reads them ($0.005 a page).

What comes back

pages: each with its number and text; and page_count, the pages in the PDF. Every reply also carries cost_usd and balance_usd.

Inputs

NameTypeWhat it is
file_idRequiredstringA file in the store (files_upload or files_list give its file_id). Exactly 36 characters.
first_pageintegerAt least 1. Default: 1.
last_pageintegerAt least 1.

The call

Over MCP, call documents_read_pdf on https://api.conecto.chat/mcp/documents. Over REST:

Terminal
curl -X POST https://api.conecto.chat/v1/tools/documents_read_pdf \
  -H "Authorization: Bearer $CONECTO_KEY" \
  -H "Content-Type: application/json" \
  -d '{"file_id":"7e9a1c3e-5b7d-4f9b-8d1f-4a6c8e0a2b5f"}'

When it refuses

A refused call costs nothing and says what to do next.

CodeWhenWhat to do
not_found404No file in the store has that file_id.Find it with files_list, or upload it first.
invalid_input400first_page is past the end of the PDF.Ask for pages it has.
invalid_pdf422The PDF could not be read (damaged, or password-protected).Ask for another copy.
pdf_locked422The PDF is password-protected.Ask for a copy without a password.
busy503PDFs are being read for other calls right now.Try again in a minute; nothing was charged.

Give this to your agent.

Set up Conecto from https://conecto.chat/SKILL.md