Skip to main content
Glama

ocr_document_xiaomi

Parse document images into Markdown with HTML tables, LaTeX formulas, and preserved reading order. Use it to convert scanned or photographed documents into structured text for extraction.

Instructions

Parse a document image into Markdown: tables become HTML tables, formulas stay LaTeX, reading order preserved. Returns {'markdown': ...}.

Backend: xiaomi. Xiaomi-OCR-0 — local 0.8B document-parsing VLM (transformers; Apple Silicon MPS, CUDA or CPU). Best structure fidelity: Markdown output, HTML tables, LaTeX formulas, key-information extraction. Strong on Cyrillic, English, German and Japanese; Arabic/Korean are weak.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "path": "<path>"
    },
    "name": "ocr_document_xiaomi"
  }
}

Input Schema

NameRequiredDescriptionDefault
pathYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv1.2.2

TDQS

B3.4/5.0
Behavior4/5

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

With no annotations, the description does real work: it names the backend and model ('Xiaomi-OCR-0', a local 0.8B VLM), the supported hardware, the output structure, and honest language-coverage weaknesses (Arabic/Korean weak). It omits operational traits such as latency, image size limits, and whether the path must be local, but the core behavioral profile is unusually well disclosed.

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?

Purpose and return value are front-loaded and the backend details follow in a compact block. There is mild redundancy — 'Markdown output, HTML tables, LaTeX formulas' restates the first sentence's transformation rules — but overall it is tight and readable.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The description compensates for the missing output schema by stating the return shape ('markdown'), and it covers model and language suitability well. However, for a single-parameter tool with 0% parameter documentation and no annotations, the total silence on what 'path' accepts leaves a genuine gap an agent must guess at.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The single parameter 'path' has 0% schema description coverage, so the description carries the burden here, and it does not say whether the path is a local filesystem path, a URL, a directory, or which image formats are accepted. The phrase 'document image' hints at an image file but adds no real semantics.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource ('Parse a document image into Markdown') and specifies the transformation rules (HTML tables, LaTeX formulas, reading order) plus the return key. It does not explicitly contrast with the many siblings such as ocr_table_xiaomi or ocr_kie_xiaomi, so an agent must infer that this is the general-purpose document parser.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The phrase 'Best structure fidelity' implies a comparison against the other backends (paddle/vision), giving weak implied guidance for choosing this tool. There is no explicit when-to-use or when-not clause, and no mention of when a sibling like ocr_table_xiaomi or ocr_text_xiaomi would be preferable.

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