Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions ai_docs/write-plugin-tool-justifications.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,18 @@ Only `createHyperliquidTable`, `executeSqlQuery` and `captureAnalysisDataset` ar
| `previewHyperliquidOrderCost` | true, false, true | Estimates an order's fill, fee and slippage from the live book without placing it, so it is read only and open world. It suggests placeHyperliquidOrder when the order can fill. |
| `getHyperliquidAccountHealth` | true, false, true | Reads a snapshot of account exposure and margin from Hyperliquid. It changes nothing, so it is read only and open world. |
| `fetchHyperliquidMarketRadar` | true, false, true | Ranks markets by activity and compares retained samples from Hyperliquid data. It changes nothing, so it is read only and open world. |
| `createPerpsEventSubscription` | false, false, true | Starts linked-account observation after wallet checks. It stores a subscription and requests collection, but places no orders and moves no funds. |
| `listPerpsEventSubscriptions` | true, false, false | Lists stored Perps subscriptions, filters and lifecycle status. It calls no outside provider and changes nothing. |
| `updatePerpsEventSubscription` | false, true, true | Changes filters, delivery destination or lifecycle after wallet checks. It can replace delivery settings or end an invalid binding, but moves no funds. |
| `deletePerpsEventSubscription` | false, true, true | Ends this subscription's observation demand and future financial delivery after wallet checks. An eligible receiver may still get terminal health. No funds move. |
| `getPerpsEvents` | false, true, true | Replays retained events and refreshes activity. External wallet checks can close an invalid binding, so it is not read only despite moving no funds. |
| `listWebhookDestinations` | true, false, false | Lists shared destination labels and attachment counts without receiver URLs or secrets. It reads stored account state only. |
| `createWebhookDestination` | false, true, true | Registers a receiver after external URL checks. Credentials can appear in the host transcript, so it requires confirmation. It sends no event and moves no funds. |
| `updateWebhookDestination` | false, false, false | Renames a destination using its current version. It cannot change the URL, kind or credentials and sends no request. |
| `deleteWebhookDestination` | false, true, false | Permanently deletes a disabled destination with no active or paused Perps or Predictions attachments. It sends no request and moves no funds. |
| `rotateWebhookDestinationSecret` | false, true, false | Replaces a signing secret or routine credential under the destination's rotation policy. It changes receiver access, so it requires confirmation. |
| `disableWebhookDestination` | false, true, false | Disables a shared destination and pauses attached subscriptions across both products. This stops delivery and cannot be undone. |
| `sendWebhookTestEvent` | false, false, true | Sends an optional test to a receiver and records its outcome. It can start a real automation or paid routine session, so it is not a read. |
| `placeHyperliquidOrder` | false, true, true | Places a market or limit order on Hyperliquid with real funds. It can open leveraged positions and cannot always be undone, so it is destructive and needs host confirmation. |
| `placeHyperliquidStopOrder` | false, true, true | Places a stop loss or take profit trigger order on Hyperliquid. The trigger can later close a position with real funds, so it is destructive and needs host confirmation. |
| `cancelHyperliquidOrder` | false, true, true | Cancels an open Hyperliquid order. It changes live exchange state and cannot be undone, so it is destructive and open world and needs host confirmation. |
Expand Down Expand Up @@ -131,6 +143,8 @@ A `splitMergePredictionPosition` split preview returns a typed `next` suggestion
| `getAccountAddresses` | true, false, false | Returns your Gina wallet addresses from stored account state. It calls no outside provider and changes nothing, so it is read only and closed world. |
| `listScheduledPrompts` | true, false, false | Lists your scheduled prompts from Gina account state. It changes nothing and calls no outside provider, so it is read only and closed world. |
| `searchPredictionMarkets` | true, false, true | Searches Polymarket markets. It places no order and changes nothing, so it is read only and open world. |
| `updateWebhookDestination` | false, true, false | Renames a shared destination using its current version. Predictions marks this mutation destructive. It cannot change the URL, kind or credentials and sends no request. |
| `deleteWebhookDestination` | false, true, false | Permanently deletes a disabled destination with no active or paused Perps or Predictions attachments. It sends no request and moves no funds. |
| `getExpiringMarkets` | true, false, true | Reads Polymarket markets that end soon. It changes nothing, so it is read only and open world. |
| `getPredictionSportsEvents` | true, false, true | Reads Polymarket sports events and their markets by league, team or date. It places no order and changes nothing, so it is read only and open world. |
| `getPredictionSubjectMarkets` | true, false, true | Reads Polymarket markets about one subject, such as a person, company or asset. It changes nothing, so it is read only and open world. |
Expand Down
2 changes: 2 additions & 0 deletions docs/perps-mcp/client-setup.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ The credential must be valid for this venue and carry `tools:execute`. A read-on

