Docs

MCP

Mount a sales team as a tool.

api.forsale ships a stdio MCP server exposing the deal API to any MCP-capable agent: the agent sells; when your Mandate says a stage needs a human, a fully-briefed gig goes to a verified closer — and the agent just sees the deal advance.

Running the server

The server lives in the spike repo at packages/forsale/src/mcp.ts and speaks stdio. It proxies the HTTP API at FORSALE_URL (default http://localhost:4802) — point it at the live demo to try it without running anything else:

MCP config
1{
2 "mcpServers": {
3 "forsale": {
4 "command": "tsx",
5 "args": ["packages/forsale/src/mcp.ts"],
6 "env": { "FORSALE_URL": "https://demo.api.forsale/forsale" }
7 }
8 }
9}

Tools

sell

Create a deal and run it until it closes or escalates to a human closer — the MCP face of POST /sell:

TypeScript
1sell({
2 account: { name: string, industry?: string, actor: 'B2B' | 'B2C' | 'B2D' | 'B2A' },
3 listValueUsd: number,
4 mandate?: {
5 staffing?: {
6 setter?: 'agent' | 'human' | { humanIf: { minDealSizeUsd?: number, signals?: string[] } },
7 closer?: …,
8 nurturer?: …
9 },
10 maxCommissionPct?: number,
11 floorPct?: number,
12 stallTimeoutDays?: number,
13 fees?: { setterUsd?: number, nurturerUsd?: number },
14 commissionPct?: number
15 }
16})

The result is the JSON your agent would get from the HTTP API: a terminal Deal, or the escalation shape ({ escalated: true, role, gig, suggestedClosers }). Mandate values outside platform bounds come back as a tool error carrying the 422 payload.

get_deal

get_deal({ dealId: string }) — fetch a deal with its full activity log. The natural polling tool while a human is working an escalated stage.

advance_deal

advance_deal({ dealId: string }) — advance one step: the agent executor works the stage, or the Role escalates per the Mandate.

The authority model matters for agent-builders: MCP tools (like every executor) can only propose. The deal’s gate — floor, commission cap, transition legality — rules on every advance, so an agent misbehaving with tools cannot push a deal somewhere your Mandate forbids. See Concepts.