read-file
Retrieves an attachment by ID, returning its metadata and image content for PNG/JPEG/GIF. Use outputPath to save non-displayable attachments to disk.
Instructions
Retrieve an attachment file by its ID. Returns the file metadata, and the image itself when it is a PNG, JPEG or GIF. Pass outputPath to write the attachment to disk instead — required to get at SVG, HEIC and HEIF attachments, which cannot be displayed inline.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| fileId | Yes | ID of the attachment to retrieve. It can be found as `_id` in the file docs. It always starts with `file:`. | |
| outputPath | No | Absolute path to write the attachment to. When given, the file is saved there and its bytes are not returned inline. | |
| includeImage | No | Whether to return the image itself alongside the metadata. Set to false to fetch only the metadata of a large attachment. |