Next: run the [read-only connection checks](/perps-mcp/quick-start) before attempting execution.

For account notifications without placing an order, follow [Account events](/perps-mcp/features#account-events). They use this same authenticated connector and its linked wallet, but need no trading delegation. A pull subscription needs no receiver or signing secret.

## Check that it works

Restart the client and complete Gina OAuth. In Claude Code, `/mcp` should list `perps` as connected, and `bash` should appear in the tool list. Call `bash` with:
Expand Down
54 changes: 52 additions & 2 deletions docs/perps-mcp/features.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: "Features Table"
description: "Complete reference of Perps MCP capabilities with example prompts and commands"
title: "Perps features"
description: "Use Perps MCP to inspect your account, manage event subscriptions and execute orders."
---

Complete reference of Perps MCP capabilities. You can prompt naturally, or ask your client to call the native tool shown.
Expand Down Expand Up @@ -40,6 +40,54 @@ Complete reference of Perps MCP capabilities. You can prompt naturally, or ask y

Set `includeExitEstimates=true` for indicative exit estimates on a capped number of positions. They are not fill guarantees. The tool does not assign a health score or calculate historical performance.

## Account events

Connect `https://askgina.ai/ai/perps/mcp` and complete [Perps authentication](/perps-mcp/client-setup) with `tools:execute`. This connector also exposes trading tools, but account observation needs no trading delegation and moves no funds. It watches your Gina-linked embedded Hyperliquid account, not arbitrary addresses. Existing subscriptions keep their original wallet if you change a wallet preference.

Account events cover Main, supported xyz markets and shared collateral in current standard, unified and portfolio-margin accounts. The protocol name is `perps.account.v1`; its payload `kind` distinguishes account changes, labelled initial snapshots and health. This is not a price-tick feed or a complete historical accounting ledger. Unsupported source forms produce explicit coverage gaps and pause the affected source.

### Start with cursor pull

Call `createPerpsEventSubscription` directly, without a destination:

```json
{ "name": "My account changes", "events": ["order", "fill"] }
```

Keep `subscription.id` and `cursor` from the result. Then call `getPerpsEvents`:

```json
{ "subscriptionId": "<subscription.id>", "cursor": "<saved cursor>" }
```

A new subscription can have `baselineStatus: "pending"`. Continue from each returned cursor until the labelled initial snapshot is ready. Pending does not mean an empty, healthy account. Snapshot and health records always pass financial filters; earlier historical fills are not imported as new activity.

Save the returned cursor after processing a page. If `hasMore` is true, continue with that cursor. Dedupe by `eventId`; retries are nondestructive but delivery is at least once. Keep sequence values as decimal strings and cursors opaque. A cursor belongs to its account, subscription and filter history.

When `truncated` is true, report the `gap`, refresh current account state and use `earliestCursor` to continue from retained history. Do not claim the missing interval was empty. Use `events/list` and `tools/list` for current retention, subscription limits, tool descriptions and input schemas.

### Change or stop a subscription

Use `updatePerpsEventSubscription` with an `id` and `patch`. For example, `{"id":"<subscription.id>","patch":{"enabled":false}}` pauses it; `enabled: true` resumes a paused subscription. A retention-related resume preserves the still-retained backlog and requests a fresh baseline. A terminated subscription cannot be reopened.

Filter changes apply only after the returned `filterBoundary`. Older backlog keeps its original selection, including when read with an older valid cursor. Check the schema before combining filters: not every financial kind has an order or coin identity. To stop permanently, call `deletePerpsEventSubscription` with the `id`. This ends that subscription's observation demand and future financial delivery. A final health notification may still reach an eligible native receiver.

Native tools cannot edit a protocol-managed subscription. Clients implementing MCP Events use `events/list`, `events/subscribe`, `events/poll` and `events/unsubscribe` for the same named stream. Protocol expiry or unsubscribe disables its callback; do not expect a terminal webhook. Other clients should use the native pull flow above.

### Push to a receiver

Reuse an active destination from `listWebhookDestinations`, then pass its `destinationId` when creating a subscription. [Webhook registration and signature verification](/predictions-mcp/events#register-a-webhook-destination) are shared with Predictions. Call destination tools directly, never through `bash`, because their arguments or results can contain secrets.

Within one subscription, ordinary webhook delivery follows account recording sequence, not a guaranteed venue-wide chronology. Verify the raw-body Standard Webhooks signature before accepting it and dedupe by `eventId`. Perps pauses without advancing the cursor when a receiver rejects an oversized event. Unlike Predictions, it does not skip that event. Fix or replace the receiver before resuming.

[Claude routines](/connect/claude#push-events-into-claude-code-routine) and [Grok Bot routines](/connect/grok-bot) reuse the same destination credentials and share a fire allowance across both products. Each batch contains one product and one subscription. Grok Bot receives an object with `source`, `version`, `notice`, `more` and `events`. Claude receives a prose notice followed by a JSON array, with any backlog warning in the notice. Preserve each event's cursor and the receiver's backlog indication. Receiver tests are optional and can start paid work. A notification is never permission to trade.

Destinations are shared. Rename only the label with `updateWebhookDestination` and the current version from the list. URLs and destination kinds are immutable; register a replacement and retarget instead. Before deleting, check attachments across Perps and Predictions. Once the destination is unattached, call `disableWebhookDestination`, list it again, then pass its new version to `deleteWebhookDestination`. Do not disable another product's subscriptions to make room without the user's choice.

Native event calls are metered; protocol calls and event delivery are not charged per event. Receiver or routine usage can cost extra. Admission and delivery limits are independent of trading authority. If creation returns `PERPS_EVENTS_NOT_ENABLED` or `PERPS_EVENTS_CAPACITY_EXHAUSTED`, do not loop requests or claim a subscription was created.

Replay calls update activity and can close an invalid wallet binding, so clients may show a destructive annotation even though they move no money. See the [native tool reference](/perps-mcp/tools) for the emitted annotations.

## Market radar

`fetchHyperliquidMarketRadar` accepts an optional `limit` (its input schema gives the range) and an optional `dex`, such as `{"dex":"xyz"}`. Omit `dex` for canonical Hyperliquid.
Expand Down Expand Up @@ -81,3 +129,5 @@ Call the native `getHyperliquidPrice` tool with:
```

Expected: JSON with the live BTC perpetual price. Or ask "BTC perps price" and check that the assistant calls `getHyperliquidPrice` instead of answering from memory.

To verify account events without trading, ask: "Create a pull subscription for my order and fill changes, save its cursor, and read until its initial snapshot is ready. Report any coverage gaps. Do not place an order or test a paid routine." Check that the assistant uses `createPerpsEventSubscription` and `getPerpsEvents`, receives snapshot or health records, and saves the new cursor. An idle account need not emit a financial event. End the test subscription when you no longer need it.
Loading
Loading