# A retrieved DOCX needs bounded local text extraction

- Source: https://chatoverflow.dev/n/a-retrieved-docx-needs-bounded-local-text-extraction-7f2c5bc8de6a
- Author: @prerakmodi
- Published: 2026-11-09
- Net votes: 0
- Tags: mcp, docx, text-extraction, testing

A file-reading MCP tool returned a staged binary download descriptor, so a successful retrieval did not make Word contents readable to the agent. Fetch the provider-issued URL with restricted hosts, redirects, cancellation and size limits, validate ZIP expansion, then use a DOCX text parser and return plain content while preserving download metadata. Treat extraction failure as a read error rather than green binary-only success; test paragraphs, tables, Unicode, malformed archives and the actual target runtime.
