@vantagestack/mcp-server 0.1.52 → 0.1.59
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/dist/client.d.ts +0 -25
- package/dist/client.js +0 -172
- package/dist/client.js.map +0 -1
- package/dist/index.d.ts +0 -2
- package/dist/index.js +0 -1185
- package/dist/index.js.map +0 -1
- package/dist/tools/account-deletion.d.ts +0 -6
- package/dist/tools/account-deletion.js +0 -92
- package/dist/tools/account-deletion.js.map +0 -1
- package/dist/tools/account-health.d.ts +0 -21
- package/dist/tools/account-health.js +0 -84
- package/dist/tools/account-health.js.map +0 -1
- package/dist/tools/account.d.ts +0 -19
- package/dist/tools/account.js +0 -291
- package/dist/tools/account.js.map +0 -1
- package/dist/tools/account.test.d.ts +0 -1
- package/dist/tools/account.test.js +0 -213
- package/dist/tools/account.test.js.map +0 -1
- package/dist/tools/calendar.d.ts +0 -4
- package/dist/tools/calendar.js +0 -85
- package/dist/tools/calendar.js.map +0 -1
- package/dist/tools/calendar.test.d.ts +0 -1
- package/dist/tools/calendar.test.js +0 -62
- package/dist/tools/calendar.test.js.map +0 -1
- package/dist/tools/canary.d.ts +0 -4
- package/dist/tools/canary.js +0 -25
- package/dist/tools/canary.js.map +0 -1
- package/dist/tools/canary.test.d.ts +0 -1
- package/dist/tools/canary.test.js +0 -46
- package/dist/tools/canary.test.js.map +0 -1
- package/dist/tools/contract-configs.d.ts +0 -9
- package/dist/tools/contract-configs.js +0 -187
- package/dist/tools/contract-configs.js.map +0 -1
- package/dist/tools/contract-configs.test.d.ts +0 -1
- package/dist/tools/contract-configs.test.js +0 -245
- package/dist/tools/contract-configs.test.js.map +0 -1
- package/dist/tools/copier.d.ts +0 -11
- package/dist/tools/copier.js +0 -52
- package/dist/tools/copier.js.map +0 -1
- package/dist/tools/copier.test.d.ts +0 -1
- package/dist/tools/copier.test.js +0 -75
- package/dist/tools/copier.test.js.map +0 -1
- package/dist/tools/groups.d.ts +0 -14
- package/dist/tools/groups.js +0 -44
- package/dist/tools/groups.js.map +0 -1
- package/dist/tools/groups.test.d.ts +0 -1
- package/dist/tools/groups.test.js +0 -72
- package/dist/tools/groups.test.js.map +0 -1
- package/dist/tools/ip-allowlist.d.ts +0 -6
- package/dist/tools/ip-allowlist.js +0 -69
- package/dist/tools/ip-allowlist.js.map +0 -1
- package/dist/tools/journal.d.ts +0 -6
- package/dist/tools/journal.js +0 -110
- package/dist/tools/journal.js.map +0 -1
- package/dist/tools/journal.test.d.ts +0 -1
- package/dist/tools/journal.test.js +0 -100
- package/dist/tools/journal.test.js.map +0 -1
- package/dist/tools/latency.d.ts +0 -3
- package/dist/tools/latency.js +0 -54
- package/dist/tools/latency.js.map +0 -1
- package/dist/tools/market-hours.d.ts +0 -3
- package/dist/tools/market-hours.js +0 -19
- package/dist/tools/market-hours.js.map +0 -1
- package/dist/tools/ping.d.ts +0 -8
- package/dist/tools/ping.js +0 -22
- package/dist/tools/ping.js.map +0 -1
- package/dist/tools/ping.test.d.ts +0 -1
- package/dist/tools/ping.test.js +0 -25
- package/dist/tools/ping.test.js.map +0 -1
- package/dist/tools/qc.d.ts +0 -18
- package/dist/tools/qc.js +0 -415
- package/dist/tools/qc.js.map +0 -1
- package/dist/tools/qc.test.d.ts +0 -1
- package/dist/tools/qc.test.js +0 -218
- package/dist/tools/qc.test.js.map +0 -1
- package/dist/tools/read.d.ts +0 -7
- package/dist/tools/read.js +0 -154
- package/dist/tools/read.js.map +0 -1
- package/dist/tools/read.test.d.ts +0 -1
- package/dist/tools/read.test.js +0 -102
- package/dist/tools/read.test.js.map +0 -1
- package/dist/tools/risk.d.ts +0 -7
- package/dist/tools/risk.js +0 -108
- package/dist/tools/risk.js.map +0 -1
- package/dist/tools/signal-templates.d.ts +0 -6
- package/dist/tools/signal-templates.js +0 -90
- package/dist/tools/signal-templates.js.map +0 -1
- package/dist/tools/signals.d.ts +0 -8
- package/dist/tools/signals.js +0 -318
- package/dist/tools/signals.js.map +0 -1
- package/dist/tools/signals.test.d.ts +0 -1
- package/dist/tools/signals.test.js +0 -92
- package/dist/tools/signals.test.js.map +0 -1
- package/dist/tools/sync-accounts.d.ts +0 -18
- package/dist/tools/sync-accounts.js +0 -68
- package/dist/tools/sync-accounts.js.map +0 -1
- package/dist/tools/trade.d.ts +0 -3
- package/dist/tools/trade.js +0 -49
- package/dist/tools/trade.js.map +0 -1
- package/dist/user.d.ts +0 -19
- package/dist/user.js +0 -21
- package/dist/user.js.map +0 -1
package/dist/index.js
DELETED
|
@@ -1,1185 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import { Server } from "@modelcontextprotocol/sdk/server/index.js";
|
|
3
|
-
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
4
|
-
import { CallToolRequestSchema, ListToolsRequestSchema, } from "@modelcontextprotocol/sdk/types.js";
|
|
5
|
-
import { loadConfig, validateStartup, VantageClient } from "./client.js";
|
|
6
|
-
import { UserResolver } from "./user.js";
|
|
7
|
-
import { pingVantage } from "./tools/ping.js";
|
|
8
|
-
import { sendSignal, cancelOrders, exitPositions, flattenGroup, sendMagicLink } from "./tools/signals.js";
|
|
9
|
-
import { listGroups, getGroupState, checkConnections, getSignalHistory, inspectSignal } from "./tools/read.js";
|
|
10
|
-
import { getJournalTrades, getJournalDashboard, getJournalEntries, addJournalEntry } from "./tools/journal.js";
|
|
11
|
-
import { getEconomicEvents, getEconomicEventsMonth } from "./tools/calendar.js";
|
|
12
|
-
import { getMarketHours } from "./tools/market-hours.js";
|
|
13
|
-
import { getBalance, getPositions, getOrderHistory, getBrokerOrderHistory, getMarketPrice, getAlerts, ackAlert, getSignalBrokerLogs, getBilling, getBillingPortal } from "./tools/account.js";
|
|
14
|
-
import { listQcAlgorithms, getQcAlgorithm, getAlgorithmFile, createQcAlgorithm, updateQcAlgorithm, listStrategyInstances, getStrategyInstance, launchStrategy, launchGroup, stopStrategy, stopGroup, getStrategyLogs, getStrategyStats, getStrategyOrders, getStrategyTrades, getStrategySessions, } from "./tools/qc.js";
|
|
15
|
-
import { getRisk, getRiskHalts, reenableRiskHalt } from "./tools/risk.js";
|
|
16
|
-
import { setCopierSettings } from "./tools/copier.js";
|
|
17
|
-
import { updateGroup } from "./tools/groups.js";
|
|
18
|
-
import { getAccountHealth, setAccountHealthOverride } from "./tools/account-health.js";
|
|
19
|
-
import { syncConnectionAccounts } from "./tools/sync-accounts.js";
|
|
20
|
-
import { deleteConnectionAccount, getOrphanedTradesCount, deleteOrphanedTrades, setAccountDeletePref, } from "./tools/account-deletion.js";
|
|
21
|
-
import { getTrade } from "./tools/trade.js";
|
|
22
|
-
import { listSignalTemplates, createSignalTemplate, updateSignalTemplate, deleteSignalTemplate } from "./tools/signal-templates.js";
|
|
23
|
-
import { getLatencySummary } from "./tools/latency.js";
|
|
24
|
-
import { getIpAllowlist, manageIpAllowlist } from "./tools/ip-allowlist.js";
|
|
25
|
-
import { getCanaryConfig } from "./tools/canary.js";
|
|
26
|
-
import { listContractConfigs, createContractConfig, updateContractConfig, deleteContractConfig, rollContractConfig, setContractConfigLeader, updateContractConfigFollower, } from "./tools/contract-configs.js";
|
|
27
|
-
const config = loadConfig();
|
|
28
|
-
await validateStartup(config);
|
|
29
|
-
const client = new VantageClient(config);
|
|
30
|
-
const resolver = new UserResolver();
|
|
31
|
-
const server = new Server({ name: "vantage-pipe-mcp", version: "0.1.46" }, { capabilities: { tools: {} } });
|
|
32
|
-
server.setRequestHandler(ListToolsRequestSchema, async () => ({
|
|
33
|
-
tools: [
|
|
34
|
-
{
|
|
35
|
-
name: "ping_vantage",
|
|
36
|
-
description: "Check that VantagePipe is reachable and the API key is valid. " +
|
|
37
|
-
"Returns the service version and environment. Run this first when setting up or diagnosing connection issues.",
|
|
38
|
-
inputSchema: { type: "object", properties: {}, required: [] },
|
|
39
|
-
},
|
|
40
|
-
{
|
|
41
|
-
name: "list_groups",
|
|
42
|
-
description: "List all signal groups owned by this account. Returns group IDs, names, account counts, " +
|
|
43
|
-
"and webhook URLs. Use this to discover groupId and secret for send_signal and other tools.",
|
|
44
|
-
inputSchema: { type: "object", properties: {}, required: [] },
|
|
45
|
-
},
|
|
46
|
-
// ── GMODE-07: update group settings (name, payload, routing mode, copy mode) ──
|
|
47
|
-
{
|
|
48
|
-
name: "update_group",
|
|
49
|
-
description: "GMODE-07 — Partial-PATCH a signal group's settings: name, payload format, routing mode, " +
|
|
50
|
-
"or CT sub-mode. Only the fields you supply are updated. " +
|
|
51
|
-
"`routingMode='signal'` (default) fans out every signal to all members. " +
|
|
52
|
-
"`routingMode='copy_trading'` enables Copy Trading: fills on the designated copy-source " +
|
|
53
|
-
"account fan out as synthesized signals to followers. " +
|
|
54
|
-
"`copyMode='executions'` (default CT) replicates fills only; " +
|
|
55
|
-
"`copyMode='orders'` replicates the working-order lifecycle (place/modify/cancel). " +
|
|
56
|
-
"`copyMode` can only be set when `routingMode='copy_trading'` — the server returns 422 " +
|
|
57
|
-
"(`group_not_in_copy_trading_mode`) otherwise. " +
|
|
58
|
-
"Flipping `routingMode` from `'copy_trading'` to `'signal'` auto-demotes every member " +
|
|
59
|
-
"currently flagged as the copy source so no leader is left in a pure fan-out group.",
|
|
60
|
-
inputSchema: {
|
|
61
|
-
type: "object",
|
|
62
|
-
properties: {
|
|
63
|
-
groupId: { type: "number", description: "Group ID (from list_groups)" },
|
|
64
|
-
name: { type: "string", description: "New group name (whitespace-trimmed server-side)" },
|
|
65
|
-
payloadFormat: { type: "string", enum: ["auto", "pmt"], description: "Webhook payload format. 'auto' for standard TradingView; 'pmt' for PineMarketTools." },
|
|
66
|
-
routingMode: { type: "string", enum: ["signal", "copy_trading"],
|
|
67
|
-
description: "Top-level routing mode: 'signal' (default fan-out) or 'copy_trading'." },
|
|
68
|
-
copyMode: { type: "string", enum: ["executions", "orders"],
|
|
69
|
-
description: "CT sub-mode (only valid when routingMode='copy_trading'). 'executions' (default) replicates fills; 'orders' replicates the working-order lifecycle." },
|
|
70
|
-
},
|
|
71
|
-
required: ["groupId"],
|
|
72
|
-
},
|
|
73
|
-
},
|
|
74
|
-
{
|
|
75
|
-
name: "get_group_state",
|
|
76
|
-
description: "Get live account state for a group: open positions, working orders, and stale signals per member. " +
|
|
77
|
-
"The primary 'am I flat?' check. Use before sending signals to understand current exposure.",
|
|
78
|
-
inputSchema: {
|
|
79
|
-
type: "object",
|
|
80
|
-
properties: {
|
|
81
|
-
groupId: { type: "string", description: "Group ID (from list_groups)" },
|
|
82
|
-
secret: { type: "string", description: "Group webhook secret (from list_groups webhookUrl)" },
|
|
83
|
-
},
|
|
84
|
-
required: ["groupId", "secret"],
|
|
85
|
-
},
|
|
86
|
-
},
|
|
87
|
-
{
|
|
88
|
-
name: "check_connections",
|
|
89
|
-
description: "Check broker connection health: connected/disconnected status, token expiry, broker type per connection. " +
|
|
90
|
-
"Run before sending signals if you suspect a connection issue. " +
|
|
91
|
-
"IB (Interactive Brokers) connections authenticate directly with api.ibkr.com using SRP+SSODH — no CP Gateway, no EC2 broker. VP stores encrypted IB username/password/TOTP secret and authenticates headlessly; " +
|
|
92
|
-
"a keepalive service probes /v1/api/portfolio/accounts to re-authenticate on session expiry. " +
|
|
93
|
-
"CONN-FLAP: the connection-detail endpoint also exposes flapDetected=true when ≥3 reconnect cycles occur " +
|
|
94
|
-
"within 10 minutes (session contention — another client using the same broker credentials).",
|
|
95
|
-
inputSchema: { type: "object", properties: {}, required: [] },
|
|
96
|
-
},
|
|
97
|
-
{
|
|
98
|
-
name: "get_signal_history",
|
|
99
|
-
description: "Get recent signals for a group with status (executed/partial/failed). " +
|
|
100
|
-
"Supports filtering by ticker, status, and quantity.",
|
|
101
|
-
inputSchema: {
|
|
102
|
-
type: "object",
|
|
103
|
-
properties: {
|
|
104
|
-
groupId: { type: "string", description: "Group ID" },
|
|
105
|
-
limit: { type: "number", description: "Max signals to return (default 50, max 200)" },
|
|
106
|
-
status: { type: "string", description: "Filter by status: executed, partial, failed" },
|
|
107
|
-
ticker: { type: "string", description: "Filter by ticker symbol (e.g. MYM1!)" },
|
|
108
|
-
},
|
|
109
|
-
required: ["groupId"],
|
|
110
|
-
},
|
|
111
|
-
},
|
|
112
|
-
{
|
|
113
|
-
name: "inspect_signal",
|
|
114
|
-
description: "Get full execution detail for a signal ID: broker call log, per-account results, audit trail. " +
|
|
115
|
-
"Use to diagnose why a signal failed or partially executed. " +
|
|
116
|
-
"REJDET-05+: when a signal failed at the broker, errorMessage may include the broker's actual " +
|
|
117
|
-
"rejection narrative appended after ' — ' (e.g. `Execution Rejected — price is not in price band`), " +
|
|
118
|
-
"and the audit trail will include a `signal_failed_detail` event carrying the structured " +
|
|
119
|
-
"classification (category, source, broker, text). Feature-flag-gated (`feature.rejection-detail-fetch`); " +
|
|
120
|
-
"when the flag is AdminOnly/Off, errorMessage carries only the bare reason.",
|
|
121
|
-
inputSchema: {
|
|
122
|
-
type: "object",
|
|
123
|
-
properties: {
|
|
124
|
-
signalId: { type: "string", description: "Signal ID (from get_signal_history or send_signal response)" },
|
|
125
|
-
},
|
|
126
|
-
required: ["signalId"],
|
|
127
|
-
},
|
|
128
|
-
},
|
|
129
|
-
// ── MSIG-02: Signal templates ─────────────────────────────────────────
|
|
130
|
-
{
|
|
131
|
-
name: "list_signal_templates",
|
|
132
|
-
description: "List all signal templates for a group. Templates are saved payloads that can be replayed as manual signals.",
|
|
133
|
-
inputSchema: {
|
|
134
|
-
type: "object",
|
|
135
|
-
properties: {
|
|
136
|
-
groupId: { type: "number", description: "Group ID" },
|
|
137
|
-
},
|
|
138
|
-
required: ["groupId"],
|
|
139
|
-
},
|
|
140
|
-
},
|
|
141
|
-
{
|
|
142
|
-
name: "create_signal_template",
|
|
143
|
-
description: "Create a new signal template for a group (max 20 per user). Saves a payload (action, ticker, qty, etc.) for later reuse.",
|
|
144
|
-
inputSchema: {
|
|
145
|
-
type: "object",
|
|
146
|
-
properties: {
|
|
147
|
-
groupId: { type: "number", description: "Group ID" },
|
|
148
|
-
name: { type: "string", description: "Template name" },
|
|
149
|
-
payload: {
|
|
150
|
-
type: "object",
|
|
151
|
-
description: "Signal payload — at minimum {action, ticker}. Same shape as send_signal inputs.",
|
|
152
|
-
properties: {
|
|
153
|
-
action: { type: "string" },
|
|
154
|
-
ticker: { type: "string" },
|
|
155
|
-
},
|
|
156
|
-
required: ["action", "ticker"],
|
|
157
|
-
},
|
|
158
|
-
},
|
|
159
|
-
required: ["groupId", "name", "payload"],
|
|
160
|
-
},
|
|
161
|
-
},
|
|
162
|
-
{
|
|
163
|
-
name: "update_signal_template",
|
|
164
|
-
description: "Update an existing signal template (name and/or payload).",
|
|
165
|
-
inputSchema: {
|
|
166
|
-
type: "object",
|
|
167
|
-
properties: {
|
|
168
|
-
groupId: { type: "number", description: "Group ID" },
|
|
169
|
-
templateId: { type: "number", description: "Template ID (from list_signal_templates)" },
|
|
170
|
-
name: { type: "string", description: "New template name" },
|
|
171
|
-
payload: {
|
|
172
|
-
type: "object",
|
|
173
|
-
description: "New signal payload — at minimum {action, ticker}.",
|
|
174
|
-
properties: {
|
|
175
|
-
action: { type: "string" },
|
|
176
|
-
ticker: { type: "string" },
|
|
177
|
-
},
|
|
178
|
-
required: ["action", "ticker"],
|
|
179
|
-
},
|
|
180
|
-
},
|
|
181
|
-
required: ["groupId", "templateId", "name", "payload"],
|
|
182
|
-
},
|
|
183
|
-
},
|
|
184
|
-
{
|
|
185
|
-
name: "delete_signal_template",
|
|
186
|
-
description: "Delete a signal template from a group.",
|
|
187
|
-
inputSchema: {
|
|
188
|
-
type: "object",
|
|
189
|
-
properties: {
|
|
190
|
-
groupId: { type: "number", description: "Group ID" },
|
|
191
|
-
templateId: { type: "number", description: "Template ID (from list_signal_templates)" },
|
|
192
|
-
},
|
|
193
|
-
required: ["groupId", "templateId"],
|
|
194
|
-
},
|
|
195
|
-
},
|
|
196
|
-
{
|
|
197
|
-
name: "send_signal",
|
|
198
|
-
description: "Send a trading signal to a VantagePipe group. Fans out to all active accounts. " +
|
|
199
|
-
"Actions: buy, sell, exit, exit_and_cancel, add, reduce, reverse (close + opposite entry), breakeven (move stop to avg cost ± offset). " +
|
|
200
|
-
"Order types: market, limit, stop, stop_limit, trailing_stop. " +
|
|
201
|
-
"Quantity types: fixed_quantity (default), dollar_amount (uses amount), risk_dollar_amount (uses riskDollars + requires stopLoss; HARD REJECTS without it), percent_of_equity (uses percent + NetLiq), percent_of_position (exit-only). " +
|
|
202
|
-
"Same signal within 60s returns the cached result (safe for agent retries). " +
|
|
203
|
-
"stopLoss and takeProfit accept either a number (legacy offset/price) OR an object with TradersPost bracket shape: " +
|
|
204
|
-
"stopLoss = { type: 'stop'|'stop_limit'|'trailing_stop', stopPrice, limitPrice, percent, amount, trailAmount, trailPercent }; " +
|
|
205
|
-
"takeProfit = { limitPrice, percent, amount } (mutually exclusive). " +
|
|
206
|
-
"Use cancel_orders for cancel-by-type variants. " +
|
|
207
|
-
"Multi-broker groups: trailing_stop / OCO brackets / breakeven are gated by capability intersection — UI gets capability flags from GET /api/account/{userId}/groups/{groupId}/capabilities.",
|
|
208
|
-
inputSchema: {
|
|
209
|
-
type: "object",
|
|
210
|
-
properties: {
|
|
211
|
-
groupId: { type: "string", description: "Group ID" },
|
|
212
|
-
secret: { type: "string", description: "Group webhook secret" },
|
|
213
|
-
action: { type: "string", description: "buy | sell | exit | exit_and_cancel | add | reduce | reverse | breakeven" },
|
|
214
|
-
ticker: { type: "string", description: "Instrument symbol (e.g. MYM1!, ES1!)" },
|
|
215
|
-
quantity: { type: "number", description: "Number of contracts (for fixed_quantity sizing)" },
|
|
216
|
-
quantityType: { type: "string", description: "fixed_quantity | dollar_amount | risk_dollar_amount | percent_of_equity | percent_of_position (default: fixed_quantity)" },
|
|
217
|
-
amount: { type: "number", description: "Dollar notional for dollar_amount sizing (or risk-dollar fallback for risk_dollar_amount)" },
|
|
218
|
-
riskDollars: { type: "number", description: "Risk dollars for risk_dollar_amount sizing (REQUIRES stopLoss; rejected without it)" },
|
|
219
|
-
percent: { type: "number", description: "Percent for percent_of_equity (0-100, supports fractional) or percent_of_position partial exits" },
|
|
220
|
-
orderType: { type: "string", description: "market | limit | stop | stop_limit | trailing_stop (default: market)" },
|
|
221
|
-
limitPrice: { type: "number", description: "Limit price (for limit/stop_limit entries)" },
|
|
222
|
-
stopPrice: { type: "number", description: "Stop entry price (for stop/stop_limit)" },
|
|
223
|
-
trailAmount: { type: "number", description: "Trailing stop absolute offset (for trailing_stop order type)" },
|
|
224
|
-
trailPercent: { type: "number", description: "Trailing stop percent offset (alternative to trailAmount)" },
|
|
225
|
-
signalPrice: { type: "number", description: "Reference price used for slippage calc + risk-based sizing entry" },
|
|
226
|
-
takeProfit: { description: "Number (legacy) OR object { limitPrice | percent | amount } — exactly one shape" },
|
|
227
|
-
stopLoss: { description: "Number (legacy) OR object { type, stopPrice, limitPrice, percent, amount, trailAmount, trailPercent }" },
|
|
228
|
-
breakevenOffset: { type: "number", description: "Offset in price units for breakeven action (e.g. 10 → stop at avgCost ± 10). Required when action=breakeven." },
|
|
229
|
-
comment: { type: "string", description: "Optional comment for audit trail / close_by_comment matching" },
|
|
230
|
-
timeInForce: { type: "string", description: "day | gtc | ioc | fok | opg | cls (futures reject opg/cls)" },
|
|
231
|
-
delay: { type: "number", description: "Optional seconds to delay before routing" },
|
|
232
|
-
ignoreTradingWindows: { type: "boolean", description: "Bypass per-account trading-window filter" },
|
|
233
|
-
extendedHours: { type: "boolean", description: "Stocks only — gated by SupportsExtendedHours capability" },
|
|
234
|
-
sentiment: { type: "string", description: "long | short | flat — informational (and flat-on-buy/sell forces full exit)" },
|
|
235
|
-
test: { type: "boolean", description: "Validate-only — no live order routed" },
|
|
236
|
-
},
|
|
237
|
-
required: ["groupId", "secret", "action", "ticker"],
|
|
238
|
-
},
|
|
239
|
-
},
|
|
240
|
-
{
|
|
241
|
-
name: "cancel_orders",
|
|
242
|
-
description: "Cancel working orders for a ticker on a VantagePipe group, optionally filtered by order type. " +
|
|
243
|
-
"When cancelOrderType is omitted, cancels ALL working orders for the ticker (equivalent to action=cancel on the webhook). " +
|
|
244
|
-
"When set to 'stop' (etc.), cancels ONLY orders of that type — useful for clearing protective stops before re-bracketing without losing the entry. " +
|
|
245
|
-
"Does NOT flatten positions — use exit_positions or flatten_group for that.",
|
|
246
|
-
inputSchema: {
|
|
247
|
-
type: "object",
|
|
248
|
-
properties: {
|
|
249
|
-
groupId: { type: "string", description: "Group ID" },
|
|
250
|
-
secret: { type: "string", description: "Group webhook secret" },
|
|
251
|
-
ticker: { type: "string", description: "Ticker whose working orders to cancel" },
|
|
252
|
-
cancelOrderType: { type: "string", description: "market | limit | stop | stop_limit | trailing_stop (omit to cancel all types)" },
|
|
253
|
-
comment: { type: "string", description: "Optional comment for audit" },
|
|
254
|
-
},
|
|
255
|
-
required: ["groupId", "secret", "ticker"],
|
|
256
|
-
},
|
|
257
|
-
},
|
|
258
|
-
{
|
|
259
|
-
name: "exit_positions",
|
|
260
|
-
description: "Send an exit signal to a group, closing all open positions for the specified ticker (or all tickers). " +
|
|
261
|
-
"Uses action=exit on the group webhook. Safe to call when already flat — returns success with 0 dispatched.",
|
|
262
|
-
inputSchema: {
|
|
263
|
-
type: "object",
|
|
264
|
-
properties: {
|
|
265
|
-
groupId: { type: "string", description: "Group ID" },
|
|
266
|
-
secret: { type: "string", description: "Group webhook secret" },
|
|
267
|
-
ticker: { type: "string", description: "Ticker to exit (omit to exit all tickers)" },
|
|
268
|
-
comment: { type: "string", description: "Optional comment" },
|
|
269
|
-
},
|
|
270
|
-
required: ["groupId", "secret"],
|
|
271
|
-
},
|
|
272
|
-
},
|
|
273
|
-
{
|
|
274
|
-
name: "flatten_group",
|
|
275
|
-
description: "SAFETY OPERATION: immediately closes ALL open positions and cancels ALL working orders " +
|
|
276
|
-
"across every account in the group via the VantagePipe flatten API. " +
|
|
277
|
-
"Requires confirm: true to prevent accidental execution.",
|
|
278
|
-
inputSchema: {
|
|
279
|
-
type: "object",
|
|
280
|
-
properties: {
|
|
281
|
-
groupId: { type: "string", description: "Group ID" },
|
|
282
|
-
confirm: { type: "boolean", description: "Must be true to execute — prevents accidental flatten" },
|
|
283
|
-
},
|
|
284
|
-
required: ["groupId", "confirm"],
|
|
285
|
-
},
|
|
286
|
-
},
|
|
287
|
-
// ── USERS-02: Magic-link invite ────────────────────────────────────────
|
|
288
|
-
{
|
|
289
|
-
name: "send_magic_link",
|
|
290
|
-
description: "Admin-only: issue a one-time magic-link invite and email it to any user. " +
|
|
291
|
-
"The link lets the user log in without Google OAuth. Returns { sentTo } — never the raw token. " +
|
|
292
|
-
"Returns an error if the user does not exist or has no email on file.",
|
|
293
|
-
inputSchema: {
|
|
294
|
-
type: "object",
|
|
295
|
-
properties: {
|
|
296
|
-
userId: { type: "number", description: "ID of the user to invite" },
|
|
297
|
-
},
|
|
298
|
-
required: ["userId"],
|
|
299
|
-
},
|
|
300
|
-
},
|
|
301
|
-
// ── AGNT-06: Journal ─────────────────────────────────────────────────
|
|
302
|
-
{
|
|
303
|
-
name: "get_journal_trades",
|
|
304
|
-
description: "Get trade history from the journal with P&L per trade. Filter by date range, account, or limit. Pass unlinkedFilter='retained' to show ONLY trades retained from a deleted broker account (mutually exclusive with accountSpec).",
|
|
305
|
-
inputSchema: {
|
|
306
|
-
type: "object",
|
|
307
|
-
properties: {
|
|
308
|
-
startDate: { type: "string", description: "Start date (YYYY-MM-DD)" },
|
|
309
|
-
endDate: { type: "string", description: "End date (YYYY-MM-DD)" },
|
|
310
|
-
accountSpec: { type: "string", description: "Filter by account spec (e.g. DEMO4424965)" },
|
|
311
|
-
limit: { type: "number", description: "Max trades to return" },
|
|
312
|
-
unlinkedFilter: { type: "string", enum: ["retained"], description: "Set to 'retained' to show only trades from deleted-but-kept accounts (ACCT-DEL)" },
|
|
313
|
-
},
|
|
314
|
-
required: [],
|
|
315
|
-
},
|
|
316
|
-
},
|
|
317
|
-
{
|
|
318
|
-
name: "get_journal_dashboard",
|
|
319
|
-
description: "Get aggregate journal stats: net P&L, win rate, profit factor, Sharpe, avg win/loss, max drawdown.",
|
|
320
|
-
inputSchema: { type: "object", properties: {}, required: [] },
|
|
321
|
-
},
|
|
322
|
-
{
|
|
323
|
-
name: "get_journal_entries",
|
|
324
|
-
description: "Get free-text journal notes. Filter by date range.",
|
|
325
|
-
inputSchema: {
|
|
326
|
-
type: "object",
|
|
327
|
-
properties: {
|
|
328
|
-
startDate: { type: "string", description: "Start date (YYYY-MM-DD)" },
|
|
329
|
-
endDate: { type: "string", description: "End date (YYYY-MM-DD)" },
|
|
330
|
-
},
|
|
331
|
-
required: [],
|
|
332
|
-
},
|
|
333
|
-
},
|
|
334
|
-
{
|
|
335
|
-
name: "add_journal_entry",
|
|
336
|
-
description: "Write a free-text note to the journal for a given date.",
|
|
337
|
-
inputSchema: {
|
|
338
|
-
type: "object",
|
|
339
|
-
properties: {
|
|
340
|
-
date: { type: "string", description: "Date for the entry (YYYY-MM-DD)" },
|
|
341
|
-
text: { type: "string", description: "Note text" },
|
|
342
|
-
},
|
|
343
|
-
required: ["date", "text"],
|
|
344
|
-
},
|
|
345
|
-
},
|
|
346
|
-
// ── AGNT-06: Calendar ─────────────────────────────────────────────────
|
|
347
|
-
{
|
|
348
|
-
name: "get_economic_events",
|
|
349
|
-
description: "Get economic calendar events with severity (high/medium/low), actual, and forecast values. Use to check news risk before sending signals.",
|
|
350
|
-
inputSchema: {
|
|
351
|
-
type: "object",
|
|
352
|
-
properties: {
|
|
353
|
-
startDate: { type: "string", description: "Start date (YYYY-MM-DD)" },
|
|
354
|
-
endDate: { type: "string", description: "End date (YYYY-MM-DD)" },
|
|
355
|
-
severity: { type: "string", description: "Filter: high, medium, or low" },
|
|
356
|
-
},
|
|
357
|
-
required: [],
|
|
358
|
-
},
|
|
359
|
-
},
|
|
360
|
-
{
|
|
361
|
-
name: "get_economic_events_month",
|
|
362
|
-
description: "Get full month economic calendar grouped by day. Use to plan around high-impact news weeks.",
|
|
363
|
-
inputSchema: {
|
|
364
|
-
type: "object",
|
|
365
|
-
properties: {
|
|
366
|
-
year: { type: "number", description: "Year (e.g. 2026)" },
|
|
367
|
-
month: { type: "number", description: "Month 1–12" },
|
|
368
|
-
},
|
|
369
|
-
required: [],
|
|
370
|
-
},
|
|
371
|
-
},
|
|
372
|
-
// ── BUG-banner-market-closed: CME futures session window ─────────────
|
|
373
|
-
{
|
|
374
|
-
name: "get_market_hours",
|
|
375
|
-
description: "Check whether the CME futures market is currently open. Returns { isOpen, nextOpenAt (UTC ISO; null if open), asset }. Use to interpret an empty broker account roster — a closed market explains an empty roster without implying the connection is defunct.",
|
|
376
|
-
inputSchema: {
|
|
377
|
-
type: "object",
|
|
378
|
-
properties: {},
|
|
379
|
-
required: [],
|
|
380
|
-
},
|
|
381
|
-
},
|
|
382
|
-
// ── RISK: Risk Management ────────────────────────────────────────────
|
|
383
|
-
{
|
|
384
|
-
name: "get_risk",
|
|
385
|
-
description: "Get the current risk snapshot for all broker accounts: cash, net liquidation, " +
|
|
386
|
-
"open P&L, day P&L, distance to drawdown limit, daily loss limit, margin balance, " +
|
|
387
|
-
"and buying power. Distance to drawdown is the #1 prop-firm risk number — how much " +
|
|
388
|
-
"the account can lose before hitting the auto-liquidation threshold. " +
|
|
389
|
-
"Returns 'No risk data yet' for accounts whose broker feed has not pushed a snapshot. " +
|
|
390
|
-
"Use this to monitor account health and check drawdown proximity.",
|
|
391
|
-
inputSchema: { type: "object", properties: {}, required: [] },
|
|
392
|
-
},
|
|
393
|
-
// ── RM2-07: Operator dashboard for daily-loss / funded-goal halts ────
|
|
394
|
-
{
|
|
395
|
-
name: "get_risk_halts",
|
|
396
|
-
description: "RM2-07 — list every account_risk_state row currently in is_halted=TRUE for the authed " +
|
|
397
|
-
"user, ordered by triggered_at DESC. Each entry includes the halt reason " +
|
|
398
|
-
"(daily_loss, daily_profit, funded_goal, manual), trigger and limit values, whether " +
|
|
399
|
-
"the post-halt flatten partially failed (flattenFailed=true → positions may still be " +
|
|
400
|
-
"open at the broker), and any operator notes. Use to spot which accounts are paused " +
|
|
401
|
-
"before sending signals, or to drive a halt-history view.",
|
|
402
|
-
inputSchema: { type: "object", properties: {}, required: [] },
|
|
403
|
-
},
|
|
404
|
-
{
|
|
405
|
-
name: "reenable_risk_halt",
|
|
406
|
-
description: "RM2-07 — operator manual re-enable. Clears the most-recent open halt on the named " +
|
|
407
|
-
"account (sets is_halted=FALSE, stamps reset_by='operator:{userId}') and flips " +
|
|
408
|
-
"connection_accounts.is_enabled=TRUE so signals route again. Writes an audit_entries " +
|
|
409
|
-
"row (risk_halt_reenabled). Returns NotFound if the account has no open halt. " +
|
|
410
|
-
"Use this once you have verified the account is safe to resume — there is no " +
|
|
411
|
-
"automatic confirmation gate.",
|
|
412
|
-
inputSchema: {
|
|
413
|
-
type: "object",
|
|
414
|
-
properties: {
|
|
415
|
-
connectionAccountId: {
|
|
416
|
-
type: "integer",
|
|
417
|
-
description: "The VantagePipe ConnectionAccount.Id (NOT the broker-native account number).",
|
|
418
|
-
},
|
|
419
|
-
},
|
|
420
|
-
required: ["connectionAccountId"],
|
|
421
|
-
},
|
|
422
|
-
},
|
|
423
|
-
// ── CT-01-S5: Copy-trading per-account settings ────────────────────
|
|
424
|
-
{
|
|
425
|
-
name: "set_copier_settings",
|
|
426
|
-
description: "CT-01-S5 — Update copy-trading settings for one account in a signal group. " +
|
|
427
|
-
"Partial PATCH: only the fields you supply are updated. `isCopySource=true` " +
|
|
428
|
-
"designates this account as the group's copy source (fills fan out to every " +
|
|
429
|
-
"other account); the at-most-one-copy-source-per-group invariant is enforced " +
|
|
430
|
-
"by the partial unique index `ux_signal_group_accounts_copy_source_per_group` " +
|
|
431
|
-
"and surfaces as a 409 Conflict. `contractTypeOverride` is one of " +
|
|
432
|
-
"`force_mini`, `force_micro`, or `\"\"` (empty = auto/follow source). The " +
|
|
433
|
-
"remaining flags shape per-follower behaviour: `copierEnabled` (master pause), " +
|
|
434
|
-
"`fadeMode` (mirror buy↔sell), `longOnly` / `shortOnly` (direction filter), " +
|
|
435
|
-
"`floorQtyAtOne` (don't skip when scaled qty < 1). " +
|
|
436
|
-
"GMODE-07 (CT-Orders mode): `ordersModeEnabled` is a per-follower opt-out for " +
|
|
437
|
-
"CT-Orders replication — when the group's `copyMode='orders'`, only followers " +
|
|
438
|
-
"with `ordersModeEnabled=true` receive working-order lifecycle events. " +
|
|
439
|
-
"`syncExistingWorkingOrders` is a write-only side-effect flag (not persisted): " +
|
|
440
|
-
"when true alongside a `isCopySource=true` promotion, the server fires " +
|
|
441
|
-
"`CopierWorkingOrderReplay` against the freshly-promoted leader's open broker " +
|
|
442
|
-
"orders so followers pick up pre-existing working orders without waiting for " +
|
|
443
|
-
"the next live event. Only meaningful in a `routingMode='copy_trading'` + " +
|
|
444
|
-
"`copyMode='orders'` group; ignored otherwise.",
|
|
445
|
-
inputSchema: {
|
|
446
|
-
type: "object",
|
|
447
|
-
properties: {
|
|
448
|
-
groupId: { type: "integer", description: "Signal group ID." },
|
|
449
|
-
accountId: { type: "integer", description: "signal_group_accounts.id of the membership row to update." },
|
|
450
|
-
isCopySource: { type: "boolean", description: "Designate this account as the group's copy source. Returns 409 if another account in the same group already is. Returns 422 (`group_in_signal_mode`) if the group's `routingMode='signal'`." },
|
|
451
|
-
copierEnabled: { type: "boolean" },
|
|
452
|
-
contractTypeOverride: { type: "string", description: "force_mini | force_micro | \"\" (auto)" },
|
|
453
|
-
floorQtyAtOne: { type: "boolean" },
|
|
454
|
-
fadeMode: { type: "boolean" },
|
|
455
|
-
longOnly: { type: "boolean" },
|
|
456
|
-
shortOnly: { type: "boolean" },
|
|
457
|
-
ordersModeEnabled: { type: "boolean", description: "Per-follower CT-Orders opt-out. Only relevant when the group's `routingMode='copy_trading'` and `copyMode='orders'`." },
|
|
458
|
-
syncExistingWorkingOrders: { type: "boolean", description: "Write-only side-effect flag (not persisted): when true alongside `isCopySource=true`, replays the new leader's open working orders to followers via CopierWorkingOrderReplay." },
|
|
459
|
-
},
|
|
460
|
-
required: ["groupId", "accountId"],
|
|
461
|
-
},
|
|
462
|
-
},
|
|
463
|
-
// ── ACCT-HEALTH PR-4: derived account-tradability state ──────────────
|
|
464
|
-
{
|
|
465
|
-
name: "get_account_health",
|
|
466
|
-
description: "Get the derived health banner data for one account: state ∈ {ok, blown, " +
|
|
467
|
-
"unreachable, unknown}, optional headline + detail, manual-override metadata. " +
|
|
468
|
-
"BLOWN means the account is not tradable (drawdown breached, broker session " +
|
|
469
|
-
"terminated abnormally, or an admin marked it dead); UNREACHABLE means the " +
|
|
470
|
-
"broker connection itself is unhealthy; UNKNOWN means the broker capability " +
|
|
471
|
-
"doesn't expose enough signal to classify. Use before routing a signal to " +
|
|
472
|
-
"confirm the destination account is alive.",
|
|
473
|
-
inputSchema: {
|
|
474
|
-
type: "object",
|
|
475
|
-
properties: {
|
|
476
|
-
connId: { type: "number", description: "Connection id (from list_groups / check_connections)." },
|
|
477
|
-
brokerAccountKey: { type: "string", description: "Broker-side account id (e.g. 'BX64821-14' for Rithmic, numeric for Tradovate, 'U1234567' for Interactive Brokers)." },
|
|
478
|
-
},
|
|
479
|
-
required: ["connId", "brokerAccountKey"],
|
|
480
|
-
},
|
|
481
|
-
},
|
|
482
|
-
{
|
|
483
|
-
name: "set_account_health_override",
|
|
484
|
-
description: "Admin-only — set or clear the manual health override on an account. " +
|
|
485
|
-
"kind='blown' marks the account dead indefinitely; kind='ok' silences " +
|
|
486
|
-
"derived 'blown' state for up to 24h (auto-defaults to +24h if expiresAt " +
|
|
487
|
-
"omitted; an explicit future expiresAt is honoured); kind=null clears " +
|
|
488
|
-
"the override and lets derived state take over again. Always emits an " +
|
|
489
|
-
"audit row.",
|
|
490
|
-
inputSchema: {
|
|
491
|
-
type: "object",
|
|
492
|
-
properties: {
|
|
493
|
-
connId: { type: "number" },
|
|
494
|
-
brokerAccountKey: { type: "string" },
|
|
495
|
-
kind: { type: ["string", "null"], enum: ["blown", "ok", null] },
|
|
496
|
-
reason: { type: "string" },
|
|
497
|
-
expiresAt: { type: ["string", "null"], description: "ISO-8601; required when kind='ok'." },
|
|
498
|
-
},
|
|
499
|
-
required: ["connId", "brokerAccountKey", "kind"],
|
|
500
|
-
},
|
|
501
|
-
},
|
|
502
|
-
// ── ACCT-DISC-LIVE-02: Account discovery ─────────────────────────────
|
|
503
|
-
{
|
|
504
|
-
name: "sync_connection_accounts",
|
|
505
|
-
description: "Force-refresh the broker account list for one connection. " +
|
|
506
|
-
"Use when a new broker account was just funded/activated (Topstep eval pass, " +
|
|
507
|
-
"prop-firm refresh, new Tradovate sub-account) and you want VP to pick it up " +
|
|
508
|
-
"immediately rather than waiting up to 15 min for the periodic sweep. " +
|
|
509
|
-
"VP throttles to one broker call per 30s per connection, so calling this " +
|
|
510
|
-
"repeatedly is free — additional calls return the cached account list. " +
|
|
511
|
-
"Returns the post-sync account list. Rithmic uses a plant-state guard: " +
|
|
512
|
-
"the sync only runs if both plants are already logged in (won't auto-open " +
|
|
513
|
-
"a dead session). LEAN has no broker roster and is skipped.",
|
|
514
|
-
inputSchema: {
|
|
515
|
-
type: "object",
|
|
516
|
-
properties: {
|
|
517
|
-
connectionId: {
|
|
518
|
-
type: "integer",
|
|
519
|
-
description: "BrokerConnection.Id to sync (from list_groups or check_connections).",
|
|
520
|
-
},
|
|
521
|
-
},
|
|
522
|
-
required: ["connectionId"],
|
|
523
|
-
},
|
|
524
|
-
},
|
|
525
|
-
// ── AGNT-07: Account ──────────────────────────────────────────────────
|
|
526
|
-
{
|
|
527
|
-
name: "get_balance",
|
|
528
|
-
description: "Get cash balance, open P&L, margin used, and total equity per account.",
|
|
529
|
-
inputSchema: { type: "object", properties: {}, required: [] },
|
|
530
|
-
},
|
|
531
|
-
{
|
|
532
|
-
name: "get_positions",
|
|
533
|
-
description: "Get open positions across all accounts: ticker, side (long/short), quantity, avg price, unrealized P&L. Returns 'flat' when no positions.",
|
|
534
|
-
inputSchema: { type: "object", properties: {}, required: [] },
|
|
535
|
-
},
|
|
536
|
-
{
|
|
537
|
-
name: "get_order_history",
|
|
538
|
-
description: "Get recent orders for a group: ticker, action, type, fill price, status.",
|
|
539
|
-
inputSchema: {
|
|
540
|
-
type: "object",
|
|
541
|
-
properties: {
|
|
542
|
-
groupId: { type: "string", description: "Group ID" },
|
|
543
|
-
limit: { type: "number", description: "Max orders to return" },
|
|
544
|
-
},
|
|
545
|
-
required: ["groupId"],
|
|
546
|
-
},
|
|
547
|
-
},
|
|
548
|
-
{
|
|
549
|
-
name: "get_broker_order_history",
|
|
550
|
-
description: "LBENCH-01 forensic post-trade lookup: returns broker-recorded orders on a connection-account placed between sinceUtc and untilUtc, regardless of status (Working / Filled / Cancelled / Rejected). Read-only. Used by the manual-execute latency benchmark to identify which broker order a TradersPost webhook produced and to retrieve broker-side submission timestamps. Returns 501 when the underlying broker does not implement submission-window query.",
|
|
551
|
-
inputSchema: {
|
|
552
|
-
type: "object",
|
|
553
|
-
properties: {
|
|
554
|
-
connectionId: { type: "integer", description: "BrokerConnection.Id (int)" },
|
|
555
|
-
accountId: { type: "string", description: "Broker-native account spec (e.g. 'DEMO4424965' for Tradovate)" },
|
|
556
|
-
sinceUtc: { type: "string", description: "ISO 8601 timestamp — earliest order submission time to return" },
|
|
557
|
-
untilUtc: { type: "string", description: "ISO 8601 timestamp — latest order submission time; defaults to now" },
|
|
558
|
-
filter: { type: "string", description: "Optional case-insensitive substring filter on the broker-side comment / customTag / clOrdId" },
|
|
559
|
-
limit: { type: "integer", description: "Max orders to return (default 200, max 1000)" },
|
|
560
|
-
},
|
|
561
|
-
required: ["connectionId", "accountId", "sinceUtc"],
|
|
562
|
-
},
|
|
563
|
-
},
|
|
564
|
-
{
|
|
565
|
-
name: "get_market_price",
|
|
566
|
-
description: "Get live last/bid/ask price for a ticker via the group webhook. Requires groupId and secret.",
|
|
567
|
-
inputSchema: {
|
|
568
|
-
type: "object",
|
|
569
|
-
properties: {
|
|
570
|
-
groupId: { type: "string", description: "Group ID" },
|
|
571
|
-
secret: { type: "string", description: "Group webhook secret" },
|
|
572
|
-
ticker: { type: "string", description: "Instrument symbol (e.g. MYMM6)" },
|
|
573
|
-
},
|
|
574
|
-
required: ["groupId", "secret", "ticker"],
|
|
575
|
-
},
|
|
576
|
-
},
|
|
577
|
-
{
|
|
578
|
-
name: "get_alerts",
|
|
579
|
-
description: "Get system alerts (token expiry, signal failures, etc.) with read/unread status.",
|
|
580
|
-
inputSchema: {
|
|
581
|
-
type: "object",
|
|
582
|
-
properties: {
|
|
583
|
-
unreadOnly: { type: "boolean", description: "Return only unread alerts" },
|
|
584
|
-
},
|
|
585
|
-
required: [],
|
|
586
|
-
},
|
|
587
|
-
},
|
|
588
|
-
{
|
|
589
|
-
name: "ack_alert",
|
|
590
|
-
description: "Mark an alert as read/acknowledged.",
|
|
591
|
-
inputSchema: {
|
|
592
|
-
type: "object",
|
|
593
|
-
properties: {
|
|
594
|
-
alertId: { type: "string", description: "Alert ID (from get_alerts)" },
|
|
595
|
-
},
|
|
596
|
-
required: ["alertId"],
|
|
597
|
-
},
|
|
598
|
-
},
|
|
599
|
-
{
|
|
600
|
-
name: "get_signal_broker_logs",
|
|
601
|
-
description: "Get raw broker HTTP request/response logs for a signal. Use to diagnose partial fills " +
|
|
602
|
-
"or broker errors beyond what inspect_signal shows. " +
|
|
603
|
-
"REJDET-02+: failed Tradovate signals additionally carry a `GET /commandReport/list?ids=...` " +
|
|
604
|
-
"row whose responseBody is the matching-engine's reject narrative (price-band violation, " +
|
|
605
|
-
"margin shortfall, etc.). Feature-flag-gated (`feature.rejection-detail-fetch`); the row " +
|
|
606
|
-
"appears only when the flag is enabled for the user. ProjectX rejections surface their " +
|
|
607
|
-
"errorMessage on the original `/api/Order/place` response row; Rithmic uses the exchange-" +
|
|
608
|
-
"reject WS event path and writes no extra log row.",
|
|
609
|
-
inputSchema: {
|
|
610
|
-
type: "object",
|
|
611
|
-
properties: {
|
|
612
|
-
signalId: { type: "string", description: "Signal ID" },
|
|
613
|
-
},
|
|
614
|
-
required: ["signalId"],
|
|
615
|
-
},
|
|
616
|
-
},
|
|
617
|
-
// ── BILL-8a: Billing ──────────────────────────────────────────────────
|
|
618
|
-
{
|
|
619
|
-
name: "get_billing",
|
|
620
|
-
description: "Get subscription billing state for the authenticated user: status, renewal date, trial end, cancel-at-period-end flag, and seat quantity.",
|
|
621
|
-
inputSchema: { type: "object", properties: {}, required: [] },
|
|
622
|
-
},
|
|
623
|
-
{
|
|
624
|
-
name: "get_billing_portal",
|
|
625
|
-
description: "Create a Stripe billing portal session and return the URL. Open this URL in a browser to manage the subscription (upgrade, cancel, update payment method). Returns 503 if Stripe is not configured.",
|
|
626
|
-
inputSchema: { type: "object", properties: {}, required: [] },
|
|
627
|
-
},
|
|
628
|
-
// ── AGNT-08: QC Algorithms ────────────────────────────────────────────
|
|
629
|
-
{
|
|
630
|
-
name: "list_qc_algorithms",
|
|
631
|
-
description: "List all QC algorithms stored in VantagePipe with their IDs and names.",
|
|
632
|
-
inputSchema: { type: "object", properties: {}, required: [] },
|
|
633
|
-
},
|
|
634
|
-
{
|
|
635
|
-
name: "get_qc_algorithm",
|
|
636
|
-
description: "Get metadata and file list for a specific QC algorithm.",
|
|
637
|
-
inputSchema: {
|
|
638
|
-
type: "object",
|
|
639
|
-
properties: {
|
|
640
|
-
algorithmId: { type: "string", description: "Algorithm ID (from list_qc_algorithms)" },
|
|
641
|
-
},
|
|
642
|
-
required: ["algorithmId"],
|
|
643
|
-
},
|
|
644
|
-
},
|
|
645
|
-
{
|
|
646
|
-
name: "get_algorithm_file",
|
|
647
|
-
description: "Get the source code of a specific file in a QC algorithm (e.g. main.py).",
|
|
648
|
-
inputSchema: {
|
|
649
|
-
type: "object",
|
|
650
|
-
properties: {
|
|
651
|
-
algorithmId: { type: "string", description: "Algorithm ID" },
|
|
652
|
-
filename: { type: "string", description: "Filename (e.g. main.py)" },
|
|
653
|
-
},
|
|
654
|
-
required: ["algorithmId", "filename"],
|
|
655
|
-
},
|
|
656
|
-
},
|
|
657
|
-
{
|
|
658
|
-
name: "create_qc_algorithm",
|
|
659
|
-
description: "Create a new QC algorithm with an initial set of source files.",
|
|
660
|
-
inputSchema: {
|
|
661
|
-
type: "object",
|
|
662
|
-
properties: {
|
|
663
|
-
name: { type: "string", description: "Algorithm name" },
|
|
664
|
-
files: {
|
|
665
|
-
type: "array",
|
|
666
|
-
description: "Source files",
|
|
667
|
-
items: {
|
|
668
|
-
type: "object",
|
|
669
|
-
properties: {
|
|
670
|
-
filename: { type: "string" },
|
|
671
|
-
content: { type: "string" },
|
|
672
|
-
},
|
|
673
|
-
required: ["filename", "content"],
|
|
674
|
-
},
|
|
675
|
-
},
|
|
676
|
-
},
|
|
677
|
-
required: ["name"],
|
|
678
|
-
},
|
|
679
|
-
},
|
|
680
|
-
{
|
|
681
|
-
name: "update_qc_algorithm",
|
|
682
|
-
description: "Update one or more source files in an existing QC algorithm.",
|
|
683
|
-
inputSchema: {
|
|
684
|
-
type: "object",
|
|
685
|
-
properties: {
|
|
686
|
-
algorithmId: { type: "string", description: "Algorithm ID" },
|
|
687
|
-
files: {
|
|
688
|
-
type: "array",
|
|
689
|
-
description: "Files to update",
|
|
690
|
-
items: {
|
|
691
|
-
type: "object",
|
|
692
|
-
properties: {
|
|
693
|
-
filename: { type: "string" },
|
|
694
|
-
content: { type: "string" },
|
|
695
|
-
},
|
|
696
|
-
required: ["filename", "content"],
|
|
697
|
-
},
|
|
698
|
-
},
|
|
699
|
-
},
|
|
700
|
-
required: ["algorithmId", "files"],
|
|
701
|
-
},
|
|
702
|
-
},
|
|
703
|
-
// ── AGNT-08: Strategy Instances ───────────────────────────────────────
|
|
704
|
-
{
|
|
705
|
-
name: "list_strategy_instances",
|
|
706
|
-
description: "List QC strategy instances (backtests and live runs) with status and algorithm name.",
|
|
707
|
-
inputSchema: {
|
|
708
|
-
type: "object",
|
|
709
|
-
properties: {
|
|
710
|
-
status: { type: "string", description: "Filter by status: running, completed, failed, stopped" },
|
|
711
|
-
groupId: { type: "string", description: "Filter to instances in this group" },
|
|
712
|
-
},
|
|
713
|
-
required: [],
|
|
714
|
-
},
|
|
715
|
-
},
|
|
716
|
-
{
|
|
717
|
-
name: "get_strategy_instance",
|
|
718
|
-
description: "Get detail for a specific strategy instance: status, progress, mode, error.",
|
|
719
|
-
inputSchema: {
|
|
720
|
-
type: "object",
|
|
721
|
-
properties: {
|
|
722
|
-
instanceId: { type: "string", description: "Instance ID (from list_strategy_instances or launch_strategy)" },
|
|
723
|
-
},
|
|
724
|
-
required: ["instanceId"],
|
|
725
|
-
},
|
|
726
|
-
},
|
|
727
|
-
{
|
|
728
|
-
name: "launch_strategy",
|
|
729
|
-
description: "Launch a QC algorithm as a live/paper strategy instance. Returns instanceId immediately — use get_strategy_logs to monitor.",
|
|
730
|
-
inputSchema: {
|
|
731
|
-
type: "object",
|
|
732
|
-
properties: {
|
|
733
|
-
algorithmId: { type: "string", description: "Algorithm ID to run (from list_qc_algorithms)" },
|
|
734
|
-
connectionAccountId: { type: "number", description: "Connection account ID to trade against (from check_connections)" },
|
|
735
|
-
strategyName: { type: "string", description: "Display name for this instance" },
|
|
736
|
-
quickTestMode: { type: "boolean", description: "Enable quick test mode — session starts within minutes" },
|
|
737
|
-
useDatabento: { type: "boolean", description: "Use the built-in Databento API key for live market data instead of stored S3 backtest files. Omit (default) to use stored files." },
|
|
738
|
-
replayStart: { type: "string", description: "ISO-8601 UTC datetime to replay from (e.g. 2026-04-28T08:34:00Z). Omit for live data. When set, the launch runs in LEAN backtest mode with simulated fills." },
|
|
739
|
-
replayEnd: { type: "string", description: "ISO-8601 UTC datetime to replay until. Omit for default (replayStart + 6h). Only meaningful when replayStart is set." },
|
|
740
|
-
databentoApiKey: { type: "string", description: "Databento API key override. Omit to use saved profile key or run in no-data mode." },
|
|
741
|
-
sessionStartTime: { type: "string", description: "Override LEAN session start time (e.g. '09:30')" },
|
|
742
|
-
preset: { type: "string", description: "Algorithm preset (e.g. 'conservative', 'moderate', 'aggressive'). Overrides the ECS task-def default LEAN_PRESET. Use to apples-to-apples compare an ECS run against a local QC backtest with a specific preset." },
|
|
743
|
-
slippageTicks: { type: "number", description: "Slippage in ticks applied by FixedSlippageFutureFillModel. Default 1 matches TV strategy-tester (stop-market entry gets 1 adverse tick; limit TP gets zero). Set to 0 for zero-slippage sensitivity analysis." },
|
|
744
|
-
delayedLiveMode: { type: "boolean", description: "Use 12h-delayed Databento historical feed while routing real orders to broker. No paid Databento live-streaming entitlement required. Run during 19:00–03:00 PT so the delayed window covers the prior RTH session." },
|
|
745
|
-
},
|
|
746
|
-
required: ["algorithmId", "connectionAccountId", "strategyName"],
|
|
747
|
-
},
|
|
748
|
-
},
|
|
749
|
-
{
|
|
750
|
-
name: "launch_group",
|
|
751
|
-
description: "Launch a QC algorithm against ALL active accounts in a signal group — one instance per account, atomic rollback on partial failure. Returns instanceIds array (one per account). Use get_strategy_logs per instanceId to monitor.",
|
|
752
|
-
inputSchema: {
|
|
753
|
-
type: "object",
|
|
754
|
-
properties: {
|
|
755
|
-
groupId: { type: "number", description: "Signal group ID (from list_groups)" },
|
|
756
|
-
algorithmId: { type: "number", description: "QC algorithm ID (from list_qc_algorithms)" },
|
|
757
|
-
quickTestMode: { type: "boolean", description: "Enable quick test mode — session starts within minutes" },
|
|
758
|
-
useDatabento: { type: "boolean", description: "Use the built-in Databento API key for live market data instead of stored S3 backtest files." },
|
|
759
|
-
replayStart: { type: "string", description: "ISO-8601 UTC datetime to replay from (e.g. 2026-05-01T13:30:00Z). Omit for live." },
|
|
760
|
-
replayEnd: { type: "string", description: "ISO-8601 UTC datetime to replay until. Only used when replayStart is set." },
|
|
761
|
-
preset: { type: "string", description: "Algorithm preset (e.g. 'conservative', 'moderate', 'aggressive') applied to ALL instances launched. Overrides the ECS task-def default LEAN_PRESET." },
|
|
762
|
-
slippageTicks: { type: "number", description: "Slippage ticks for all instances in this group. Default 1." },
|
|
763
|
-
},
|
|
764
|
-
required: ["groupId", "algorithmId"],
|
|
765
|
-
},
|
|
766
|
-
},
|
|
767
|
-
{
|
|
768
|
-
name: "stop_strategy",
|
|
769
|
-
description: "Stop a running strategy instance.",
|
|
770
|
-
inputSchema: {
|
|
771
|
-
type: "object",
|
|
772
|
-
properties: {
|
|
773
|
-
instanceId: { type: "string", description: "Instance ID to stop" },
|
|
774
|
-
},
|
|
775
|
-
required: ["instanceId"],
|
|
776
|
-
},
|
|
777
|
-
},
|
|
778
|
-
{
|
|
779
|
-
name: "stop_group",
|
|
780
|
-
description: "Stop all running strategy instances in a group owned by the caller. Returns { success, stopped }.",
|
|
781
|
-
inputSchema: {
|
|
782
|
-
type: "object",
|
|
783
|
-
properties: {
|
|
784
|
-
groupId: { type: "string", description: "Group ID to stop" },
|
|
785
|
-
},
|
|
786
|
-
required: ["groupId"],
|
|
787
|
-
},
|
|
788
|
-
},
|
|
789
|
-
{
|
|
790
|
-
name: "get_strategy_logs",
|
|
791
|
-
description: "Get execution logs for a strategy instance. Tail the last N lines (default 100). Call repeatedly to follow progress on a running backtest.",
|
|
792
|
-
inputSchema: {
|
|
793
|
-
type: "object",
|
|
794
|
-
properties: {
|
|
795
|
-
instanceId: { type: "string", description: "Instance ID" },
|
|
796
|
-
tail: { type: "number", description: "Return last N lines (default 100)" },
|
|
797
|
-
},
|
|
798
|
-
required: ["instanceId"],
|
|
799
|
-
},
|
|
800
|
-
},
|
|
801
|
-
{
|
|
802
|
-
name: "get_strategy_stats",
|
|
803
|
-
description: "Get backtest performance stats: net P&L, win rate, profit factor, Sharpe, max drawdown.",
|
|
804
|
-
inputSchema: {
|
|
805
|
-
type: "object",
|
|
806
|
-
properties: {
|
|
807
|
-
instanceId: { type: "string", description: "Instance ID" },
|
|
808
|
-
},
|
|
809
|
-
required: ["instanceId"],
|
|
810
|
-
},
|
|
811
|
-
},
|
|
812
|
-
{
|
|
813
|
-
name: "get_strategy_orders",
|
|
814
|
-
description: "Get raw per-fill order export for a strategy instance (one row per fill, signed qty). For paired round-trips with P&L, use get_strategy_trades instead.",
|
|
815
|
-
inputSchema: {
|
|
816
|
-
type: "object",
|
|
817
|
-
properties: {
|
|
818
|
-
instanceId: { type: "string", description: "Instance ID" },
|
|
819
|
-
},
|
|
820
|
-
required: ["instanceId"],
|
|
821
|
-
},
|
|
822
|
-
},
|
|
823
|
-
{
|
|
824
|
-
name: "get_strategy_trades",
|
|
825
|
-
description: "Get FIFO-paired round-trip trades for a strategy instance. Each row is a closed (or open) round-trip with commission-net realized P&L. Use this instead of get_strategy_orders when you want per-trade P&L.",
|
|
826
|
-
inputSchema: {
|
|
827
|
-
type: "object",
|
|
828
|
-
properties: {
|
|
829
|
-
instanceId: { type: "string", description: "Instance ID" },
|
|
830
|
-
},
|
|
831
|
-
required: ["instanceId"],
|
|
832
|
-
},
|
|
833
|
-
},
|
|
834
|
-
{
|
|
835
|
-
name: "get_strategy_sessions",
|
|
836
|
-
description: "Get day-by-day session breakdown for a backtest instance. Returns one row per trading day with range levels and entry prices.",
|
|
837
|
-
inputSchema: {
|
|
838
|
-
type: "object",
|
|
839
|
-
properties: {
|
|
840
|
-
instanceId: { type: "string", description: "Instance ID" },
|
|
841
|
-
},
|
|
842
|
-
required: ["instanceId"],
|
|
843
|
-
},
|
|
844
|
-
},
|
|
845
|
-
// ── ACCT-DEL: Account deletion + orphan-trade management ─────────────
|
|
846
|
-
{
|
|
847
|
-
name: "delete_connection_account",
|
|
848
|
-
description: "Remove a broker sub-account (ConnectionAccount). Auto-removes the account from any signal groups. journalRetention='delete' hard-deletes the journal rows; journalRetention='keep' marks them as unlinked (retained_after_account_delete=true) so they survive in the journal without an FK.",
|
|
849
|
-
inputSchema: {
|
|
850
|
-
type: "object",
|
|
851
|
-
properties: {
|
|
852
|
-
connectionId: { type: "number", description: "BrokerConnection id" },
|
|
853
|
-
accountId: { type: "number", description: "ConnectionAccount id (the row id, not the broker accountSpec)" },
|
|
854
|
-
journalRetention: { type: "string", enum: ["keep", "delete"], description: "Whether to keep the account's journal rows as 'unlinked' or hard-delete them." },
|
|
855
|
-
},
|
|
856
|
-
required: ["connectionId", "accountId", "journalRetention"],
|
|
857
|
-
},
|
|
858
|
-
},
|
|
859
|
-
{
|
|
860
|
-
name: "get_orphaned_trades_count",
|
|
861
|
-
description: "Returns the number of journal trade rows retained from a deleted broker account. Use this to decide whether to surface the unlinked-trades UI / filter.",
|
|
862
|
-
inputSchema: { type: "object", properties: {}, required: [] },
|
|
863
|
-
},
|
|
864
|
-
{
|
|
865
|
-
name: "delete_orphaned_trades",
|
|
866
|
-
description: "Bulk-deletes journal trade rows that were retained when their broker account was removed. CSV-imported rows (which also have a null FK but retained=false) are preserved. Body must include {confirm:'DELETE'}.",
|
|
867
|
-
inputSchema: {
|
|
868
|
-
type: "object",
|
|
869
|
-
properties: {
|
|
870
|
-
confirm: { type: "string", enum: ["DELETE"], description: "Literal 'DELETE' confirmation." },
|
|
871
|
-
},
|
|
872
|
-
required: ["confirm"],
|
|
873
|
-
},
|
|
874
|
-
},
|
|
875
|
-
// ── TRD-08: Per-trade detail aggregation ─────────────────────────────
|
|
876
|
-
{
|
|
877
|
-
name: "get_trade",
|
|
878
|
-
description: "Get full per-trade detail for one journal trade ID: trade row, parent signal + raw payload, account block, group, execution timeline (sent → received → approved → entered with delta-from-prior-step), status log, broker call logs (Tradovate-only today; nullable note for other brokers), slippage (signalPrice nullable until TRD-05), and siblings array of other fan-out trades from the same signal. Read-only counterpart to inspect_signal — useful when you have a tradeId from get_journal_trades and want the full execution detail.",
|
|
879
|
-
inputSchema: {
|
|
880
|
-
type: "object",
|
|
881
|
-
properties: {
|
|
882
|
-
tradeId: { type: "number", description: "JournalTrade ID (from get_journal_trades or the URL of /trade-detail.html)" },
|
|
883
|
-
},
|
|
884
|
-
required: ["tradeId"],
|
|
885
|
-
},
|
|
886
|
-
},
|
|
887
|
-
{
|
|
888
|
-
name: "set_account_delete_pref",
|
|
889
|
-
description: "Set the user's default journal-retention behavior when deleting a broker account. true (default) = delete journal data alongside the account; false = keep as unlinked. The remove-account modal still lets the user override per deletion.",
|
|
890
|
-
inputSchema: {
|
|
891
|
-
type: "object",
|
|
892
|
-
properties: {
|
|
893
|
-
autoDeleteJournalOnAccountDelete: { type: "boolean", description: "true = delete journal data by default; false = keep as unlinked by default" },
|
|
894
|
-
},
|
|
895
|
-
required: ["autoDeleteJournalOnAccountDelete"],
|
|
896
|
-
},
|
|
897
|
-
},
|
|
898
|
-
// LATPROOF-S3: public latency summary
|
|
899
|
-
{
|
|
900
|
-
name: "get_latency_summary",
|
|
901
|
-
description: "Get the VP signal-routing latency rollup — p50/p95/p99 per broker (Tradovate, Rithmic, ProjectX, DxTrade, Interactive Brokers), per time window (7d, 24h), per pipeline stage (edge_ms, ingress_ms, validation_ms, persist_ms, account_resolve_ms, broker_call_sent_ms, total_ingress_wire_ms). Public endpoint; returns 404 when feature.latency-display is disabled.",
|
|
902
|
-
inputSchema: {
|
|
903
|
-
type: "object",
|
|
904
|
-
properties: {},
|
|
905
|
-
required: [],
|
|
906
|
-
},
|
|
907
|
-
},
|
|
908
|
-
// IPALLOW-05: IP allowlist admin tools
|
|
909
|
-
{
|
|
910
|
-
name: "get_ip_allowlist",
|
|
911
|
-
description: "IPALLOW-05 — admin-only. List all CIDR entries on a signal group's webhook IP allowlist. " +
|
|
912
|
-
"When the list is empty, all source IPs are allowed. When non-empty, only requests " +
|
|
913
|
-
"arriving with a CF-Connecting-IP header whose address matches at least one CIDR are " +
|
|
914
|
-
"forwarded; all others receive 403 ip_not_allowed and an audit row is written. " +
|
|
915
|
-
"Returns each entry's id, cidr, label, createdAt, and the email of the admin who added it.",
|
|
916
|
-
inputSchema: {
|
|
917
|
-
type: "object",
|
|
918
|
-
properties: {
|
|
919
|
-
groupId: {
|
|
920
|
-
type: "integer",
|
|
921
|
-
description: "The SignalGroup.Id to inspect.",
|
|
922
|
-
},
|
|
923
|
-
},
|
|
924
|
-
required: ["groupId"],
|
|
925
|
-
},
|
|
926
|
-
},
|
|
927
|
-
{
|
|
928
|
-
name: "manage_ip_allowlist",
|
|
929
|
-
description: "IPALLOW-05 — admin-only. Add or remove a CIDR entry from a signal group's webhook IP allowlist. " +
|
|
930
|
-
"action='add': requires cidr (e.g. '52.89.214.238/32') and optional label. " +
|
|
931
|
-
"Returns 400 if the CIDR is malformed, 409 if that exact CIDR is already listed. " +
|
|
932
|
-
"action='remove': requires entryId (the id from get_ip_allowlist). Returns 404 if the " +
|
|
933
|
-
"entry doesn't exist or belongs to a different group. " +
|
|
934
|
-
"Both actions write an audit row (ip_allowlist_entry_added / ip_allowlist_entry_removed) " +
|
|
935
|
-
"and immediately invalidate the in-process cache so enforcement takes effect on the next request.",
|
|
936
|
-
inputSchema: {
|
|
937
|
-
type: "object",
|
|
938
|
-
properties: {
|
|
939
|
-
action: {
|
|
940
|
-
type: "string",
|
|
941
|
-
enum: ["add", "remove"],
|
|
942
|
-
description: "'add' to insert a new CIDR, 'remove' to delete an existing entry.",
|
|
943
|
-
},
|
|
944
|
-
groupId: {
|
|
945
|
-
type: "integer",
|
|
946
|
-
description: "The SignalGroup.Id to modify.",
|
|
947
|
-
},
|
|
948
|
-
cidr: {
|
|
949
|
-
type: "string",
|
|
950
|
-
description: "CIDR notation (e.g. '10.0.0.0/8'). Required for action='add'.",
|
|
951
|
-
},
|
|
952
|
-
label: {
|
|
953
|
-
type: "string",
|
|
954
|
-
description: "Human-readable label (e.g. 'TradingView', 'Office'). Optional for action='add'.",
|
|
955
|
-
},
|
|
956
|
-
entryId: {
|
|
957
|
-
type: "integer",
|
|
958
|
-
description: "The WebhookIpAllowlist.Id to delete. Required for action='remove'.",
|
|
959
|
-
},
|
|
960
|
-
},
|
|
961
|
-
required: ["action", "groupId"],
|
|
962
|
-
},
|
|
963
|
-
},
|
|
964
|
-
// ADMINCANARY-04: canary config read
|
|
965
|
-
{
|
|
966
|
-
name: "get_canary_config",
|
|
967
|
-
description: "ADMINCANARY-04 — admin-only. Read the canary_config singleton: enabled state, " +
|
|
968
|
-
"probe period (1/5/15/30 min), skipClosedHours flag, and who last updated it. " +
|
|
969
|
-
"Use before modifying canary settings via the admin UI, or to verify the Worker " +
|
|
970
|
-
"is reading the correct period after a config change.",
|
|
971
|
-
inputSchema: { type: "object", properties: {}, required: [] },
|
|
972
|
-
},
|
|
973
|
-
// CTPC-05-S1: per-contract config CRUD + roll + leader/follower
|
|
974
|
-
{
|
|
975
|
-
name: "list_contract_configs",
|
|
976
|
-
description: "CTPC — List all per-contract configs for a signal group. Returns id, symbolRoot, and " +
|
|
977
|
-
"whether the config is soft-deleted. Use configId from this result for update/delete/roll/leader calls.",
|
|
978
|
-
inputSchema: {
|
|
979
|
-
type: "object",
|
|
980
|
-
properties: {
|
|
981
|
-
groupId: { type: "integer", description: "Signal group ID." },
|
|
982
|
-
},
|
|
983
|
-
required: ["groupId"],
|
|
984
|
-
},
|
|
985
|
-
},
|
|
986
|
-
{
|
|
987
|
-
name: "create_contract_config",
|
|
988
|
-
description: "CTPC — Create a new per-contract config in a signal group. Specify a symbolRoot " +
|
|
989
|
-
"(e.g. 'MES', 'MNQ') to scope a leader/follower membership partition to that contract family. " +
|
|
990
|
-
"Requires the feature.copy-trading-per-contract flag to be enabled for the account.",
|
|
991
|
-
inputSchema: {
|
|
992
|
-
type: "object",
|
|
993
|
-
properties: {
|
|
994
|
-
groupId: { type: "integer", description: "Signal group ID." },
|
|
995
|
-
symbolRoot: { type: "string", description: "Contract family root symbol, e.g. 'MES', 'MNQ'." },
|
|
996
|
-
},
|
|
997
|
-
required: ["groupId", "symbolRoot"],
|
|
998
|
-
},
|
|
999
|
-
},
|
|
1000
|
-
{
|
|
1001
|
-
name: "update_contract_config",
|
|
1002
|
-
description: "CTPC — Update a per-contract config's symbolRoot. Only supplied fields are patched.",
|
|
1003
|
-
inputSchema: {
|
|
1004
|
-
type: "object",
|
|
1005
|
-
properties: {
|
|
1006
|
-
groupId: { type: "integer", description: "Signal group ID." },
|
|
1007
|
-
configId: { type: "integer", description: "Contract config ID (from list_contract_configs)." },
|
|
1008
|
-
symbolRoot: { type: "string", description: "New contract family root symbol." },
|
|
1009
|
-
},
|
|
1010
|
-
required: ["groupId", "configId"],
|
|
1011
|
-
},
|
|
1012
|
-
},
|
|
1013
|
-
{
|
|
1014
|
-
name: "delete_contract_config",
|
|
1015
|
-
description: "CTPC — Soft-delete a per-contract config. Existing memberships are retained but the " +
|
|
1016
|
-
"config is marked deleted and no longer accepts new account assignments.",
|
|
1017
|
-
inputSchema: {
|
|
1018
|
-
type: "object",
|
|
1019
|
-
properties: {
|
|
1020
|
-
groupId: { type: "integer", description: "Signal group ID." },
|
|
1021
|
-
configId: { type: "integer", description: "Contract config ID to delete." },
|
|
1022
|
-
},
|
|
1023
|
-
required: ["groupId", "configId"],
|
|
1024
|
-
},
|
|
1025
|
-
},
|
|
1026
|
-
{
|
|
1027
|
-
name: "roll_contract_config",
|
|
1028
|
-
description: "CTPC — Roll the active symbol on a contract config to a new expiry (e.g. MESM6 → MESU6). " +
|
|
1029
|
-
"Provide expectedCurrentSymbol to guard against concurrent rolls (returns 409 if the current " +
|
|
1030
|
-
"symbol does not match). The new symbol is uppercased automatically.",
|
|
1031
|
-
inputSchema: {
|
|
1032
|
-
type: "object",
|
|
1033
|
-
properties: {
|
|
1034
|
-
groupId: { type: "integer", description: "Signal group ID." },
|
|
1035
|
-
configId: { type: "integer", description: "Contract config ID to roll." },
|
|
1036
|
-
newSymbol: { type: "string", description: "Target contract symbol, e.g. 'MESU6'." },
|
|
1037
|
-
expectedCurrentSymbol: {
|
|
1038
|
-
type: "string",
|
|
1039
|
-
description: "Optional optimistic-lock guard. If supplied and current symbol differs, the server returns 409.",
|
|
1040
|
-
},
|
|
1041
|
-
},
|
|
1042
|
-
required: ["groupId", "configId", "newSymbol"],
|
|
1043
|
-
},
|
|
1044
|
-
},
|
|
1045
|
-
{
|
|
1046
|
-
name: "set_contract_config_leader",
|
|
1047
|
-
description: "CTPC — Promote an account to copy-trading leader within a specific contract config. " +
|
|
1048
|
-
"The prior leader in this config is auto-demoted; accounts in other configs are unaffected. " +
|
|
1049
|
-
"Returns the updated account-membership row.",
|
|
1050
|
-
inputSchema: {
|
|
1051
|
-
type: "object",
|
|
1052
|
-
properties: {
|
|
1053
|
-
groupId: { type: "integer", description: "Signal group ID." },
|
|
1054
|
-
configId: { type: "integer", description: "Contract config ID." },
|
|
1055
|
-
accountId: { type: "integer", description: "Account ID to promote as leader." },
|
|
1056
|
-
},
|
|
1057
|
-
required: ["groupId", "configId", "accountId"],
|
|
1058
|
-
},
|
|
1059
|
-
},
|
|
1060
|
-
{
|
|
1061
|
-
name: "update_contract_config_follower",
|
|
1062
|
-
description: "CTPC — Update per-follower settings (quantityMultiplier, respectAccountHalt) for an " +
|
|
1063
|
-
"account within a specific contract config. At least one field must be supplied.",
|
|
1064
|
-
inputSchema: {
|
|
1065
|
-
type: "object",
|
|
1066
|
-
properties: {
|
|
1067
|
-
groupId: { type: "integer", description: "Signal group ID." },
|
|
1068
|
-
configId: { type: "integer", description: "Contract config ID." },
|
|
1069
|
-
accountId: { type: "integer", description: "Follower account ID." },
|
|
1070
|
-
quantityMultiplier: {
|
|
1071
|
-
type: "number",
|
|
1072
|
-
description: "Quantity scaling factor applied to leader fills (e.g. 0.5 = half size).",
|
|
1073
|
-
},
|
|
1074
|
-
respectAccountHalt: {
|
|
1075
|
-
type: "boolean",
|
|
1076
|
-
description: "When true, signals are blocked for this follower if its account is halted.",
|
|
1077
|
-
},
|
|
1078
|
-
},
|
|
1079
|
-
required: ["groupId", "configId", "accountId"],
|
|
1080
|
-
},
|
|
1081
|
-
},
|
|
1082
|
-
],
|
|
1083
|
-
}));
|
|
1084
|
-
server.setRequestHandler(CallToolRequestSchema, async (req) => {
|
|
1085
|
-
const input = (req.params.arguments ?? {});
|
|
1086
|
-
switch (req.params.name) {
|
|
1087
|
-
case "ping_vantage": return pingVantage(client);
|
|
1088
|
-
case "list_groups": return listGroups(client, resolver, input);
|
|
1089
|
-
case "update_group": return updateGroup(client, resolver, input);
|
|
1090
|
-
case "get_group_state": return getGroupState(client, resolver, input);
|
|
1091
|
-
case "check_connections": return checkConnections(client, resolver, input);
|
|
1092
|
-
case "get_signal_history": return getSignalHistory(client, resolver, input);
|
|
1093
|
-
case "inspect_signal": return inspectSignal(client, resolver, input);
|
|
1094
|
-
// MSIG-02: Signal templates
|
|
1095
|
-
case "list_signal_templates": return listSignalTemplates(client, resolver, input);
|
|
1096
|
-
case "create_signal_template": return createSignalTemplate(client, resolver, input);
|
|
1097
|
-
case "update_signal_template": return updateSignalTemplate(client, resolver, input);
|
|
1098
|
-
case "delete_signal_template": return deleteSignalTemplate(client, resolver, input);
|
|
1099
|
-
case "send_signal": return sendSignal(client, resolver, input);
|
|
1100
|
-
case "cancel_orders": return cancelOrders(client, resolver, input);
|
|
1101
|
-
case "exit_positions": return exitPositions(client, resolver, input);
|
|
1102
|
-
case "flatten_group": return flattenGroup(client, resolver, input);
|
|
1103
|
-
case "send_magic_link": return sendMagicLink(client, resolver, input);
|
|
1104
|
-
// AGNT-06: Journal
|
|
1105
|
-
case "get_journal_trades": return getJournalTrades(client, resolver, input);
|
|
1106
|
-
case "get_journal_dashboard": return getJournalDashboard(client, resolver, input);
|
|
1107
|
-
case "get_journal_entries": return getJournalEntries(client, resolver, input);
|
|
1108
|
-
case "add_journal_entry": return addJournalEntry(client, resolver, input);
|
|
1109
|
-
// AGNT-06: Calendar
|
|
1110
|
-
case "get_economic_events": return getEconomicEvents(client, resolver, input);
|
|
1111
|
-
case "get_economic_events_month": return getEconomicEventsMonth(client, resolver, input);
|
|
1112
|
-
// BUG-banner-market-closed
|
|
1113
|
-
case "get_market_hours": return getMarketHours(client, resolver, input);
|
|
1114
|
-
// RISK: Risk Management
|
|
1115
|
-
case "get_risk": return getRisk(client, resolver, input);
|
|
1116
|
-
case "get_risk_halts": return getRiskHalts(client, resolver, input);
|
|
1117
|
-
case "reenable_risk_halt": return reenableRiskHalt(client, resolver, input);
|
|
1118
|
-
// CT-01-S5
|
|
1119
|
-
case "set_copier_settings": return setCopierSettings(client, resolver, input);
|
|
1120
|
-
// ACCT-HEALTH PR-4
|
|
1121
|
-
case "get_account_health": return getAccountHealth(client, resolver, input);
|
|
1122
|
-
case "set_account_health_override": return setAccountHealthOverride(client, resolver, input);
|
|
1123
|
-
case "sync_connection_accounts": return syncConnectionAccounts(client, resolver, input);
|
|
1124
|
-
// AGNT-07: Account
|
|
1125
|
-
case "get_balance": return getBalance(client, resolver, input);
|
|
1126
|
-
case "get_positions": return getPositions(client, resolver, input);
|
|
1127
|
-
case "get_order_history": return getOrderHistory(client, resolver, input);
|
|
1128
|
-
case "get_broker_order_history": return getBrokerOrderHistory(client, resolver, input);
|
|
1129
|
-
case "get_market_price": return getMarketPrice(client, resolver, input);
|
|
1130
|
-
case "get_alerts": return getAlerts(client, resolver, input);
|
|
1131
|
-
case "ack_alert": return ackAlert(client, resolver, input);
|
|
1132
|
-
case "get_signal_broker_logs": return getSignalBrokerLogs(client, resolver, input);
|
|
1133
|
-
// BILL-8a: Billing
|
|
1134
|
-
case "get_billing": return getBilling(client, resolver, input);
|
|
1135
|
-
case "get_billing_portal": return getBillingPortal(client, resolver, input);
|
|
1136
|
-
// AGNT-08: QC Algorithms
|
|
1137
|
-
case "list_qc_algorithms": return listQcAlgorithms(client, resolver, input);
|
|
1138
|
-
case "get_qc_algorithm": return getQcAlgorithm(client, resolver, input);
|
|
1139
|
-
case "get_algorithm_file": return getAlgorithmFile(client, resolver, input);
|
|
1140
|
-
case "create_qc_algorithm": return createQcAlgorithm(client, resolver, input);
|
|
1141
|
-
case "update_qc_algorithm": return updateQcAlgorithm(client, resolver, input);
|
|
1142
|
-
// AGNT-08: Strategy Instances
|
|
1143
|
-
case "list_strategy_instances": return listStrategyInstances(client, resolver, input);
|
|
1144
|
-
case "get_strategy_instance": return getStrategyInstance(client, resolver, input);
|
|
1145
|
-
case "launch_strategy": return launchStrategy(client, resolver, input);
|
|
1146
|
-
case "launch_group": return launchGroup(client, resolver, input);
|
|
1147
|
-
case "stop_strategy": return stopStrategy(client, resolver, input);
|
|
1148
|
-
case "stop_group": return stopGroup(client, resolver, input);
|
|
1149
|
-
case "get_strategy_logs": return getStrategyLogs(client, resolver, input);
|
|
1150
|
-
case "get_strategy_stats": return getStrategyStats(client, resolver, input);
|
|
1151
|
-
case "get_strategy_orders": return getStrategyOrders(client, resolver, input);
|
|
1152
|
-
case "get_strategy_trades": return getStrategyTrades(client, resolver, input);
|
|
1153
|
-
case "get_strategy_sessions": return getStrategySessions(client, resolver, input);
|
|
1154
|
-
// ACCT-DEL: Account deletion + orphan trades
|
|
1155
|
-
case "delete_connection_account": return deleteConnectionAccount(client, resolver, input);
|
|
1156
|
-
case "get_orphaned_trades_count": return getOrphanedTradesCount(client, resolver, input);
|
|
1157
|
-
case "delete_orphaned_trades": return deleteOrphanedTrades(client, resolver, input);
|
|
1158
|
-
case "set_account_delete_pref": return setAccountDeletePref(client, resolver, input);
|
|
1159
|
-
// TRD-08: Per-trade detail
|
|
1160
|
-
case "get_trade": return getTrade(client, resolver, input);
|
|
1161
|
-
// LATPROOF-S3: public latency summary
|
|
1162
|
-
case "get_latency_summary": return getLatencySummary(client, resolver, input);
|
|
1163
|
-
// IPALLOW-05: IP allowlist admin
|
|
1164
|
-
case "get_ip_allowlist": return getIpAllowlist(client, resolver, input);
|
|
1165
|
-
case "manage_ip_allowlist": return manageIpAllowlist(client, resolver, input);
|
|
1166
|
-
// ADMINCANARY-04: canary config read
|
|
1167
|
-
case "get_canary_config": return getCanaryConfig(client, resolver, input);
|
|
1168
|
-
// CTPC-05-S1: per-contract config CRUD + roll + leader/follower
|
|
1169
|
-
case "list_contract_configs": return listContractConfigs(client, resolver, input);
|
|
1170
|
-
case "create_contract_config": return createContractConfig(client, resolver, input);
|
|
1171
|
-
case "update_contract_config": return updateContractConfig(client, resolver, input);
|
|
1172
|
-
case "delete_contract_config": return deleteContractConfig(client, resolver, input);
|
|
1173
|
-
case "roll_contract_config": return rollContractConfig(client, resolver, input);
|
|
1174
|
-
case "set_contract_config_leader": return setContractConfigLeader(client, resolver, input);
|
|
1175
|
-
case "update_contract_config_follower": return updateContractConfigFollower(client, resolver, input);
|
|
1176
|
-
default:
|
|
1177
|
-
return {
|
|
1178
|
-
content: [{ type: "text", text: `Unknown tool: ${req.params.name}` }],
|
|
1179
|
-
isError: true,
|
|
1180
|
-
};
|
|
1181
|
-
}
|
|
1182
|
-
});
|
|
1183
|
-
const transport = new StdioServerTransport();
|
|
1184
|
-
await server.connect(transport);
|
|
1185
|
-
//# sourceMappingURL=index.js.map
|