# Open Party agent guide

Open Party helps people find and host parties and events. Public listings include event times and venues, and imported listings include their official source and licence.

- This environment: https://app.openparty.run
- Production: https://app.openparty.run
- Development: https://dev.openparty.run
- Action registry: https://app.openparty.run/api/v1/agent/actions
- Full action schemas: https://app.openparty.run/llms-full.txt
- OpenAPI: https://app.openparty.run/openapi.json
- API docs: https://app.openparty.run/api/docs
- Human setup: https://app.openparty.run/agents

## Authorization

Public actions work anonymously. For account reads and writes, sign in at https://app.openparty.run/agents, choose the scopes (`tickets:read`, `plans:read`, `saved:read`, `saved:write`, `plans:write`), and create a personal token. Copy it when it is shown. Tokens last 90 days by default, configurable from 1 to 365 days. Revoke a token from Connections on the same page. Send it only to this environment in the `Authorization: Bearer <token>` header. Use an environment variable or credential store for the secret.

## REST

Send a JSON object with an `input` object to `POST https://app.openparty.run/api/v1/agent/actions/{name}`. Successful responses contain the backing route result directly.

```sh
curl -sS 'https://app.openparty.run/api/v1/agent/actions/search_events' \
  -H 'Content-Type: application/json' -d '{"input":{"city":"Lisboa","limit":3}}'
curl -sS 'https://app.openparty.run/api/v1/agent/actions/list_my_tickets' \
  -H "Authorization: Bearer $OPENPARTY_AGENT_TOKEN" \
  -H 'Content-Type: application/json' -d '{"input":{}}'
```

## MCP

Use stateless Streamable HTTP at `POST https://app.openparty.run/mcp` or `POST https://app.openparty.run/api/v1/mcp`. To add Open Party to Claude Code: `claude mcp add --transport http openparty https://app.openparty.run/mcp`. Other MCP clients take the same URL as an HTTP server; add `Authorization: Bearer <token>` only for account actions. Copyable setup is on https://app.openparty.run/agents. Supply `Accept: application/json, text/event-stream`. Use the negotiated version from initialize in subsequent requests. For example, if the server returns 2025-11-25:

```sh
curl -sS 'https://app.openparty.run/mcp' -H 'Content-Type: application/json' \
  -H 'Accept: application/json, text/event-stream' \
  -d '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-11-25","capabilities":{},"clientInfo":{"name":"curl","version":"1.0.0"}}}'
curl -sS 'https://app.openparty.run/mcp' -H 'Content-Type: application/json' \
  -H 'Accept: application/json, text/event-stream' -H 'MCP-Protocol-Version: 2025-11-25' \
  -d '{"jsonrpc":"2.0","method":"notifications/initialized"}'
curl -sS 'https://app.openparty.run/mcp' -H 'Content-Type: application/json' \
  -H 'Accept: application/json, text/event-stream' -H 'MCP-Protocol-Version: 2025-11-25' \
  -d '{"jsonrpc":"2.0","id":2,"method":"tools/list"}'
curl -sS 'https://app.openparty.run/mcp' -H 'Content-Type: application/json' \
  -H 'Accept: application/json, text/event-stream' -H 'MCP-Protocol-Version: 2025-11-25' \
  -d '{"jsonrpc":"2.0","id":3,"method":"tools/call","params":{"name":"search_events","arguments":{"limit":3}}}'
```

## Errors and limits

Authorization, validation and rate-limit failures at the API boundary use problem JSON with `status`, `code`, `requestId` and `error.code`. Relevant codes are 401 `auth_required` or `invalid_token`, 403 `insufficient_scope`, 409 `idempotency_key_reused` or `in_progress`, and 429 `rate_limited`. An invalid or inactive bearer token receives `WWW-Authenticate: Bearer realm="openparty", error="invalid_token"`. Retry a 429 after the `Retry-After` interval. REST execution and MCP share 120 requests per minute per token or anonymous IP. JSON requests are limited to 64 KiB. Token creation is limited to 10 requests per minute per account. Scoped MCP tool calls return `isError: true` and `structuredContent.code` for missing authorization or scope.

## Verify a result

Compare the REST result with MCP `result.structuredContent` using the same filters. For an event, call `get_event` with a returned slug and check its occurrence times, source URL and licence. A search may return an empty `items` list. Continue with `nextCursor` if present. For a private read, repeat with the required bearer scope and verify against your account in the app.

Write actions (`risk: medium`) act only inside the token owner's account: `save_event` saves or unsaves an event and `create_plan` creates a private plan draft. They never publish, invite, message, buy or refund. `create_plan` requires an `idempotencyKey`: retrying with the same key and input returns the first result, the same key with different input answers 409 `idempotency_key_reused`. Every write is recorded in an audit log tied to the token. Invitations, RSVPs, purchases and publishing stay in the Open Party app, where the user confirms them. A2A is unavailable.

## Actions
- `search_events` (public) — Search upcoming public events. Use nextCursor to continue with the same filters. Backing route: `GET /api/v1/events`.
- `get_event` (public) — Read an event by slug or UUID, including its schedule and source. Backing route: `GET /api/v1/events/{id}`.
- `get_venue` (public) — Read a venue and its public events by venue slug. Backing route: `GET /api/v1/venues/{id}`.
- `get_organizer` (public) — Read an organizer and its public events by organizer slug. Backing route: `GET /api/v1/organizers/{id}`.
- `list_my_tickets` (tickets:read) — List the token owner’s tickets and reservations. Backing route: `GET /api/v1/tickets`.
- `list_my_plans` (plans:read) — List plans the token owner belongs to. Backing route: `GET /api/v1/plans`.
- `list_saved_events` (saved:read) — List upcoming events the token owner saved. Accepts the same filters as search_events. Backing route: `GET /api/v1/events`.
- `save_event` (saved:write) — Save (saved=true) or unsave (saved=false) a public event in the token owner’s saved list. Repeating a call has the same result. Backing route: `POST /api/v1/events/{id}/save`.
- `create_plan` (plans:write) — Create a private plan for the token owner with up to 20 events (slugs or IDs) and an optional date. Nobody is invited or notified; the owner shares it from Open Party. idempotencyKey makes retries safe: the same key returns the first result. Backing route: `POST /api/v1/plans`.
