Skip to main content
Glama

get_document_text

Retrieve clean text extracted from a Laserfiche document for summarization or analysis. Specify an entry ID to get readable content without parsing raw files.

Instructions

Download a document's server-extracted text (v2-only).

Use for "summarize this document", "what does this say", or any other task that needs the readable contents of a document rather than the raw binary. The text comes from Laserfiche's own extraction pipeline (OCR for image documents, upstream extraction for office files), so you get clean text without having to parse a PDF yourself.

v1 servers do not expose this endpoint. If your deployment is on v1 (the default), this tool returns a structured error at the client layer. Use get_document_edoc(entry_id, mode="text") instead — it fetches the raw edoc and extracts text client-side (pypdf for PDFs, direct decode for text/* MIME types).

Args: entry_id: Integer entry ID of an electronic document (not a folder). max_chars: Truncate the returned text after this many characters (default 50,000). The response's truncated field signals whether truncation occurred.

Returns: {"entry_id": <int>, "text": <str>, "char_count": <int>, "truncated": <bool>} on success.

On failure: returns {"mode": "error", "error": <slug>, "entry_id": <int>, ...}. Common slugs: not_found (entry is a folder, or has no extracted text), method_not_allowed / server_error (v1 server — fall back to get_document_edoc).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
entry_idYesEntry ID of an electronic document.
max_charsNoTruncate the returned text after this many characters.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior5/5

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

Despite no annotations, the description fully discloses behavior: v2-only, extraction pipeline (OCR for images, upstream for office), truncation with max_chars, detailed error slugs for various failure modes (not_found, method_not_allowed, server_error). Essentially all behavioral traits are covered.

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?

Well-structured with sections (Args, Returns, On failure) and bullet points. Some sentences are verbose but every sentence adds value. Could be slightly more compact without losing information.

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 has 2 parameters, an output schema, and complex behavior (version restriction, error handling), the description covers everything needed: input constraints, output format, error slugs, version fallback. The agent can fully understand how to invoke and interpret results.

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 already provides good descriptions (100% coverage), but the description adds crucial context: entry_id must be an electronic document (not folder), max_chars defaults to 50000 and truncation is signaled by the 'truncated' field. This goes beyond what the schema defines.

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?

Description clearly states the tool downloads server-extracted text for electronic documents, with explicit use cases ('summarize this document', 'what does this say'). It distinguishes itself from get_document_edoc which provides raw binary, and from other siblings that retrieve different data types.

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

Usage Guidelines5/5

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

Explicitly states when to use (tasks needing readable contents) and when not (v1 servers, raw binary needs). Provides fallback instruction to use get_document_edoc with mode='text'. No ambiguity about alternatives.

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