Skip to content

Long-running tasks and result files ​

Standalone enhancement and OCR document export follow submit → query → deliver. Successful submission establishes a task; it does not mean output files have been downloaded. Keep the returned handle and use the same MCP server instance to query or cancel it.

Before submission ​

  • Finish active scans with scan.finish. Scanning and long tasks cannot run concurrently in one instance.
  • Use local image paths readable by MCP Server, preferably absolute paths. Paths on another client computer or temporary Runtime paths are not suitable inputs.
  • Order input_paths by page. Use input_path for one image. If both are provided, the single path comes before the array; choosing one form is usually clearer.
  • Discover enhancement capabilities and choose a pipeline or saved workflow rather than guessing algorithm parameters.

Example: export images as an OCR PDF ​

Replace the paths with actual images and submit in the desired page order:

json
{
  "name": "ocr.recognize",
  "arguments": {
    "input_paths": [
      "/ABSOLUTE/PATH/TO/page-1.png",
      "/ABSOLUTE/PATH/TO/page-2.png"
    ],
    "format": "pdf",
    "export_type": "multi-page"
  }
}

format accepts txt, pdf, docx, xlsx, ofd, and json, defaulting to docx. export_type defaults to multi-page for merged output; single-page exports inputs individually. An unsupported platform or recognition-service format returns an error without automatic format fallback.

Pass extra OCR / export settings through the documented params object. Output quality is separate from recognition input; do not compress recognition images merely to reduce document size.

Example: reuse an enhancement workflow ​

Use image.enhance_workflow_list / image.enhance_workflow_get to confirm an actual workflow ID, then submit:

json
{
  "name": "image.enhance",
  "arguments": {
    "input_paths": ["/ABSOLUTE/PATH/TO/page-1.png"],
    "workflow_id": "YOUR_WORKFLOW_ID"
  }
}

Alternatively, supply a structured pipeline instead of workflow_id; they are mutually exclusive. A workflow is resolved to a snapshot before execution. Enhanced PDF, OFD, or TIFF output does not imply an OCR text layer. Use OCR export for searchable text.

Query and receive results ​

Submission returns handle, task_id, status, and a compact task status. Use handle for management, not the Runtime task_id.

json
{
  "name": "ocr.get",
  "arguments": {
    "handle": "RETURNED_HANDLE"
  }
}

For enhancement, call image.enhance_get with handle. Each get queries once without occupying the tool queue continuously. Keep the handle and query at intervals while work runs, avoiding tight loops. Even if submission already reports completion, call get to deliver files.

Status or fieldNext action
Queued, running, or another nonterminal statusRetain the same handle and continue querying the matching get tool
completed / succeededGet downloads files; inspect assets, warnings, and delivery errors, then save result information
failedRead the error; successful submission is not successful processing
cancelledCancellation is confirmed; end this workflow
delivery_status: "failed"Processing finished but file delivery failed; do not report files as available
status: "unknown" / outcome: "unknown"The final outcome cannot be confirmed; do not automatically resubmit

The terminal get is the final query. After completed, failed, or cancelled terminal handling, the handle is released. Further queries return UNKNOWN_HANDLE; save that response and its file paths. Delivery failure also releases a terminal handle. Repeating get or resubmitting is not a guaranteed file-recovery method. Check existing files, disk space, permissions, and connectivity, retain the error, and establish a recovery approach before proceeding.

Request cancellation ​

json
{
  "name": "ocr.cancel",
  "arguments": {
    "handle": "RETURNED_HANDLE"
  }
}

For enhancement, use image.enhance_cancel. Interpret the response carefully:

  • cancel_requested: true with cancel_confirmed: false: the service accepted the request but has not confirmed stopping. The task still occupies the slot; continue get queries rather than starting another task.
  • cancel_confirmed: true: cancellation is confirmed and the handle is released.
  • Already terminal: follow the reported status rather than calling it a successful cancellation. Prefer get for completed-result file delivery.
  • Authorization changes, disconnects, or cancellation errors: connection release alone does not prove that underlying computation stopped. cancel_confirmed: false is not a successful cancellation.

Server shutdown attempts cleanup but does not replace normal query and cancellation. There is no cross-process task recovery after restarting the server. Do not blindly resubmit unknown handles or outcomes, as processing could be duplicated.

Local file delivery ​

OperationFile informationDelivered content
scan.captureimages[]MCP images, local_path, file_uri, content_type, size
image.process / image.process_page / image.apply_color_modeTop-level resultMCP images and the same local file fields
Enhancement get / OCR getassets[]Local file fields; images also have MCP image content, while documents are not presented as images

size is in bytes; inspect content_type for the actual file type. file_uri points to a file on the server computer, not a public download link. CZUR_OPEN_MCP_IMAGE_DIR selects the output root; the default is the user's cache directory with scan/task subdirectories. Existing files are not overwritten. Files remain after a scan ends or a task handle is released; users manage cleanup.

If you only need text, synchronous ocr.extract_text returns full text, blocks, and coordinates without creating a long-task handle. See Tools Reference for parameters.