2.4 KiB
2.4 KiB
| name | description |
|---|---|
| log-work-expense | Log work expense receipts into MongoDB. Use when the user sends a receipt image (photo of a receipt) along with context about the expense, or says things like "log this expense", "record this receipt", "add this to my work expenses", "expense entry", or provides receipt details for work reimbursement tracking. |
Log Work Expense
Log receipt images and expense details into the wip.work_expenses collection in MongoDB.
Trigger Phrases
- "log this expense"
- "record this receipt"
- "add this to my work expenses"
- "expense entry"
Steps
- Extract receipt info — If the user sent an image, run the OCR script to read the date, vendor, and amount:
uv run --with requests python3 scripts/ocr_receipt.py /path/to/image.jpg
The script is located at ~/notes/skills/log-work-expense/scripts/ocr_receipt.py. It returns JSON with date, vendor, and amount fields. If the output doesn't contain a confident date, ask the user — never guess. If they only provided text, use that.
-
Upload the receipt image to S2 — If the user provided an image, upload it to S2 and get the public URL. If they only provided a file or no image, skip this step.
-
Insert into MongoDB — Insert a document into
wip.work_expenseswith this structure:
{
"file": "https://s2.connorrhodes.com/agent/{sha256}.{ext}",
"date": "YYYY-MM-DD",
"merchant": "Name of the merchant from the receipt (e.g. Starbucks, 7 Eleven)",
"description": "Context the user provided about the expense",
"status": "todo"
}
- file: The S2 URL of the uploaded receipt image. Omit if no image was provided.
- date: The date from the receipt, formatted as YYYY-MM-DD. If you cannot confidently read the date from the receipt, ask the user — do not guess.
- merchant: Extracted from the OCR result or the receipt image.
- description: What the user told you about the expense (e.g. "travel meal during LTISD onsite"). If they didn't provide context, ask.
- status: Always set to
"todo"when inserting.
- Confirm — Reply with a brief confirmation showing what was logged (date, note, and file link if applicable).
Notes
- Use
uv run --with pymongofor MongoDB scripts. - Use the S2 upload endpoint from TOOLS.md for file uploads.
- If the user sends a receipt without context, log what you can read from the image and note that context is pending.