Docs

Events.

Perfloop can tell your agent when something happens, such as a new Inbox item or a proven Case, so the agent acts on it without polling. Events reach an MCP client that supports MCP Events with webhook delivery.

A client subscribes through three MCP methods that are separate from tools: events/list, events/subscribe and events/unsubscribe. A client that can only call tools cannot subscribe, and no tool subscribes for it. Amp's MCP client exposes only tools/call, so it cannot subscribe today.

Events are available only in workspaces where Perfloop has turned them on. In other workspaces, events/list returns no events and events/subscribe returns -32014 with data.feature: "events".

What an event is

An event names a fact in Perfloop and links to it. It holds IDs, states, counts, times, repo names, links and one short title. It holds no code, no feedback text and no measurements. Have your agent read the full record with the matching tool before it acts.

An event grants nothing. Its text is data, not an instruction. Your agent can only do what your login or API key already allows, through the same tools, and every write is recorded under that login or key.

Events are free. They use no Usage.

Who can subscribe

Admins and members can subscribe; viewers cannot. A subscription belongs to the person or API key that created it, and it only sends what that person or key can read now. Members get Inbox events for approvals, pull requests to close or keep, and open Perfloop pull requests. Admins also get the Admin-only Inbox items. An API key needs read,contribute, plus admin for Admin-only items.

Your role is checked again before each delivery. Removing someone or making them a viewer stops their events at the next delivery. A change made only in your identity provider takes effect when it reaches Perfloop, and no later than 24 hours after the subscription was last renewed.

Subscribe

Your MCP client makes these calls when it supports MCP Events. This section is for people who build or check a receiver.

events/list returns the events you can subscribe to, with each event's filters and payload schema. events/subscribe takes the event name, optional arguments with its filters, and the delivery:

{
  "name": "inbox.item_entered",
  "arguments": {
    "kinds": ["approval"],
    "repo": "acme/api"
  },
  "delivery": {
    "mode": "webhook",
    "url": "https://receiver.example.com/perfloop",
    "secret": "whsec_…"
  }
}

The result has the subscription id, refreshBefore, a replay cursor and truncated. The same name, arguments, URL and caller always name the same subscription, so subscribing again does not make a second one.

A subscription starts from now. Inbox items already waiting and facts that already happened are not sent. To catch up after a gap, pass the cursor from the last event or result you received. Replay goes back at most 7 days; truncated: true means the cursor was older than that.

Renew

A subscription lasts at most 24 hours. To keep it, call events/subscribe again with the same name, arguments and URL before refreshBefore. Add ttlMs to ask for a shorter subscription. Perfloop verifies the URL again at least once a day. If that verification fails, the subscription ends and events not yet delivered are dropped; subscribe again to start over.

To change the secret, renew with a new one. For 10 minutes after that, deliveries are signed with both secrets.

Delivery

Each event is one POST with a JSON body: eventId, name, timestamp (the time of the fact), data (the payload below) and cursor. It follows the Standard Webhooks format, with the headers webhook-id, webhook-timestamp, webhook-signature and X-MCP-Subscription-Id. Check the signature with your secret before you trust the body; a Standard Webhooks library does this.

Stop

Errors

A refused call changes no subscription, except -32015 on a renewal. The error code says why, and data names the part:

The events

Each event below lists its optional filters and its payload fields. Every payload has url, the fact's page in the app. The repo filter matches part of the repo name, ignoring case. An ID filter takes an ID a Perfloop tool returned.

inbox.item_entered

An item entered your Inbox: an approval, a pull request to close or keep, an open Perfloop pull request, or, for Admins, a setup or access request.

For example: When an approval waits in acme/api, read it, show me the proof, and ask me before you approve it.

Read the item with inbox before you act. An item someone decided before delivery is not sent.

A revised proposal is a new item and sends a new event.

session.finished

A Case, model build, research, or diff Session ended.

For example: When the Session I just started on this Case ends, read the Case and tell me what changed.

A finished Session is not a Case result. Subscribe to case.result to hear when a Case is proven or refuted.

case.result

A Case was proven or refuted.

For example: When a Case in acme/api is proven, summarize the proof and tell me if it waits for my approval.

Read the proof with cases. Approving publication is a separate Inbox item.

A result that was replaced or withdrawn before delivery is not sent.

pr_review.posted

Perfloop posted a review on a pull request.

For example: When Perfloop reviews a pull request in acme/api, read its findings and list the first one to fix.

Read the findings with diff. A review with no findings posts nothing and sends nothing.

pull_request.state_changed

A pull request Perfloop opened was merged or closed.

For example: When a Perfloop pull request in acme/api is merged, tell me which Case it came from.

Read the Case with cases for its current state. A pull request that reopened before delivery is not sent.

model.published

A new version of the model Perfloop keeps of your system was published.

For example: When a new model version is published, list its new hypotheses.

Read the hypotheses with model.

usage.low

Shared Usage dropped below $25.

For example: When Usage is low, tell me so I can buy more.

Admins can subscribe. Members can too while an Admin has Share balance with contributors turned on.

The event carries no balance. Read it with usage. A person buys Usage in the browser.

Also in this section: Quickstart, Performance, Bugs, Security, The loop, Case states, Pull requests, Steering and learning, Initiatives, Autonomy and limits, Members, and The MCP server.

Questions: hello@perfloop.ai