Skip to main content
Glama

Trích chữ file đính kèm

mail_attachment_text
Read-only

Extracts text from email attachments (PDF, DOCX, XLSX, CSV, TXT, HTML, EML) and optionally saves originals to a work directory for reuse.

Instructions

Trích chữ từ file đính kèm (PDF có lớp chữ, DOCX, XLSX, CSV, TXT, HTML, EML). save=true → lưu file gốc vào /attachments để dùng tiếp (vd làm đính kèm).

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": {
      "uid": "<uid>",
      "index": "<index>"
    },
    "name": "mail_attachment_text"
  }
}

Input Schema

NameRequiredDescriptionDefault
uidYes
saveNo
indexYes
folderNoINBOX

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.11.0

TDQS

B3/5.0
Behavior2/5

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

The description usefully discloses the side effect and its destination ('lưu file gốc vào <workdir>/attachments'), which annotations alone would not reveal. However, that write to the filesystem sits in tension with readOnlyHint=true, and nothing is said about size limits, failures on PDFs without a text layer, or what happens when the index is out of range.

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?

Two compact sentences with the core operation front-loaded and the conditional save behavior clearly separated by the arrow. No filler, though the format list is a long parenthetical that could be tightened.

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

Completeness3/5

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

An output schema exists, so return-value description is not required, and the save side effect is covered. What is missing for a four-parameter extraction tool is how to identify the target attachment (uid/index/folder semantics) and how it relates to the sibling reading tools.

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

Parameters2/5

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

Schema description coverage is 0%, so all four parameters carry only bare titles. The description explains the meaning of save (persist the original file for reuse) and implies the scope is an attachment inside a message, but uid, index and folder are never explained, so half the parameter surface remains opaque.

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?

The description names a specific verb and resource ('Trích chữ từ file đính kèm') and enumerates which formats are supported (PDF with text layer, DOCX, XLSX, CSV, TXT, HTML, EML), which lets an agent predict failure on a scanned PDF. It does not contrast itself with the sibling file_read or explain the relationship to mail_read, so it stops short of a 5.

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 only implied: the tool is for attachments rather than the message body, and the save branch is conditioned ('save=true → ... để dùng tiếp, vd làm đính kèm'). There is no explicit statement of when to prefer this over file_read or when to skip extraction entirely.

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