@coinrithm/mcp-trading 0.7.11 → 0.7.12

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/CHANGELOG.md CHANGED
@@ -5,6 +5,21 @@ ships two binaries — `coinrithm-mcp` (the MCP server) and `coinrithm-agent` (t
5
5
  self-host agent runner) — versioned together. The CoinRithm **API contract** is
6
6
  versioned separately (see `openapi.yaml` `info.version`, currently `1.7.0`).
7
7
 
8
+ ## 0.7.12 — 2026-09-15
9
+
10
+ Clarify `whoami`, `cancel_spot_order` and `report_pm_opportunity` descriptions,
11
+ removing execution-cost prose unrelated to these operations. Document actual
12
+ authentication, side effects, result fields and retry behavior.
13
+
14
+ Spot cancellation now advertises its existing idempotent behavior. Opportunity
15
+ reporting no longer advertises unconditional idempotency: duplicate protection
16
+ requires `decisionId` (or `agentTrace.decisionId`) under the same API key; the
17
+ first stored record wins. Reporting remains a write despite requiring only the
18
+ `read` scope, and its evidence remains explicitly self-reported.
19
+
20
+ Tool names, accepted inputs and execution behavior are unchanged. This source
21
+ entry does not establish registry publication, deployment or a new Glama score.
22
+
8
23
  ## 0.7.11 — 2026-09-15
9
24
 
10
25
  Fix opportunity reporting that previously treated resolved API failures as
package/README.md CHANGED
@@ -42,16 +42,15 @@ This package ships two binaries:
42
42
 
43
43
  > **Paper trading only** — virtual funds (50,000 mUSD). Not financial advice.
44
44
 
45
- ## Version 0.7.11
46
-
47
- This patch corrects opportunity-report status: only a successful API result
48
- confirms submission. HTTP errors remain unconfirmed, and transport failures
49
- have an unknown outcome. Attempt evidence is available in
50
- `CycleResult.opportunityReport`; `opportunity` contains confirmed reports only.
51
- Trading behavior and the one-report-method-call-per-cycle limit are preserved. See
52
- [CHANGELOG.md](./CHANGELOG.md). Check `npm view @coinrithm/mcp-trading
53
- version` for the latest published version. Hosted deployments and npm releases
54
- are separate.
45
+ ## Version 0.7.12
46
+
47
+ This patch clarifies `whoami`, `cancel_spot_order` and `report_pm_opportunity`
48
+ for MCP clients. Cancellation is marked safe to repeat; opportunity reporting
49
+ is a write whose duplicate protection requires a decision ID. Tool names,
50
+ accepted inputs and execution behavior are unchanged. See [CHANGELOG.md](./CHANGELOG.md).
51
+ This source entry does not establish publication. Check
52
+ `npm view @coinrithm/mcp-trading version` for the latest published version;
53
+ hosted deployments and npm releases are separate.
55
54
 
56
55
  Runner API operations have a 30-second total deadline, including response
57
56
  bodies and 429 retry waits. Timeout and cancellation results remain unconfirmed;
package/dist/tools.js CHANGED
@@ -604,12 +604,14 @@ export function registerTools(server, client) {
604
604
  // ---------------- identity ----------------
605
605
  server.registerTool("whoami", {
606
606
  title: "Who am I (CoinRithm)",
607
- description: "Return the identity behind the configured API key: userId, keyId, " +
608
- "granted scopes, plus the key's agentName and agentModel (both null " +
609
- "until set in Profile -> API Keys; agentModel is the self-reported " +
610
- "model/runtime label shown on the public Agent Arena when opted in). " +
611
- "Use this first to confirm what the key is allowed to do. " +
612
- PAPER_NOTE,
607
+ description: "Check the caller's CoinRithm API-key identity and permissions before " +
608
+ "using account or trading tools. Returns userId, keyId, scopes, usage, " +
609
+ "and nullable agentName/agentModel labels; agentModel is self-reported, " +
610
+ "not verified runtime identity. Any valid configured or per-request key " +
611
+ "works; no additional scope is required. Missing or invalid keys return " +
612
+ "401. Omit agentTrace for a simple check. Does not change permissions " +
613
+ "or paper balances; requests update usage/last-used metadata and may " +
614
+ "be privately logged.",
613
615
  inputSchema: {
614
616
  agentTrace: AGENT_TRACE_SCHEMA,
615
617
  },
@@ -1176,16 +1178,26 @@ export function registerTools(server, client) {
1176
1178
  }, requestKey(extra))));
1177
1179
  server.registerTool("cancel_spot_order", {
1178
1180
  title: "Cancel spot order",
1179
- description: "Cancel an open spot order by id (releases frozen funds). Requires the " +
1180
- "trade:spot scope. " +
1181
- PAPER_NOTE,
1181
+ description: "Cancel the unfilled remainder of your paper spot order and release " +
1182
+ "its reserved funds. Requires trade:spot scope; get orderId from " +
1183
+ "list_open_orders. Does not reverse filled trades. Safe to repeat with " +
1184
+ "the same orderId: an order not open under your key returns " +
1185
+ "body.alreadyClosed=true, which does not distinguish a fill from an " +
1186
+ "earlier cancellation or an unknown order. Use get_my_trades to check " +
1187
+ "fills. API failures return ok=false and httpStatus; on 429, respect " +
1188
+ "retryAfterSeconds when provided.",
1182
1189
  inputSchema: {
1183
- orderId: z.number().int().positive().describe("Open order id."),
1190
+ orderId: z
1191
+ .number()
1192
+ .int()
1193
+ .positive()
1194
+ .describe("Your paper spot order id from list_open_orders."),
1184
1195
  agentTrace: AGENT_TRACE_SCHEMA,
1185
1196
  },
1186
1197
  outputSchema: API_RESULT_OUTPUT_SCHEMA,
1187
1198
  annotations: mutatingAnnotations("Cancel spot order", {
1188
1199
  destructive: true,
1200
+ idempotent: true,
1189
1201
  }),
1190
1202
  }, async ({ orderId, agentTrace }, extra) => present(await client.cancelSpotOrder(orderId, requestKey(extra), agentTrace)));
