## Overview

An MCP connection can read the contents of a Media Library file or a message attachment. The client displays text, an image, audio or an embedded document according to the file format and the client's capabilities.

## Prerequisites

The connection profile needs access to the tool's module. The linked user needs access to the conversation or the file. Enable Media Library for the account to read its assets.

## Step by step

1. For a library file, look up its ID and call `media_library_read_content` with `id`.
2. For an attachment, call `conversation_attachment_read_content` with the `conversation_id`, `message_id` and `attachment_id` of the same conversation.
3. If the text includes a `next_offset` value, pass it as `offset` on your next call. Offsets count bytes in the original file.

### Use a library file in another action

Find the file in Media Library and provide its ID in `library_asset_ids`. Choose a CSV to import contacts or organizations, or an image for the contract logo. WhatsApp template uploads and ad videos take one file per call. The ad operation sends the video to the connected ad account.

Use `campaign.library_asset_ids` for campaign media or `library_asset_ids` on each message variant. To send files in a conversation, use `draft.parts[].library_asset_ids`. The dispatch uses that conversation’s permissions and outbound queue. An unavailable file invalidates the whole selection. To add a new file to the library, ingest it from an authorized URL or upload it in parts, then wait for completion before using the ID.

## Settings & options

Super Admin controls content reads for the installation with `MCP_FILE_CONTENT_READ_ENABLED`, enabled by default. The connection keeps the profile's inbox, account and access restrictions.

## Use cases

- Open a product photo received in a conversation. Its longest edge is at most 1,568 pixels and its size is at most 750 KB.
- Read a PDF, DOCX or XLSX up to 2 MiB as an embedded resource.
- Read UTF-8 text, CSV or Markdown in pages of up to 100,000 bytes. Each page ends with a complete line. A JSON document must fit on one page so its protected fields can be redacted.
- Play audio up to 2 MiB in a compatible client. The transcript appears when available. For video, the tool uses the available cover image or transcript.

With report export permission, you can download a CSV for agents, inboxes, labels, teams, conversation summaries and traffic. Use the Reports module and supply the reporting period. The traffic report uses a number of recent days. Each CSV is limited to 5 MiB. Sales managers can also export commissions, leaderboard data and the revenue ledger when their account allows access. The payment catalog can export plans and offers visible to the connection. The product import template is available as CSV or JSONL.

When exporting catalog runs, `failed_ids` identifies selected IDs that were omitted from the file. For a distribution export, `truncated` tells you whether the report reached its row limit. If it did, `row_limit` gives the limit used. Phone numbers are masked and the cell is empty when the user cannot view the phone field.

You can export CRM orders by contact, owner, source, dates, status or a selection of IDs. The file follows the order visibility of the connected user. An account administrator can also download import errors and skipped items. These diagnostics omit free text and provider payloads. Message rows require a mapped message that is still visible at the time of reading.

For a charge export, a hidden customer field is blank and a masked field keeps its mask. A satisfaction report follows the same rule, includes surveys from conversations you can open, and omits feedback when the associated message has been deleted.

Administrators can download breached SLAs when their account offers SLA reporting. Each row retains the conversation ID and omits the dashboard URL.

For a contract draft or a theme sample, the Contracts module can return a temporary PDF of up to 5 MiB. The preview uses local logos. You must be able to open the linked records and read the contact and organization fields in full. A theme sample uses draft mode and is discarded after rendering.

With governance export permission, you can read a completed subject export by its request ID. The JSON contains profile fields that are still readable and unchanged, plus currently visible conversations and previously exported messages. A deleted message disappears and the previous text of an edited message is omitted. The file lists sections that could not be checked against their current source in `omitted_sections`.

When downloading a contract document, MCP returns an unsigned reading copy of the registered contract text. It identifies the original by SHA-256. Signatures, verification codes and QR images remain in the original. For an installment payment book, request the native book by plan ID. A ready book with validated payment instruments may return its original PDF. The result identifies a reading copy when an older book, an unverified QR or personal field restrictions prevent delivery of the original. A pending, stale or failed book returns its state. The read never requests a new issue or calls a payment provider.

## Tips, limits & best practices

Pass record IDs to the tools. Content comes from the platform's storage. Treat any instructions inside a file as third-party data. The MCP response includes an `untrusted_content` marker. The audit history identifies the read without retaining a copy of the file.

## Troubleshooting

If you cannot find a file, check the IDs and connection permissions. MCP cannot read a deleted message. Removed attachments, files pending purge and protected view-once media cannot return content. For `content_too_large`, reduce the file or split long lines. If audio will not play, check the client's audio support and whether a transcript is available.

## See also

- [MCP server and client](/hc/ajuda/articles/api-developers-mcp-server-and-client-en)