--- name: log-work-expense description: Log work expense receipts and mileage into MongoDB. Use when the user sends receipt images or odometer photos along with context about the expense, or says things like "log this expense", "record this receipt", "add this to my work expenses", "expense entry", "mileage for XYZ", or provides receipt/mileage details for work reimbursement tracking. --- # Log Work Expense Log receipt images and mileage into the `wip.work_expenses` collection in MongoDB. ## Trigger Phrases - "log this expense" - "record this receipt" - "add this to my work expenses" - "expense entry" - "mileage for XYZ" ## Steps 1. **Upload images to S2** — Upload any images the user provided to S2 and collect the URLs. 2. **Insert into MongoDB** — Insert a document into `wip.work_expenses` with this structure: **Single receipt:** ```json { "files": ["https://s2.connorrhodes.com/agent/{sha256}.{ext}"], "date": "YYYY-MM-DD", "note": "Context the user provided", "status": "todo" } ``` **Mileage (multiple odometer photos):** ```json { "files": ["https://s2.connorrhodes.com/agent/{sha2561}.jpg", "https://s2.connorrhodes.com/agent/{sha2562}.jpg"], "date": "YYYY-MM-DD", "note": "Context the user provided about the trip", "status": "todo" } ``` - **files**: Array of S2 URLs. One entry for receipts, two entries for mileage (start and end odometer). - **date**: Always use today's date (the date you receive the message), formatted as YYYY-MM-DD. - **note**: What the user told you about the expense or trip. If they didn't provide context, ask. - **status**: Always set to `"todo"` when inserting. 3. **Confirm** — Reply with a brief confirmation showing what was logged (date, note, and file links). ## Notes - Use `uv run --with pymongo` for MongoDB scripts. - Use the S2 upload endpoint from TOOLS.md for file uploads.