---
name: pitchpace-agent-gateway
description: Configure a PitchPace campsite tenant over MCP - read and set per-day occupancy, list units and availability blocks, and read direct-booking price bands. Use when an agent must sync occupancy from a PMS/OTA or inspect availability for a PitchPace tenant.
---

# PitchPace agent gateway

<!-- Generated by `npm run agent:skill` from libs/agent-gateway/src/lib/capabilities.ts. Do not edit by hand. -->

## Connect

- Endpoint: `https://<tenant>.pitchpace.app/api/agent/mcp` (MCP Streamable HTTP, stateless JSON; POST only).
- Auth: `Authorization: Bearer ppag_...` — a tenant-scoped agent key minted by the PitchPace operator.
- The key pins the tenant; there is no tenant parameter anywhere. `tools/list` shows only the tools your key scopes allow.
- Scopes: `occupancy:read`, `occupancy:write`, `rates:read`.

Example MCP client config:

```json
{
  "mcpServers": {
    "pitchpace": {
      "type": "http",
      "url": "https://<tenant>.pitchpace.app/api/agent/mcp",
      "headers": {
        "Authorization": "Bearer ppag_<key-id>.<secret>"
      }
    }
  }
}
```

## Conventions

- Dates are `YYYY-MM-DD`; ranges are inclusive unless a field says otherwise.
- Money fields end in `Minor` and are minor currency units (cents).
- Call `list_units` first: its `unitType` values are the only valid ones elsewhere.
- Every tool returns `structuredContent`; errors come back as tool errors `code: message`.

## Tools

### list_units

- Scope: `occupancy:read` · read-only · idempotent

List the tenant campsite unit types (pitches, mobile homes, …) with sellable inventory, safety buffer and active flag. Unit types returned here are the only valid unitType values for the other tools.

### get_occupancy

- Scope: `occupancy:read` · read-only · idempotent

Per-day, per-unit occupancy for an inclusive [from, to] date range (max 400 days). Each day reports inventory, direct bookings (approved plus live pending holds), iCal-feed blocks, owner-managed manual blocks, agent-reported occupancy, the remaining sellable availability and occupancyPct (0-100). Numbers use the same deduction rules as the live direct booking engine.

| Input | Type | Required | Notes |
| --- | --- | --- | --- |
| `from` | string | yes | pattern `^\d{4}-\d{2}-\d{2}$` — first day, inclusive |
| `to` | string | yes | pattern `^\d{4}-\d{2}-\d{2}$` — last day, inclusive |
| `unitType` | string | no | limit to one unit type from list_units |

### set_occupancy

- Scope: `occupancy:write` · writes tenant data · idempotent

Declare how many units of one unit type are occupied OUTSIDE PitchPace (OTA sales, PMS state, walk-ins) for every day in the inclusive [from, to] range; to defaults to from. The value replaces any previous agent-reported occupancy for those days (idempotent, one record per day); 0 clears the days. occupiedUnits must be an integer between 0 and the unit inventory. The direct booking engine immediately subtracts these units from public availability. Owner-managed blocks and direct bookings are never modified by this tool.

| Input | Type | Required | Notes |
| --- | --- | --- | --- |
| `unitType` | string | yes | unit type key from list_units |
| `from` | string | yes | pattern `^\d{4}-\d{2}-\d{2}$` — first day, inclusive |
| `to` | string | no | pattern `^\d{4}-\d{2}-\d{2}$` — last day, inclusive; defaults to from |
| `occupiedUnits` | integer | yes | externally occupied units for each day; 0 clears |
| `note` | string | no | shown to the owner next to the occupancy record |

### list_availability_blocks

- Scope: `occupancy:read` · read-only · idempotent

Every availability block on the tenant calendar with its provenance: owner-managed ('manual', 'booking_safety'), scheduled iCal feeds ('ical:<id>', 'airbnb_ical') and agent-reported occupancy ('agent', externalId occ:<date>). endsOn is exclusive.

### get_price_grid

- Scope: `rates:read` · read-only · idempotent

The tenant direct-booking price bands per unit type: nightly price, per-person extras, minimum stay and tourist tax, all in minor currency units (cents). Bands cover [startsOn, endsOn) date ranges.

## Typical flow: sync occupancy from a PMS

1. `list_units` → pick the `unitType` (for example `PITCH`).
2. `get_occupancy {from, to}` → see what PitchPace already knows per day.
3. `set_occupancy {unitType, from, to, occupiedUnits}` per day or per equal-value range — the value REPLACES earlier agent-reported occupancy for those days; send `occupiedUnits: 0` to clear.
4. Re-read `get_occupancy` to confirm `agentOccupied` and remaining `available`.
