All jobs

Build a Monthly Spend Report From Ramp

Yes. An agent reads last month's Ramp cards, reimbursements and bills and returns spend.md by department, category and vendor, with the biggest changes.

What the agent does

The run reaches Ramp through the Ramp connection, Ramp's remote MCP server at https://ramp-mcp-remote.ramp.com/mcp in the Rush connector catalog, connected once by the person whose Ramp access the report should have. Ramp's server loads each kind of record into a small SQL database in the session (load_transactions, load_reimbursements, load_bills, load_departments, load_vendors) and answers queries over it, so the agent can group and compare spend in SQL rather than by reading rows one at a time.

It loads two calendar months: last month and the one before, for the comparison. Card transactions bring the cardholder and their department, the merchant and Ramp's spend category. Reimbursements bring the employee and amount, and bills the vendor and the bill's category. The agent puts all three in one spend table with a source column, so a vendor paid both by card and by bill is counted once under one name.

From that table it writes four views of last month: the total, spend by department, by category and the top 15 vendors, each with the previous month beside it and the change in amount and percent. Declined and reversed card transactions are excluded, and the agent says how it treated refunds (netted against the vendor they came from).

Then it picks the five largest increases across department, category and vendor, and for each lists the transactions that make up most of the change: date, cardholder or submitter, merchant, amount and memo where Ramp has one. That section answers the question a finance lead asks first, which is not "what did we spend" but "why is it up".

Start it with one API call

POST https://api.prix.dev/o/{org}/sessions with this body:

{
  "agent": "claude",
  "input": "Use the Ramp connection to read card transactions, reimbursements and bills for last calendar month and the month before it. Write spend.md with: total spend; spend by department, by category and by the top 15 vendors, each compared with the month before in amount and percent; and the five largest increases, each with the transactions that explain most of the change (date, person, merchant, amount, memo). Exclude declined and reversed transactions and say how refunds were treated. Read only.",
  "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.prix.dev/o/{org}/sessions, with your repository as the resources URL. 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

The session returns spend.md: a headline total with the change from the month before, three comparison tables (department, category, top 15 vendors) and the five largest increases, each with its transactions listed. It is written to be pasted into a monthly finance update or read in the meeting as is.

Before it goes out, check two things. Departments come from each cardholder's department in Ramp, so a person who moved teams mid-month counts under their current one. And a vendor name can appear under two spellings across cards and bills; the agent merges the obvious ones and lists the merges it made at the end. The SQL behind every table is in the session's transcript.

Run it on every month close

Send the request on the second or third business day of the month, after card transactions from the last days of the month have posted. A Project automation on a monthly schedule does this with no server of your own.

To give department heads their own page, start one session per department with the department named in the prompt; they run side by side and each run.completed webhook carries the session to read.

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

Why run it on Rush?

Ramp's dashboards answer one cut at a time. A month-over-month report across cards, reimbursements and bills, with the transactions behind each jump, is a few hours in a spreadsheet. The agent does it with SQL in its own sandbox, and the queries are kept, so next month's numbers come from the same logic.

The run is read only by prompt, every call it makes is in the transcript, and the result is a file a finance lead reads before anything is shared. Several reports, one per entity or department, can run at once up to the key's concurrent run limit.

Frequently asked questions

Does it include reimbursements and bills, or only cards?

All three. They go into one table with a source column, and the report can show each source separately if you ask for it in the prompt.

Can it compare against budget instead of last month?

Ramp's spend data has no budget, so attach your budget as a CSV document block in input and ask for actual against budget by department. The agent finds the file under /workspace/.rush/attachments/.

How are refunds handled?

They are netted against the vendor they came from, and spend.md says so. Ask in the prompt to show refunds as their own line if you prefer.

Can I ask follow-up questions about the numbers?

Yes. Send a message to the same session, such as asking which cardholders drove the travel increase. The parked sandbox wakes where it left off, with the report and every query behind it, so the agent starts from the same numbers instead of from scratch.