1.6 KiB
Send files to the user. Use this when the file is the deliverable — a generated diagram, a report, a screenshot, a built artifact — and you want it surfaced, not just mentioned. Paths can be absolute or relative to the current working directory.
Add a caption when a one-liner of context helps ("the failing case is row 42", "before vs after"). Skip it if the file speaks for itself.
Set status on every call. Use proactive when you're initiating — the user is away and you want this to reach their phone (build artifact ready, report generated). Use normal when replying to something the user just said.
Set display to choose how the file is presented. Use 'render' when the user should see the content inline in the side panel right now — a chart, a rendered HTML page, a diagram, an image. Use 'attach' when the file is something they'll save and open elsewhere — source code, a spreadsheet, a document for another app — and an inline preview would just be noise. Leave it unset to let the client decide by file type.
Files must already exist on the local filesystem — the tool sends files, it doesn't fetch URLs or render content. When unsure of a path, verify with ls first; absolute paths avoid ambiguity about the working directory.
Example: SendUserFile({ files: ["report.md"], caption: "Here's the report.", status: "normal" })