All jobs

Who Still Owes Receipts This Week? A General Contractor's Friday List of Missing Receipts by Cardholder From Ramp

A general contractor's agent reads Ramp every Friday, lists each site lead's card purchases still missing a receipt or memo, and drafts one reminder per person.

Run this on RushOpens the console with this prompt ready to send. Connect Ramp there first.

What the agent does

This is for a general contractor whose superintendents, foremen and project managers carry Ramp cards: lumber and fasteners at the supply house before seven, a rented lift, fuel, a lunch for an inspector's walkthrough. The receipts end up on a dashboard or in a truck door, and the memo that says which job a purchase was for never gets typed. At month end the office manager cannot cost the jobs and spends days chasing people. Every Friday morning an agent builds the chase list instead, one section per cardholder, so the office sends each person exactly what they owe before the weekend.

The office manager connects Ramp once with POST /me/connections {"type": "mcp", "name": "ramp", "url": "https://ramp-mcp-remote.ramp.com/mcp", "auth": {"mode": "oauth"}} and signs in on Ramp's own page, choosing Read-only there. Ramp's docs say each connection acts as the signed-in user with that user's Ramp permissions, so the list covers the cardholders that person is allowed to see. Every Ramp tool takes a required rationale, and the prompt has the agent fill it with the reason for each call, so the run's transcript shows why each read was made.

On a run the agent calls ramp_get_missing_items_by_user, which Ramp describes as the users with outstanding missing items, grouped by user, with sample transactions, and follows page_cursor until it has every person. For each one it calls ramp_get_transactions with only_missing_items set and a start_at sixty days back, then ramp_get_transaction_missing_items on each transaction to learn exactly what is missing: the receipt, the memo, or an accounting field such as the job the company tracks as a category. ramp_list_users turns each user into a name, department and location, and drops anyone Ramp marks is_inactive into a separate list for the office.

It then writes the list by cardholder, oldest purchase first: date, merchant, amount and what is missing, with a mark on anything older than thirty days. For each person it drafts one short message in plain words that a foreman can act on from a phone, naming the merchant and amount rather than a transaction id. The agent only reads. The prompt forbids ramp_edit_transaction, ramp_mark_transaction_missing_receipt, ramp_post_comment and every approve or reject tool, because guessing a job code or declaring a receipt lost is the cardholder's call.

Start it with one API call

POST https://api.phoenix.so/o/{org}/sessions with this body:

{
  "agent": "claude",
  "input": "Use the Ramp connection, read only. Fill every rationale with why you are making the call. 1) Call ramp_get_missing_items_by_user and follow page_cursor to get every user with missing items. 2) For each user call ramp_get_transactions with only_missing_items true and start_at 60 days before today, following next_page_cursor, then ramp_get_transaction_missing_items for each transaction to see whether the receipt, the memo or an accounting field is missing. 3) Call ramp_list_users to get each person's name, department and location; put users with is_inactive true in a separate section. Write missing-items.md: one section per cardholder, oldest first, with date, merchant, amount in dollars, what is missing, and OVER 30 DAYS on anything older. Write messages.json: [{cardholder, department, draft}] where draft is a short, friendly text listing merchant, date and amount of each item and what to add, with no transaction ids. Do not call ramp_edit_transaction, ramp_mark_transaction_missing_receipt, ramp_post_comment, any approve_or_reject tool, or any other tool that changes Ramp.",
  "connections": [
    "ramp"
  ]
}
  1. Get an API key. In the console, open Settings, then API keys, and create a key for your org. Send it in the Authorization header as a Bearer token.
  2. Send the request. POST the body in request.json to https://api.phoenix.so/o/{org}/sessions. The run starts in its own cloud sandbox.
  3. Read what came back. Follow the run on its live stream or wait for the run.completed webhook, then read the result and its trajectory.

What comes back

missing-items.md lists each cardholder's purchases missing a receipt or memo, marks those over thirty days old, and drafts a message to each person. It comes back as an artifact beside messages.json, and the answer says how many cardholders have something outstanding and how many items are over thirty days old. The office manager reads the list, copies each draft into a text or an email to that person, and keeps the file to compare with next Friday's.

What the office manager checks first: that each item really belongs to the cardholder it is filed under, since a shared card or a card used by a crew member shows under its holder; that a purchase marked over thirty days was not already explained in person; and the inactive-users section, which is someone who has left with receipts still owed and is a question for the controller rather than a reminder. Ramp only knows what it has, so a receipt someone emailed to the wrong place still shows as missing until it is matched in Ramp.

Run it on every Friday morning

The office manager saves the agent with POST /o/{org}/agents, naming the ramp connection and the instructions above, and adds a console automation on it with a schedule trigger (0 7 * * 5, timezone America/Denver), so the list is waiting when the office opens. The saved instructions say "sixty days before today" rather than a date, because a schedule fills nothing into the prompt.

In the last week of the month a second automation on the same agent can run on the 28th with only the purchases since the first, so the chase before close covers just the month being booked.

The use case this job follows, with its automation and trigger: Produce a report or file, no repo.

Why run it on Rush?

This list reads every cardholder's purchases, so the Ramp sign-in it uses should not live in a script on the office manager's laptop or in a shared password file. On Rush it stays in one connection, signed in as one person with Read-only access, and each run acts as that person and no further. The session's accounts names the Ramp connection every run used.

Each Friday's run has its own computer, a record of every Ramp call with the rationale it gave, and the cost of its model calls. When a project manager says they were never told about a missing receipt, the run for that week shows it was on the list and what the draft said. And if the company adds a second entity or a new job category in Ramp, the agent reads it on the next run with no change to the automation.

Frequently asked questions

Will the agent message cardholders itself?

No. It writes a draft per person and the office manager sends it. The connection is signed in Read-only on Ramp's consent page and the prompt forbids every tool that writes, including ramp_post_comment, so nothing appears in Ramp or in anyone's inbox from the run.

Why are some cardholders missing from the list?

Ramp's docs say ramp_get_missing_items_by_user returns the users the signed-in person is allowed to view. Connect Ramp as someone whose role can see every card, such as the person who reviews expenses for the whole company, or the list covers only their own team.

The Ramp connection stopped working after a month. Why?

Ramp's docs say MCP connections expire after 30 days and are renewed by reconnecting. Connect it again in Rush without deleting it first; that keeps the connection's id, so the saved agent that names it keeps working.

Can it also say which job each purchase was for?

It can say which purchases are missing the job field, because ramp_get_transaction_missing_items reports a missing accounting field. It does not guess the job: a wrong job code moves cost between projects, so the cardholder fills it in.

More Ramp jobs

More jobs like this: Produce a report or file, no repo

Keep reading