Files

Read a scan with OCR

files_ocr · Changes data · Runs in the background · Markdown

Reads the words in a scan with OCR: an image, or the pages of a PDF without text; the text is kept.

$0.005 per page read

From your agent’s balance. A call that fails costs nothing.

An example

Read the scanned delivery receipt so we can search it later.

Your agent callsfiles_ocr$0.005 per page read

The example business is Halverson Cycle & Repair, a bike shop with a repair workshop in Portland, Oregon. The reply is the one the tool really gives.

With these arguments
{
  "file_id": "3a5c7e9b-1d4f-4a6c-8e0a-2c4e6a8c0b3e",
  "languages": [
    "deu",
    "eng"
  ]
}
What comes back
{
  "file_id": "3a5c7e9b-1d4f-4a6c-8e0a-2c4e6a8c0b3e",
  "pages_read": 1,
  "total_pages": 1,
  "languages": [
    "deu",
    "eng"
  ],
  "length": 94,
  "text": "Packing slip PS-2026-1043\nCascade Bike Supply\n12 tires, 700x40\nReceived: Sam Reyes, 10/13/2026"
}

Use it when

A scan or a photo of a document should become text that can be read and found.

What it does

Read the words in a scan with OCR (Tesseract): an image (PNG, JPEG, TIFF, WebP) or the pages of a PDF that have no text of their own, up to 100 pages (pages with text keep it). The text is kept: files_read_text and account_search find it afterwards, free. languages: up to 3 (default: the account's, see files_ocr_settings). max_pages is the most this call may read; it holds $0.005 for each until the reading is done, then charges the pages read. OCR reads what is printed; making sense of it is your work.

What comes back

When it finishes: the file_id, pages_read and total_pages, the languages used, and the text (up to 20,000 characters; files_read_text has the rest). Every reply also carries cost_usd and balance_usd.

Inputs

NameTypeWhat it is
file_idRequiredstringThe file_id files_upload returned. Exactly 36 characters.
languagesarray of stringsUp to 3 of eng, deu, fra, spa, ita, nld, por, swe. Up to 3 items. One of: eng,deu,fra,spa,ita,nld,por,swe.
max_pagesinteger1 to 100. Default: 100.

The call

Over MCP, call files_ocr on https://api.conecto.chat/mcp/files. Over REST:

Terminal
curl -X POST https://api.conecto.chat/v1/tools/files_ocr \
  -H "Authorization: Bearer $CONECTO_KEY" \
  -H "Content-Type: application/json" \
  -d '{"file_id":"3a5c7e9b-1d4f-4a6c-8e0a-2c4e6a8c0b3e","languages":["deu","eng"]}'

When it refuses

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

CodeWhenWhat to do
not_found404No file of the business has that file_id.Find it with files_list.
invalid_input400A language is not one OCR reads here, or there are more than 3.Use up to 3 of eng, deu, fra, spa, ita, nld, por, swe.
unsupported_type400The file is not an image (PNG, JPEG, TIFF, WebP) or a PDF.Read other files with files_read_text.
not_image400The file says it is an image but cannot be read as one.Upload it again as PNG or JPEG.
already_read409The scan was read with OCR already.Read its text free with files_read_text.
nothing_to_read409Every page has text of its own.Read it free with files_read_text.
in_progress409This scan is being read right now.Read it with files_read_text in a minute.
ocr_in_progress409Another scan of the business is being read; OCR reads one at a time.Call again once that call is done (account_get_call shows it).
too_many_pages413The scan has more pages to read than max_pages.Pass the max_pages the message names.
too_large413The image is over 40 megapixels.Shrink it with image_transform first.
pdf_locked422The PDF is password-protected.Ask for a copy without a password.
invalid_pdf422The file is not a PDF that can be read.Ask for another copy.
ocr_failed422OCR could not read the file.Try a sharper scan.
timeout422Reading the scan took too long.Read fewer pages at a time with max_pages.
crashed422Reading the scan needed more memory or time than a file may use.Split the scan, or send smaller pages.
busy503Files are being read for other calls right now.Try again in a minute; nothing was charged.
unavailable503OCR is not switched on here yet.Nothing was charged; try again later.

Give this to your agent.

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