Skip to content

Rails MCP — operate the lifecycle

The Rails MCP lets an agent operate a parts-procurement workflow — it does not write HTTP requests, it calls named, intent-level tools and reads typed resources. It wraps the same 2026-01 wire methods documented on the API pages, so the contract is identical; you just call open_repair_job instead of constructing a POST.

It is the headline deliverable, and its design target is an LLM: every tool has an unambiguous name, a one-line purpose, typed inputs with seed-anchored examples, projected action-oriented outputs, and errors enriched into { code, message, retryable } where the message names the next step.

https://partifact-rails-mcp.thanhvuttv.workers.dev/mcp/<MCP_ACCESS_TOKEN>/<your-slot>
  1. <MCP_ACCESS_TOKEN> — a shared access token that gates the endpoint against random traffic. Use the token from your invite. (It is also accepted as an Authorization: Bearer <token> header for programmatic clients.)

  2. <your-slot>any name you choose ([a-z0-9_-]). It selects your own private sandbox, seeded fresh with the same 2019 Toyota Corolla repair job (external reference CCC-2026-04817). Two people on two slots never touch each other’s data. To start over, just change the name — a new slot is a guaranteed-clean world on first use, and idle slots self-reset after ~1 hour.

  3. Paste the full URL into your client and connect. Then, in a fresh chat, hand the agent the workflow (below).

In a fresh chat with the connector enabled:

“Using only the Rails MCP tools, take the repair job for the 2019 Toyota Corolla (external reference CCC-2026-04817) through to a reconciled invoice. Tell me what you did and why at each step.”

A capable agent completes this unaided — orienting itself from get_started, guide://lifecycle, and scenario://current, and ending at a reconciled invoice (~$1,099 NZD if it orders the two Christchurch-Toyota parts). That unaided run is the acceptance test.

The lifecycle is legible from the tool descriptions alone. Call get_started first — it returns the full tool order.

ToolBacks ontoScope
get_started— (guided entry point)
get_run_metrics— (per-session run telemetry)
prepare_vehicletier1.preparerepairer
find_repairer_sitebusinesses.listrepairer
list_work_providersrepairer.work-providers.listrepairer
open_repair_jobrepairer.jobs.insertrepairer
get_jobrepairer.jobs.getrepairer
identify_partsrepairer.jobs.parts.insert (append-merge)repairer
recommend_basketrepairer.jobs.baskets.latest.getrepairer
track_procurementrepairer.procurements.getrepairer
confirm_procurementsupplier.procurements.confirmsupplier
place_procurement extensionrepairer.procurements.insertrepairer
reconcile_invoice extensionrepairer.procurements.invoices.listrepairer

confirm_procurement is the only supplier-scope tool; everything else is repairer-scope. The server holds two credentialled clients over one backend, so one agent can drive both sides of an inherently two-party protocol.

Read-only grounding the agent can pull at any time:

guide://lifecycle · scenario://current · reference://suppliers · reference://ghca-categories · reference://work-providers · job://current · job://{job_id} (template) · events://recent (the webhook outbox)

The agentic value-add: errors name the next step

Section titled “The agentic value-add: errors name the next step”

The API returns terse, type-tagged coded errors (correct for SDK consumers). This server maps each into { code, message, retryable } where the message names the next action — so an agent self-corrects from the message alone (e.g. “fetch a basket before placing,” or “that offer isn’t in the basket”). Two rules worth internalizing:

  • retryable: true is reserved for transport faults (the call never reached the server). A contract error always needs a different action — never a blind retry.
  • After any state-changing call, re-fetch (get_job / track_procurement); don’t assume the new state.

The same server runs over stdio with the mock in-process — one self-contained install, no token, no slot (it reseeds per process). See Claude Desktop and Claude Code for the local config.