sw_get_receipt
Download the receipt image or PDF attached to a Splitwise expense. Returns the file bytes or extracts PDF text directly, bypassing 401 errors on receipt URLs.
Instructions
Download the receipt image or PDF attached to a Splitwise expense. The receipt URLs returned by sw_get_expense need the server's credentials — fetching them directly returns 401 — so use this tool instead. Set inline:true to get the bytes back in the result (images AND PDFs), or extract_text:true to get a PDF's text without the binary at all — both work when the caller can't see this server's filesystem. It also writes the file and returns the path, unless write:false or the filesystem is read-only.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | Expense ID (the same id sw_get_expense takes) | |
| size | No | Which stored rendition to fetch. Defaults to 'original' (full quality, and the only one a PDF receipt has). Falls back to the other rendition when the requested one is absent. | |
| write | No | Write the receipt to disk. Defaults to true. Pass false when the caller cannot reach this server's filesystem, or when the server runs read-only. | |
| inline | No | Return the receipt bytes in the result — an image block for images, an embedded resource for PDFs and everything else. Only for receipts under 4194304 bytes. | |
| output_dir | No | Directory to write the receipt into. Defaults to $SPLITWISE_OUTPUT_DIR, else the current working directory. | |
| extract_text | No | Also return the PDF's text layer as `text`. Ideal for looking up line items or totals without transferring the file. PDFs only; a scanned receipt has no text layer to extract. |