Public: anyone can read this; the crew can change it.

An agent can open a deal, add a date, add a party and reopen a date over MCP, like on the page #14

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

Over POST /mcp, an agent can now open a deal, add a date, add a party and reopen a date, the same as on the page. src/server.test.ts passes (21 tests). I ran only that file, not the whole suite, and I did not run bun x tsc --noEmit: the repo has no tsconfig.json, so tsc just printed its help.

Notes

shipped production is serving it deploy d2eada7

opened this

Over POST /mcp, an agent can now open a deal, add a date, add a party and reopen a date, the same as on the page. src/server.test.ts passes (21 tests). I ran only that file, not the whole suite, and I did not run bun x tsc --noEmit: the repo has no tsconfig.json, so tsc just printed its help. scripts/gate.ts and scripts/fast.ts don't exist, and I didn't run scripts/design-lint.ts because nothing in src/web/ changed.

What changed

  • open_deal takes address, buyer, seller, contract_date and closing_date. It also takes optional inspection, appraisal, financing, title and walkthrough lengths and business_days. It calls createDeal.
  • add_date takes deal_id, label, due, owes and optional details. It calls addDeadline.
  • add_party takes deal_id, role, name and optional contact. It calls addParty.
  • Reopening needed no new tool. mark_done already accepted done: false, so the new test now covers that path too.
  • Errors: the tools hold no rules of their own. Every call goes through the action, so a refused or invalid call comes back as the action's named failure with isError, and an anonymous call is refused as on the page.
  • Tests: a new test in src/server.test.ts calls each tool as anon (refused), as a user with invalid input (refused with the action's message), and as a user with valid input. It reads each result back with get_deal, including closing and reopening a date. The tool-list assertion now names the three new tools.
  • README: the MCP tool list names the new tools and says mark_done reopens a date with done: false.

Not done: no reopen_date tool, since mark_done covers it, and no policy cell touched.

Rate limit: every POST counts against the caller's write bucket (20 burst), MCP reads included. The new test uses its own signed-in user so it doesn't drain alice's bucket and break the other tests.

To try it: claude mcp add --transport http deal-clock https://<app>/mcp, then call open_deal as a signed-in user.

🤖 Generated with Claude Code

Closes #6

commented

Over POST /mcp, an agent can now open a deal, add a date, add a party and reopen a date, the same as on the page. src/server.test.ts passes (21 tests). I ran only that file, not the whole suite, and I did not run bun x tsc --noEmit: the repo has no tsconfig.json, so tsc just printed its help. scripts/gate.ts and scripts/fast.ts don't exist, and I didn't run scripts/design-lint.ts because nothing in src/web/ changed.

What changed

  • open_deal takes address, buyer, seller, contract_date and closing_date. It also takes optional inspection, appraisal, financing, title and walkthrough lengths and business_days. It calls createDeal.
  • add_date takes deal_id, label, due, owes and optional details. It calls addDeadline.
  • add_party takes deal_id, role, name and optional contact. It calls addParty.
  • Reopening needed no new tool. mark_done already accepted done: false, so the new test now covers that path too.
  • Errors: the tools hold no rules of their own. Every call goes through the action, so a refused or invalid call comes back as the action's named failure with isError, and an anonymous call is refused as on the page.
  • Tests: a new test in src/server.test.ts calls each tool as anon (refused), as a user with invalid input (refused with the action's message), and as a user with valid input. It reads each result back with get_deal, including closing and reopening a date. The tool-list assertion now names the three new tools.
  • README: the MCP tool list names the new tools and says mark_done reopens a date with done: false.

Not done: no reopen_date tool, since mark_done covers it, and no policy cell touched.

Rate limit: every POST counts against the caller's write bucket (20 burst), MCP reads included. The new test uses its own signed-in user so it doesn't drain alice's bucket and break the other tests.

To try it: claude mcp add --transport http deal-clock https://<app>/mcp, then call open_deal as a signed-in user.

🤖 Generated with Claude Code

Approved

Clean. The three new MCP tools delegate to createDeal, addDeadline and addParty, which ask permit and validate, so there is no hand-rolled role check and no cell in contract.json changes. The README names the tools. The test covers anon refusal, invalid input and the valid path, and reads each result back, including closing and reopening a date. The terminal already does all of this. Nit, not blocking: the open_deal argument mapping repeats newDeal in routes.ts.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs