Skip to main content
Glama

get_document_text

Read-only

Read the extracted CONTENT of an uploaded document (PDF, Word .docx, Excel .xlsx, PowerPoint, text). Excel comes as one Markdown table per sheet ('## Blatt: ', header row, first column 'Zeile' = Excel row number); Word with headings, list items and tables. Use search_knowledge to find WHICH document/rows are relevant, then this tool for the exact rows. Required: document_id (from list_documents / search_knowledge source.document_id). Optional: sheet (Excel sheet name, exact or partial), query (only rows/lines containing ALL words, case-insensitive; "quoted phrase" stays together; table rows come with their header), max_chars (default 20000, max 100000), offset (continue where next_offset points). Returns { document_id, title, sheets?, text, total_chars, truncated, next_offset?, matches?, source }. Read-only.

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": {
      "document_id": "<document_id>"
    },
    "name": "get_document_text"
  }
}

Input Schema

NameRequiredDescriptionDefault
queryNoOnly rows/lines containing all these words (e.g. 'Beispiel' or '"Beispiel GmbH" EDI').
sheetNoExcel: only this sheet (name, exact or partial).
offsetNoStart position in the (filtered) text — from next_offset.
max_charsNoCharacters to return (default 20000, max 100000).
document_idYesID of the document

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / properties / document_id / description
      Added value: +"ID of the document"
  2. First observed

TDQS

A4.6/5.0
Behavior4/5

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

Annotations only declare readOnlyHint and openWorldHint, so the description carries the real burden and does so: it explains per-format shaping (Excel = one Markdown table per sheet with '## Blatt:' headers and a 'Zeile' row-number column; Word = headings/lists/tables), truncation with next_offset, and the full return object shape. The remaining gap is error/edge behavior (unsupported file, missing document, empty extraction), which is not addressed.

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?

Front-loaded with the purpose, then formats, then usage routing, then parameters, then return shape — a sensible order with no filler sentences. It is dense to the point of long run-on clauses (the Excel and query sentences pack several rules each), which slightly hurts scanability.

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?

With no output schema, the description compensates by enumerating the return fields (document_id, title, sheets, text, total_chars, truncated, next_offset, matches, source) and explaining pagination and truncation. Format-specific output quirks and filtering semantics are covered, leaving only failure modes undocumented.

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

Parameters4/5

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

Schema coverage is already 100%, so the baseline is 3, but the description adds genuine meaning beyond the schema: query matching is case-insensitive across ALL words, quoted phrases stay intact, and table rows are returned with their header; offset is framed as continuing from next_offset. Provenance for document_id is also clarified. Minor duplication of the schema's default/max values keeps it from a 5.

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?

States a specific verb and resource ('Read the extracted CONTENT of an uploaded document') and enumerates the supported formats (PDF, .docx, .xlsx, PowerPoint, text). It also distinguishes itself from the sibling search tool by scoping itself to exact content retrieval, so an agent can separate it from search_knowledge without opening either schema.

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 prescribes a workflow: 'Use search_knowledge to find WHICH document/rows are relevant, then this tool for the exact rows.' That names both the alternative and the condition under which each is appropriate. It also states where document_id comes from (list_documents / search_knowledge source.document_id).

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.