Skip to main content
Glama

attachment_extract

Extracts text from uploaded PDF, DOCX, XLSX, and UTF-8 files, returning character windows so long documents can be read in parts by continuing from an offset.

Instructions

Extract text from an uploaded file. Handles PDF (text layer), .docx and .xlsx, and any UTF-8 text format. Returns a character window so a long document can be read in pieces: pass offset to continue where the previous call stopped. An empty PDF result means it is a scan, not that extraction failed.

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": "attachment_extract"
  }
}

Input Schema

NameRequiredDescriptionDefault
pathYesAbsolute path, or a filename in the attachments directory.
offsetNoStart character offset (default 0).
maxCharsNoWindow size (default 200000).

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.8/5.0
Behavior4/5

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

With no annotations, the description carries the full behavioral burden and does appreciable work: it discloses that output is a bounded character window rather than a whole document, and pre-empts a dangerous misread by stating that an empty PDF result means the file is a scan, not that extraction failed. It still omits error behavior (missing path, unsupported or corrupt file) and any size or rate constraints.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Three compact sentences, front-loaded with the purpose, then formats, then pagination, then the failure-mode caveat. Every sentence adds information; nothing is redundant with the name or schema.

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

Completeness4/5

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

For a three-parameter read tool with no output schema and no annotations, the description covers what matters: supported inputs, the windowed return shape, and the scan/failure ambiguity. The main remaining gap is how the agent knows it has reached the end of the document rather than just a short window.

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

Parameters3/5

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

Schema description coverage is 100%, so the schema already documents path, offset, and maxChars, giving a baseline of 3. The description adds modest meaning by framing offset as continuation state across calls, but says nothing about maxChars truncation semantics or what to do when the window ends.

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?

"Extract text from an uploaded file" names a specific verb and resource and enumerates supported formats (PDF text layer, .docx, .xlsx, UTF-8 text), so an agent knows exactly what it does. It does not, however, distinguish itself from nearby siblings such as attachment_read or attachment_chunk, leaving the agent to infer which of those is the right entry point.

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?

Usage is implied rather than stated: the mention of passing offset to continue where the previous call stopped tells the agent this tool is paginated and should be called repeatedly for long documents. There is no explicit when-not guidance, no prerequisites (e.g. file must be uploaded first via attachment_begin/commit), and no sibling alternatives named.

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