2 KiB
| name | description |
|---|---|
| log-work-expense | Log work expenses into MongoDB. Use when the user sends receipt images or odometer photos along with context, or says things like "log this expense", "record this receipt", "mileage for XYZ", "meals for XYZ", or provides any expense details for work reimbursement tracking. Triggers on any message that includes expense context (account, type, images of receipts or odometers). |
Log Work Expense
Log work expenses into wip.work_expenses via scripts/log_expense.py.
Trigger Phrases
- "log this expense", "record this receipt", "add this to my work expenses"
- "mileage for XYZ", "meals for XYZ"
Steps
-
Classify images — Run each image through
scripts/classify_image.py <path>to determine if it is areceiptorodometer. The script outputs exactly one word.⚠️ Do NOT analyze receipt/odometer images yourself. Do not extract merchant names, amounts, item details, or calculate mileage. Only classify and upload. The note field should contain only what the user provides or minimal context — never information you derived from reading the images.
-
Determine type and account — The user provides the expense type and account (e.g. "meals and mileage for LTISD"). Ask if unclear.
-
Upload images to S2 — Upload all images to S2 and collect the URLs.
-
Insert via script — Run the script once per entry:
uv run --with pymongo ~/notes/skills/log-work-expense/scripts/log_expense.py <type> <account> <date> "<note>" <s2_url_1> [s2_url_2]
- Meal receipts: Run once per receipt (1 file each).
- Mileage: Run once with both odometer URLs (2 files).
The script enforces file counts and rejects invalid input.
- Confirm — Brief summary of what was logged.
Notes
- Use
classify_image.pyfor image classification — it calls the vision model and returns only "receipt" or "odometer". - Use the S2 upload endpoint from TOOLS.md for file uploads.
- The log script hardcodes MongoDB connection details — do not pass credentials.