What the agent does
This is for an online course platform where independent instructors sell video courses: pottery, bookkeeping for freelancers, guitar, data analysis. The platform's video player sends an event to an Axiom dataset for every play: when a lesson starts, when it buffers, when it ends and when it fails, with the course, the lesson, the error code, the browser and the device. Students who hit a video that will not play rarely write in; they ask for a refund or stop the course. The content operations team needs a weekly list of the lessons that fail most, with enough detail to know whether the fix is re-encoding one file, asking an instructor for a new upload, or a player problem on one browser.
The platform's data lead connects Axiom once with POST /me/connections {"type": "mcp", "name": "axiom", "url": "https://mcp.axiom.co/mcp", "auth": {"mode": "oauth"}} and signs in on Axiom's page. Axiom's docs say the remote server acts as that user's account, and recommend setting query cost limits on the user's role so an agent can query on its own without unexpected cost. A team whose datasets must stay in the EU connects Axiom's EU server instead.
On a run the agent calls listDatasets to find the player dataset and getDatasetFields to read its field names and types, so its queries use the platform's real names rather than guesses. Then it calls queryDataset with APL queries over the last seven days: plays and failures counted per lesson, the failure rate for lessons with at least 50 plays, the error codes behind each lesson's failures, and the split by browser and device. It sets saveResults: true on the main query, which Axiom's docs say returns a shareable Open in Axiom link, so the team can open the same numbers in the Axiom console.
Before it calls something a lesson problem, it looks for a platform-wide cause. It runs the failure rate per day across all lessons, and calls getAnnotations for the week to see deploys and incidents the engineering team marked, so a failure spike on Thursday that matches a player release is reported as that release, not as forty separate lessons. The report then names each failing lesson with its course and instructor id, plays, failures, failure rate, top error codes and where they happen.
Start it with one API call
POST https://api.phoenix.so/o/{org}/sessions with this body:
{
"agent": "claude",
"input": "Weekly video playback report. Week: Monday 2026-11-16 00:00 to Sunday 2026-11-22 23:59 UTC. Use the axiom connection, read only. 1) listDatasets; the player events dataset is player-events. getDatasetFields on it and tell me the fields you used for event type, lesson, course, instructor, error code, browser and device. 2) queryDataset with APL: per lesson, plays (play_start events) and failures (play_error events), failure rate; keep lessons with 50 or more plays and a failure rate of 2% or more. Save results for this query and include the Open in Axiom link. 3) For each kept lesson: the top 3 error codes with counts, and failures by browser and by device type. 4) Daily failure rate across all lessons for the week; getAnnotations for the week; if a day's rate is more than double the week's median, name it and any annotation that day. 5) Write playback.md: platform-wide spikes first, then failing lessons sorted by failures, each with course id, lesson id, instructor id, plays, failures, rate, top errors, the browsers and devices most affected, and a one-line likely next step (re-encode the file, ask the instructor for a new upload, or check the player on that browser). Include no student ids, emails or IP addresses. Do not create, change or delete datasets, dashboards, monitors or notifiers.",
"connections": [
"axiom"
]
}- 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.
- 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.
- 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
What comes back is playback.md among the session's files and a summary in the session's result, with the Open in Axiom link to the saved results. The report opens with any day when failures jumped across the whole platform and the release or incident marked that day, then lists the lessons that fail most, each with its numbers, the error codes and the browsers or devices involved, and a suggested next step.
What the content operations team checks before acting: the field names the agent says it used, on the first run especially, since a dataset where failures are logged under another event name will give a confident but wrong report; a lesson with a high rate but few plays, which may be one student on a bad connection; and a failure that only happens on one browser, which belongs to the player team rather than the instructor. Contacting an instructor or re-encoding a file stays with the team.
Run it on every Monday morning
In the console, a Project automation with a schedule trigger, cron 0 8 * * 1 and the team's timezone, runs a saved agent whose connections name axiom with this prompt. A schedule fills in no date, so the saved instructions say "the previous Monday to Sunday" and the agent works out the week on each run.
The platform's release script can also start the same saved agent with POST /o/{org}/sessions a day after each player release, with a window of "since the release", so a player change that breaks playback on one browser is caught the next morning rather than the next Monday.
The use case this job follows, with its automation and trigger: Produce a report or file, no repo.
Why run it on Rush?
The Axiom sign-in is held in Rush's connection and acts as the data lead's account, so the query cost limits set on that person's role apply to every run, and no Axiom API token is copied into a reporting script. Removing the connection stops the report.
Each Monday's run has its own computer and a record of every APL query it sent and every answer it read, so when an instructor asks why their lesson was flagged, the team opens that week's session and shows the query and its numbers. The session's total_cost_usd shows what each week's report costs.
Frequently asked questions
Our player logs failures as a field, not as a separate event. Will this work?
Yes. The agent reads the dataset's fields first and the prompt asks it to say which fields it used. Change the prompt's definition of a failure to match your events, for example a status field equal to error, and the queries follow.
Can it tell instructors directly?
This page keeps that with the content team. The report gives the team a likely next step per lesson; whether to re-encode a file themselves or ask the instructor for a new upload is their call.
What does a run cost on the Axiom side?
The agent queries as the person who connected Axiom, so its queries are that person's queries. Axiom's docs recommend setting hourly and daily query cost limits on that person's role, so an agent can query on its own without creating unexpected costs.
More Axiom jobs
More jobs like this: Produce a report or file, no repo
- Which Maintenance Requests in Slack Has Nobody Picked Up? A Property Manager's Morning Check (Slack)
- Which New Federal Grants Could Our Nonprofit Apply For? A Watershed Group's Weekly Grants.gov Digest (Public websites)
- Which of Our Target Companies Posted New Roles This Week? A Recruiting Agency's Careers-Page Check (Public websites)