Skip to main content
Glama

get_document_edoc

Download or inspect a document's raw electronic file (edoc) from Laserfiche. Three modes: info (metadata), bytes (base64), or text (extracted from PDFs).

Instructions

Download or inspect a document's raw electronic file (edoc).

The recommended path for reading document content on v1 servers (get_document_text has no endpoint to call there). Three modes trade off cost vs. depth:

Args: entry_id: Integer entry ID. Must point to an electronic document, not a folder. mode: "info" (default) — fetches the edoc but returns only its size and content-type, plus a hint. No bytes enter the model's context. Cheapest; safe to call on anything as a first probe.

    ``"bytes"`` — returns the edoc as base64-encoded bytes plus
    content-type and size. Refused if the edoc exceeds
    ``LF_EDOC_MAX_BYTES`` (default 25 MB) — see ``max_bytes``.

    ``"text"`` — extracts readable text server-side:

    - ``application/pdf`` → pypdf, page by page, truncated to
      ``text_char_limit``. Response includes ``pages_total``,
      ``pages_extracted``, ``truncated``.
    - ``text/*`` → decoded directly as UTF-8 (replacement chars
      on bad bytes).
    - Anything else (.docx, .xlsx, images, etc.) → structured
      error naming the content-type and suggesting ``mode="bytes"``
      for client-side handling. OCR is not attempted.
    - Encrypted or malformed PDFs → structured error with the
      underlying exception class.
max_bytes: Per-call override for ``LF_EDOC_MAX_BYTES``. Use to
    raise the cap for a specific large document without changing
    the server-wide default.
text_char_limit: Truncate extracted text after this many
    characters (default 50,000). Truncation is signalled by the
    ``truncated`` field, NOT a marker in the text itself.

Returns: Always a dict. Shape depends on mode — see above. On size-cap refusal, response contains error="size_exceeds_cap" plus byte_size and max_bytes so the LLM can decide whether to raise the cap and retry.

On failure: returns {"mode": "error", "error": <slug>, "entry_id": <int>, ...}. Common slugs: not_found (entry is a folder, or has no edoc), auth_failed.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
entry_idYesEntry ID of an electronic document (not a folder).
modeNo'info' (default): metadata only, no bytes returned. 'bytes': base64 payload, capped by max_bytes / LF_EDOC_MAX_BYTES. 'text': server-side extracted text — PDF via pypdf, text/* decoded directly, other types return unsupported_content_type. OCR is not attempted.info
max_bytesNoPer-call override for LF_EDOC_MAX_BYTES (default 25 MB). Only applies to mode='bytes' and 'text'.
text_char_limitNoTruncate extracted text after this many characters (mode='text' only).

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior5/5

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

With no annotations, the description carries full burden. It thoroughly discloses behavior: three modes with detailed return info, size cap handling, error slugs for various cases (e.g., `not_found`, `auth_failed`), and details on text extraction limitations (OCR not attempted, encrypted PDFs).

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?

The description is well-structured with bullet points for modes and parameter details. It is fairly long but each sentence adds value. Slightly verbose in explaining modes, but overall efficient.

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?

Given the complexity (4 params, 3 modes, output schema), the description is very complete. It explains return shapes per mode, error responses with common slugs, and size cap behavior. The output schema exists but the description adds essential context on failure modes and edge cases.

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

Parameters5/5

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

Schema coverage is 100%, and the description adds significant detail beyond the schema. For example, it explains the mode enum in depth (including default and behavior for each), the `max_bytes` override, `text_char_limit` truncation signaling, and the `entry_id` requirement.

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?

The description clearly states 'Download or inspect a document's raw electronic file (edoc).' It also distinguishes itself from the sibling tool `get_document_text` by noting that `get_document_text` has no endpoint on v1 servers, making the purpose specific and differentiated.

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

Usage Guidelines4/5

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

The description provides clear context: it is the recommended path for reading content on v1 servers, and explains the three modes with trade-offs. It does not explicitly state when not to use, but the alternatives are implied through the mode explanations and the mention of `get_document_text`.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/SamuelSHernandez/laserfiche-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server