1191
1203
  server.registerTool("open_futures_position", {
@@ -1375,21 +1387,19 @@ export function registerTools(server, client) {
1375
1387
  }, requestKey(extra))));
1376
1388
  server.registerTool("report_pm_opportunity", {
1377
1389
  title: "Report a non-opened PM opportunity",
1378
- description: "Report a prediction-market opportunity you evaluated but did NOT open, so " +
1379
- "your PUBLIC evaluation reflects the FULL opportunity universe — not only " +
1380
- "the trades you took (otherwise an agent can look skilled by exposure " +
1381
- "choice alone). kind is one of: 'abstained' (you looked at markets and " +
1382
- "chose not to bet), 'forecast_only' (you formed your OWN probability but " +
1383
- "did not trade — forecastProbability is REQUIRED, 1-99), or 'quote_expired' " +
1384
- "(a bet you validated was rejected at open because the market moved). This " +
1385
- "is EVIDENCE, not a trade: it needs only the read scope, never moves funds, " +
1386
- "and is recorded as a durable, hashed decision artifact. It is a " +
1387
- "SELF-REPORT — CoinRithm records what you assert about your own reasoning; " +
1388
- "it does not independently verify that you truly evaluated the market. Put " +
1389
- "the breadth of what you weighed in cohort.universeSize (how many markets) " +
1390
- "and report ONCE per decision cycle, not once per market. Reuse decisionId " +
1391
- "to make a retry idempotent. " +
1392
- PAPER_NOTE,
1390
+ description: "Save a durable SELF-REPORT of a prediction-market evaluation for a " +
1391
+ "decision that did not open a position. This WRITES an evidence record " +
1392
+ "but never moves paper funds; authorization requires the read scope. " +
1393
+ "It does not independently verify your evaluation. Choose abstained, " +
1394
+ "forecast_only (requires your own forecastProbability, 1-99), or " +
1395
+ "quote_expired. Report once per decision cycle; cohort.universeSize " +
1396
+ "records its breadth. Supply a non-empty decisionId and reuse it with " +
1397
+ "the same API key on retries: the first stored record wins. " +
1398
+ "agentTrace.decisionId is a fallback; omitting both creates separate " +
1399
+ "records. Success returns " +
1400
+ "body.decisionUuid and, on replay, body.idempotentReplay=true. Check " +
1401
+ "ok/httpStatus before treating delivery as confirmed; a network error " +
1402
+ "does not prove rejection. Use open_pm_position to place a paper trade.",
1393
1403
  inputSchema: {
1394
1404
  kind: z
1395
1405
  .enum(["abstained", "forecast_only", "quote_expired"])
@@ -1410,8 +1420,8 @@ export function registerTools(server, client) {
1410
1420
  .min(1)
1411
1421
  .max(99)
1412
1422
  .optional()
1413
- .describe("Your OWN probability (1-99) the chosen side wins. REQUIRED for " +
1414
- "forecast_only; omit for the other kinds. Never echo the market price."),
1423
+ .describe("Your OWN forecast probability (1-99). REQUIRED for forecast_only; " +
1424
+ "optional for other kinds. Never echo the market price."),
1415
1425
  marketProbability: z
1416
1426
  .number()
1417
1427
  .min(0)
@@ -1442,15 +1452,17 @@ export function registerTools(server, client) {
1442
1452
  decisionId: z
1443
1453
  .string()
1444
1454
  .optional()
1445
- .describe("Your own id for this decision — idempotency key within your API key."),
1455
+ .describe("Non-empty id for this decision, unique within your API key. " +
1456
+ "Reuse for retries. Falls back to agentTrace.decisionId; " +
1457
+ "omitting both creates a new record on each call."),
1446
1458
  runId: z.string().optional().describe("Your own run id for grouping."),
1447
1459
  provenance: PROVENANCE_REPORT_SCHEMA,
1448
1460
  agentTrace: AGENT_TRACE_SCHEMA,
1449
1461
  },
1450
1462
  outputSchema: API_RESULT_OUTPUT_SCHEMA,
1451
- annotations: mutatingAnnotations("Report a non-opened PM opportunity", {
1452
- idempotent: true,
1453
- }),
1463
+ // Idempotency is conditional on decisionId; it is not a safe default
1464
+ // for the entire tool because the field remains optional.
1465
+ annotations: mutatingAnnotations("Report a non-opened PM opportunity"),
1454
1466
  }, async ({ kind, source, slug, outcomeExternalMarketId, forecastProbability, marketProbability, reasonCode, cohort, decisionId, runId, provenance, agentTrace, }, extra) => present(await client.reportPmOpportunity({
1455
1467
  kind,
1456
1468
  source,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coinrithm/mcp-trading",
3
- "version": "0.7.11",
3
+ "version": "0.7.12",
4
4
  "mcpName": "io.github.CoinRithm/mcp-trading",
5
5
  "description": "CoinRithm paper-trading toolkit: an MCP server (coinrithm-mcp) AND a self-host agent runner (coinrithm-agent) for spot, futures, and prediction markets with a user-minted API key.",
6
6
  "type": "module",