Skip to main content
Glama

laserfiche_document_get_edoc

Retrieve a document's electronic file (edoc) in three modes: info for metadata, bytes for base64 payload, or text for extracted content. Handles size limits and returns structured errors.

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?

No annotations are provided, so the description bears full responsibility. It thoroughly explains behavioral traits: mode-specific handling, size cap enforcement, truncation signaling, error slugs (not_found, auth_failed), and that OCR is not attempted. It also details response shapes and failure modes.

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 sections for Args, Returns, and On failure, using bullet points for modes. It is front-loaded with the purpose. While somewhat lengthy, every sentence adds value. Minor redundancy in error explanation could be trimmed.

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 tool's complexity (4 parameters, 3 modes, output schema present), the description is exceptionally complete. It covers all modes, error cases, edge cases (encrypted PDFs, unsupported types), and explains why get_document_text is unavailable on v1. It leaves no ambiguity for agent invocation.

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%, but the description adds significant context beyond schema defaults and descriptions. It explains per-mode applicability of max_bytes and text_char_limit, the default cap of 25 MB, and how bytes mode refuses oversized files. It also clarifies that text_char_limit truncation is signaled via a field, not a marker.

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)', differentiating from sibling tools by noting that 'get_document_text has no endpoint to call there' on v1 servers. It explicitly describes three modes and their purposes.

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 advises using 'info' as a first probe, and distinguishes between modes for different needs. It implicitly contrasts with get_document_text by explaining when this tool is the alternative. However, it does not explicitly list all alternative tools or provide a when-not-to-use scenario.

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