share_files
Read workspace file contents inline or create a secure, time-limited download link. Always preview file metadata and obtain approval before sharing.
Instructions
Reads or shares workspace files. Three actions are available: 'read' — return file contents inline. For PDFs: (1) If the user specifies a page number, read that range directly using pageStart/pageEnd. (2) If searching for a topic, first read pages 1-10 to find the Table of Contents. If no TOC is found in pages 1-10, extend to pages 1-20, then check the final 10 pages as some PDFs place the index at the back. (3) If the PDF has no TOC, scan in 15-page chunks from the beginning until the topic is located. (4) Always read in chunks of 20 pages or fewer. Never request the full PDF in a single call. (5) If a section appears to continue beyond the chunk boundary, read the next chunk to complete it. (6) For PDFs under 15 pages total, reading the entire document in one call is acceptable. 'preview' — REQUIRED first step before sharing. Returns file metadata (name, size, type, modified) and a short-lived confirmationToken. Present ALL metadata to the user and ask for explicit approval before proceeding. Never skip this step. 'download' — generate a public download link. Requires the confirmationToken returned by a prior 'preview' call for the same file. A link CANNOT be generated without a valid token.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| filePath | Yes | The name of the file inside the workspace (e.g., invoice.pdf) | |
| action | Yes | read | preview | download. Always call 'preview' before 'download'. | |
| confirmationToken | No | Required for action=download. The token returned by the preceding 'preview' call for this exact file. | |
| pageStart | No | PDF files only. The first page to return, 1-based (page 1 = first page). Omit only if the PDF is under 15 pages total and you intend to read the whole file. | |
| pageEnd | No | PDF files only. The last page to return, inclusive and 1-based. Keep the range between pageStart and pageEnd to 20 pages or fewer to avoid context overflow. If the content you need continues beyond pageEnd, make a follow-up call with the next range. Omit only if the PDF is under 15 pages total. |