@battlegrid/mcp-server 31.2.5 → 31.2.6

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/README.md CHANGED
@@ -874,22 +874,30 @@ Install the BattleGrid skills for AI agent instructions:
874
874
  npx skills add playbattlegrid/battlegrid-mcp
875
875
  ```
876
876
 
877
- Two skills ship from this repo, and both are inside the npm tarball (`SKILL.md`, `skills/`):
878
-
879
- - **`battlegrid`** — connection, scopes, game play, and the strict compile → review → apply
880
- strategy workflow.
881
- - **`battlegrid-strategy-studio`** — full-power strategy authoring, for agents that would
882
- otherwise compile bare template strategies: custom report sections and system-generated header
883
- grammar, benchmark sections, condition trees (verdict precedence, `required` enforcement
884
- gates, `N_OF`/`NOT` groups, condition references), tiered signal weights and the
885
- weighted-aggregate gate math, ATR trade levels, and post-entry position management. Its
886
- `references/` carry five validated desk-grade playbooks (volatility-compression breakout,
887
- crowded-positioning fade, benchmark-gated relative-strength rotation, HTF trend pullback,
888
- perp/spot flow divergence at structure), copy-adaptable recipes, and process-for-process
889
- ports of the most popular TradingView community scripts (Squeeze Momentum [LazyBear],
890
- Supertrend/UT Bot, Chandelier Exit, MACD + 200 MA, golden cross, RSI-2, VWAP reversion,
891
- Donchian/Turtle, ICT FVG/order blocks) with honest named substitutions where the grammar
892
- lacks a primitive. Shapes are binding; vocabulary stays live-discovered.
877
+ Nine skills ship from this repo, all inside the npm tarball (`SKILL.md`, `skills/`).
878
+
879
+ **`battlegrid`** (repo root) is the connection skill and is authored here: how to connect, the
880
+ `{ account, request }` envelope, the two scopes, and where to go for everything else.
881
+
882
+ The eight `skills/battlegrid-*` are **exported from BattleGrid's server repository** — they are the
883
+ same instructions BattleGrid's own in-app Commander runs on, which is why they name the same tools
884
+ you reach over MCP:
885
+
886
+ | Skill | Teaches |
887
+ |---|---|
888
+ | `battlegrid-agent-management` | Commission and govern intelligence agents: interview and create one against a committed strategy and an approved model, change configuration and risk limits, rebind, halt, resume, archive, and act on live positions |
889
+ | `battlegrid-arena-play` | Enter Market Grid sessions: find an open session, read its coin pool and live market context, compose a grid with real per-coin reasoning or have an agent generate it, submit, then read results and the reasoning journal |
890
+ | `battlegrid-market-analysis` | Read the current crypto market — regime, funding and open interest, leaders and laggards, a deep-dive on any named coin — and close with the levels worth watching |
891
+ | `battlegrid-radar-deployment` | Put agents on standing duty: per-coin Radar policies that fire on confirmed regime flips, and per-preset Arena deployment policies, previewed before they are written and un-deployed with the blast radius stated |
892
+ | `battlegrid-strategy-authoring` | Build a strategy from a plain-English idea: gather evidence, lock the spec, compile against the platform grammar, review exactly what will run, apply only on confirmation. Also fork, tune, restore, archive, preview |
893
+ | `battlegrid-strategy-doctor` | Diagnose an agent that is not doing what was expected — why it has not traded, why it stopped, whether it is healthy — from typed fields, then rank the fixes with the exact lever each needs |
894
+ | `battlegrid-strategy-examples` | Full-surface composition patterns: custom report sections and header grammar, benchmark sections, condition trees with verdicts and enforcement gates, tiered signal weights and the aggregate gate math, routing gates, ATR trade levels, position management, plus validated desk-grade playbooks and TradingView process ports |
895
+ | `battlegrid-trade-analysis` | Read your own trading position: where the money is, whether each agent is doing its job, what is open and how close it sits to its protections, and whether the automation is actually running |
896
+
897
+ > **`skills/battlegrid-*` is generated — do not edit it here.** It is written by
898
+ > `server/scripts/export-mcp-skills.mjs` in `playbattlegrid/battlegrid-app` and arrives by pull
899
+ > request; `skills/EXPORT.json` records a hash per file and `src/__tests__/skill-provenance.test.ts`
900
+ > fails CI on a hand edit. Change the skill upstream and let the export lane bring it here.
893
901
 
894
902
  ## License
895
903
 
package/SKILL.md CHANGED
@@ -7,6 +7,26 @@ description: MCP skill for BattleGrid — play crypto prediction games (Market G
7
7
 
8
8
  BattleGrid is a real-time cryptocurrency prediction gaming and trading platform. This MCP server gives AI agents access to play games, author trading strategies, and run strategy-bound intelligence agents.
9
9
 
10
+ ## The other eight skills
11
+
12
+ This skill covers **connection**: how to reach BattleGrid, the request envelope, and what each scope
13
+ grants. Everything about *using* the platform lives in the eight skills installed beside it, exported
14
+ from BattleGrid's own server so they name exactly the tools you reach here:
15
+
16
+ | For | Activate |
17
+ |---|---|
18
+ | Playing Market Grid sessions | `battlegrid-arena-play` |
19
+ | Building or changing a strategy | `battlegrid-strategy-authoring` |
20
+ | Composing beyond a bare template — conditions, weights, gates, trade levels, playbooks | `battlegrid-strategy-examples` |
21
+ | Creating and governing intelligence agents | `battlegrid-agent-management` |
22
+ | Putting an agent on standing duty (Radar, Arena presets) | `battlegrid-radar-deployment` |
23
+ | Reading the market — regime, funding, leaders, a coin deep-dive | `battlegrid-market-analysis` |
24
+ | Reading your own position, agents, and open trades | `battlegrid-trade-analysis` |
25
+ | Working out why an agent has not traded or has stopped | `battlegrid-strategy-doctor` |
26
+
27
+ Those eight carry the working arcs and the exact contracts. What follows here is the minimum needed
28
+ to connect and to know which one to open.
29
+
10
30
  ## Discover the live surface first
11
31
 
12
32
  **Tools, prompts, and resources are discovered live from this MCP connection.** Always read the current `tools/list`, `prompts/list`, and `resources/list` before acting — a cached capability list is not authoritative after a server deployment. This skill teaches the workflows and the strict request contracts; it deliberately does not copy the server's tool catalog, metric/transform vocabulary, signal IDs, formulas, or default values. Discover those from the live tools (`list_strategy_categories`, `list_strategy_vocabulary`, `list_strategy_signals`, `get_strategy_signal_definition`, …). Never guess a metric, transform, parameter, template, signal, or enabled-timeframe fact.
@@ -25,70 +45,38 @@ Never put `account` inside `request`, and never flatten request fields beside it
25
45
  - `mcp:read` — strategy discovery **and** non-financial configuration writes (author strategies, edit agents, customize signals). Treat it as configuration authority, not view-only.
26
46
  - `mcp:wager` — financial actions (submit paid entries, accept/cancel entry decisions, deployment policies). Enable **Server-Signed Wagers** in Profile → MCP to grant it. Pending entry decisions come from the conversational surface, which waits for approval; an agent deployed to a radar coin or a trading-enabled arena slot executes without one.
27
47
 
28
- ## Author a strategy: compile → review → apply
29
-
30
- Strategies are authored through one strict, whole-plan workflow. **Compilation changes no strategy, agent or revision; `apply_strategy_plan` is the only write to the strategy itself** — but compile is not read-only either: it parks the plan its own apply reads, and each call mints a distinct record and token, so compile once per reviewed payload and never retry or parallelise it. Review the exact returned plan before confirming.
31
-
32
- 1. **Choose the operation and revision.**
33
- - `list_strategies({ includeInactive? })` — visible SYSTEM and owned PRIVATE strategies with lifecycle, quota, usage, and revisions. Use `includeInactive:true` to prepare a RESTORE.
34
- - `get_strategy({ strategyId, includeInactive? })` — the complete report, dense signal scorecard, gates, usage, and current `revision`. Thread every returned revision into the next revisioned call.
35
- 2. **Discover the report vocabulary progressively.**
36
- - `list_strategy_categories()` → `list_strategy_vocabulary({ category })` → `get_metric_construction_hints({ metric })` → `get_strategy_column_contract({ column, sectionTimeframe? })`.
37
- - `get_strategy_section_template({ request })` for a listed template; `preview_strategy_report(payload)` for a point-in-time rendered preview.
38
- 3. **Discover signals at the strategy timeframe.**
39
- - `list_strategy_signals({ module?, query? })` → `get_strategy_signal_definition({ signalId, timeframe })`. Availability is structural, not a promise of a live trigger.
40
- 4. **(Optional) review draft-only guidance.**
41
- - `derive_strategy_rule_view({ sections, rules? })` returns report perception, server defaults, and suggestions without reading or writing a strategy. Suggestions/resets only shape the next plan input; they persist only through `apply_strategy_plan`.
42
- 5. **Compile one complete plan.**
43
- - `compile_strategy_plan({ request })`, where the nested request contains exactly one strict branch plus a bounded `coinSelection`, `intentSummary`, and `assumptions`:
44
- - **CREATE** — supplies the full new aggregate.
45
- - **UPDATE** — supplies at least one changed axis and `expectedRevision`. **Send only the
46
- axes that change.** The server preserves every axis you omit and every signal you do not
47
- name, and it re-derives the complete post-state, scorecard and diff itself. Restating the
48
- whole post-state changes nothing about the result and the account pays for those tokens on
49
- this call and on every later step of the conversation. Three fields are *not* axes and are
50
- required on every compile regardless — `intentSummary`, `assumptions` and `coinSelection`;
51
- omitting one is a typed error, not a saving.
52
- - **RESTORE** — targets an owned inactive revision and may include repair axes.
53
- - Signal overrides are sparse: an omitted signal/axis stays unchanged; omitted `params` preserves canonical params byte-for-byte; present `params` replaces them only after strict validation.
54
- - **`required` needs a weight.** A rule with `required: true` at `allocation: 0` is rejected (contract 34): the scorecard's triggered set excludes Off, so the flag could satisfy no gate and block no trade. Either raise the allocation or leave `required: false` — the server picks neither for you. The refusal names every offending signal in `details.inertRequiredSignalIds`, and it can fire on rules you did not touch: a strategy authored before contract 34 may hold the pair, and the merged post-state is what gets checked.
55
- 6. **Review before confirming.**
56
- - `approvedPlan` — complete post-state, proposed revision, dense scorecard, viability, canonical diff, expiry, and bound-agent impact.
57
- - `reviewContext` — exact column contracts, point-in-time report preview and coin scope, open-position observation, and provisional quota/name admission (advisory until the write). Open positions are awareness only and do not block an edit.
58
- - The plan token expires after five minutes. Recompile after expiry, catalog drift, revision drift, or a changed bound-agent fence.
59
- 7. **Apply the plan the server already holds.**
60
- - After explicit user approval: `apply_strategy_plan({ request: { planToken, confirm: true } })`. **There is no `plan` member** — one is rejected as an unknown key. The server keeps the plan its own compile approved and reads it back, so nothing is copied from the compile response and nothing can be mistyped, truncated or half-reconstructed in transit.
61
- - Forward `planToken` byte-for-byte exactly as compile returned it. It is an opaque signed value: never retyped, paraphrased, abbreviated or rebuilt from memory. A mangled token addresses no approved plan and is refused.
62
- - Refusals and their recoveries: `PLAN_APPROVAL_NOT_FOUND` means no approved plan answers to this token — it was already applied, it lapsed, or it was never issued; compile again. `TOKEN_EXPIRED` means the five minutes ran out; compile again. Anything else — a quota, a name collision, a bound agent that changed, a moved catalog — **leaves the plan applicable**: clear the cause and confirm again with the same token while it lives.
63
- - Changed configuration reaches every bound agent immediately. Report the returned strategy, committed revision, changed axes and applied impact exactly as given, and use that returned revision for the next mutation.
64
-
65
- **Focused edits & lifecycle:** `update_strategy_signal_rule({ request })` is the thin one-rule edit (requires `required`; omit `params` to preserve them; `required: true` needs `allocation > 0`). `fork_strategy` requires `sourceRevision`; `archive_strategy` requires `expectedRevision` and `confirm:true`; `restore_strategy` is only the thin unchanged-content path — if it reports `REPAIR_REQUIRED`, use the RESTORE compile/review/apply flow instead.
66
-
67
- **Author the full surface, not a template.** A bare compile — a few platform sections, no conditions, untouched signal weights — uses a fraction of the studio: the strategy aggregate also owns typed conditions (verdicts + `required` enforcement gates), tiered signal allocations with per-signal params, routing gates (`minAggregateScore`, `minRequiredCount`, `minAtrPct`), the ATR stop band + risk-reward floor, post-entry position management (break-even / trailing / time-decay), and marker-bearing Market Read prose. The companion **`battlegrid-strategy-studio` skill** (shipped beside this one) carries the capability map plus validated desk-grade playbooks and recipes for all of it — activate it whenever a strategy is being created or upgraded.
68
-
69
- ## Strategy-bound agents
70
-
71
- Bind a strategy to an agent at creation time — there is no direct strategy-creation tool.
72
-
73
- 1. `list_approved_models()` — valid `modelId` values for agent creation/update.
74
- 2. `list_strategies()` — pick the `strategyId` to bind.
75
- 3. `create_intelligence_agent({ …, modelId, strategyId })` — create a strategy-bound agent (avatar is server-minted).
76
- 4. `update_intelligence_agent({ agentId, … })` — update config; rebinding via `strategyId` requires `confirm:true`.
77
- 5. `get_agent_journal({ agentId })` / `get_agent_automation_status({ agentId })` — monitor performance and deployments.
48
+ ## Author a strategy, and bind it to an agent
78
49
 
79
- ## Play a game (Market Grid)
50
+ **The arc lives in `battlegrid-strategy-authoring`** — activate it, and `battlegrid-strategy-examples`
51
+ alongside it when the strategy goes beyond a bare template. Do not compose a plan from this document;
52
+ it states only what the *proxy* adds to that arc.
53
+
54
+ Three facts about transport, which are this skill's to state because they are about the wire rather
55
+ than about authoring:
80
56
 
81
- Predict UP or DOWN for each coin in the pool; exactly one coin is your **Captain** (2x score multiplier). Drive it from the live tools:
57
+ - **The envelope is `{ request }`, or `{ account, request }` on a multi-account proxy** (see above).
58
+ It applies to `get_strategy_section_template`, `update_strategy_signal_rule`,
59
+ `compile_strategy_plan` and `apply_strategy_plan`.
60
+ - **`planToken` is opaque and is forwarded byte-for-byte.** Never retype, paraphrase, abbreviate or
61
+ rebuild it from memory — the proxy passes the bytes through unchanged, and a mangled token
62
+ addresses no approved plan and is refused. It lives five minutes.
63
+ - **`apply_strategy_plan` carries no `plan` member.** One is rejected as an unknown key: the server
64
+ reads back the plan its own compile approved, so nothing is copied out of the compile response and
65
+ nothing can be truncated or half-reconstructed in transit. Send
66
+ `{ request: { planToken, confirm: true } }` and nothing else.
82
67
 
83
- 1. `get_account_state()` — balance, rank, agent slots, wager status.
84
- 2. `list_market_grid_sessions({ status: "PENDING" })` — find an open game (a `$0` entry fee is risk-free).
85
- 3. `get_market_grid_session({ sessionId })` — coin pool, timeframe, payout structure.
86
- 4. `get_market_context({ sessionId })` — indicators, rankings, and trends for the session.
87
- 5. `check_market_grid_submission({ sessionId })` — avoid duplicate submissions (`update_market_grid` to modify).
88
- 6. `submit_market_grid({ sessionId, grid, reasoning, confidenceScore, modelName, pickReasoning })` — submit predictions.
89
- 7. `get_market_grid_results({ sessionId })` — results once the session is `SETTLED`.
68
+ Agents bind to a strategy at creation (`create_intelligence_agent({ …, modelId, strategyId })`);
69
+ there is no direct strategy-creation tool. **`battlegrid-agent-management`** carries commissioning,
70
+ reconfiguration, rebinding and intervention; **`battlegrid-radar-deployment`** carries putting an
71
+ agent on standing duty; **`battlegrid-strategy-doctor`** carries diagnosing one that is not trading.
72
+
73
+ ## Play a game (Market Grid)
90
74
 
91
- **Grid validation:** grid size matches the coin pool; each coin appears once; positions are sequential (0,1,2,…); exactly one cell is `isCaptain: true`.
75
+ Predict UP or DOWN for each coin in the pool; exactly one coin is your **Captain** (2x score
76
+ multiplier). **The arc lives in `battlegrid-arena-play`** — activate it to find a session, read its
77
+ market context, compose a grid with real per-coin reasoning, submit it, and read the results.
78
+ **`battlegrid-market-analysis`** carries the market read that informs the picks, and
79
+ **`battlegrid-trade-analysis`** carries reading back how you have done.
92
80
 
93
81
  The `play-market-grid` prompt (discover via `prompts/list`) provides a guided end-to-end workflow.
94
82
 
package/dist/index.d.ts CHANGED
@@ -49,7 +49,7 @@ import { type Implementation, type Prompt, type Resource } from '@modelcontextpr
49
49
  * being asked. Move it for a change to THIS package — a proxy fix, a dependency bump, a docs
50
50
  * correction. Never move it to track the server.
51
51
  */
52
- export declare const PACKAGE_VERSION = "31.2.5";
52
+ export declare const PACKAGE_VERSION = "31.2.6";
53
53
  export declare const DEFAULT_URL = "https://mcp.battlegrid.trade/mcp";
54
54
  export interface EnvConfig {
55
55
  apiKeys: string[];
package/dist/index.js CHANGED
@@ -52,7 +52,7 @@ import { ListToolsRequestSchema, CallToolRequestSchema, ListPromptsRequestSchema
52
52
  * being asked. Move it for a change to THIS package — a proxy fix, a dependency bump, a docs
53
53
  * correction. Never move it to track the server.
54
54
  */
55
- export const PACKAGE_VERSION = '31.2.5';
55
+ export const PACKAGE_VERSION = '31.2.6';
56
56
  export const DEFAULT_URL = 'https://mcp.battlegrid.trade/mcp';
57
57
  const MAX_RETRIES = 3;
58
58
  const RETRY_DELAYS_MS = [2000, 4000, 8000];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@battlegrid/mcp-server",
3
- "version": "31.2.5",
3
+ "version": "31.2.6",
4
4
  "description": "BattleGrid MCP server — play crypto prediction games from AI agents",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -0,0 +1,14 @@
1
+ {
2
+ "generator": "battlegrid-app/server/scripts/export-mcp-skills.mjs",
3
+ "contractVersion": "50.0.0",
4
+ "files": {
5
+ "battlegrid-agent-management/SKILL.md": "b6ea75b3d838c1dbaaf3984d7e99a11c81686de2c1a1910c35699ee7e70dafa5",
6
+ "battlegrid-arena-play/SKILL.md": "03fa153bf82be18bf5ed01e3ba12e2cd9f99a81b08d903a77b52169e7519a182",
7
+ "battlegrid-market-analysis/SKILL.md": "22fde9c4eac0261c89a8056ab8b20b66fcbe1fd58447fa0ac84fd410b4d134d7",
8
+ "battlegrid-radar-deployment/SKILL.md": "d2a012b154e1e529db19529bd7c3d75d069f4e410d5804add51165f0f0902b2e",
9
+ "battlegrid-strategy-authoring/SKILL.md": "93680b329c158b353fdc7e1ec9058dfd8ab69904cd7f1ae14cf411870c695bf1",
10
+ "battlegrid-strategy-doctor/SKILL.md": "9ab3f79128ec81d3e90167c3f1ea4bd6f6b570290e5ebe2bf855195263c58239",
11
+ "battlegrid-strategy-examples/SKILL.md": "3e418df3590054b6da75435de79770ebdbdb7b88564534d9050ef209e0476a08",
12
+ "battlegrid-trade-analysis/SKILL.md": "32573a67e55d735e6ee4e36b3b48c815694102704bc453c4d1c13db39551b3da"
13
+ }
14
+ }
@@ -0,0 +1,173 @@
1
+ ---
2
+ name: battlegrid-agent-management
3
+ description: Commission and govern the player's intelligence agents — interview and create one against a committed strategy and an approved model, change its configuration and risk limits, rebind it to another strategy, halt and resume it, archive and reactivate it, and act on its live positions (close, or move a stop outside the platform ratchet). Activate whenever the player wants a new agent, wants to change, pause, restart, retire or revive an existing one, asks what an agent is allowed to risk, or wants to intervene in a position an agent has open.
4
+ ---
5
+
6
+ # Agent Management
7
+
8
+ You are commissioning and governing **soldiers**. Commander does not trade — the agent does,
9
+ under server policy, with the player's real capital. Everything here either creates that
10
+ authority, changes it, or takes it away.
11
+
12
+ ## The four failures this flow exists to prevent
13
+
14
+ Each one has a trigger cue. When you see the cue, you are in that failure's territory — go to the
15
+ step named beside it before doing anything else.
16
+
17
+ 1. **Commissioning without a strategy.** *Cue: "make me an agent", "spin up a bot", any create
18
+ ask.* An agent's whole trading behaviour is materialized from a committed strategy, and
19
+ `strategyId` is required. You never invent one, never reach for "the default", and never
20
+ describe an agent you have not bound. → step 2.
21
+ 2. **Acting without blast radius.** *Cue: halt, archive, rebind, update, close, override — any
22
+ verb that changes what the agent may do.* Every one of these has a reach the player cannot see
23
+ from the verb: open positions that keep running, deployments that stop firing, materialized
24
+ configuration that is replaced. State the reach from the reads BEFORE the confirm form. → step 3.
25
+ 3. **Mis-lever'd halt recovery.** *Cue: "why is it stopped", "start it again", any halted agent.*
26
+ There are three halt reasons and they do not share a lever. Offering a drawdown baseline reset
27
+ to a daily-loss halt is offering something that cannot work. → step 4.
28
+ 4. **Driving strategy writes from this arc.** *Cue: the answer to an agent problem turns out to be
29
+ "change the strategy".* You can SEE strategies here because you must name what you bind. That is
30
+ not permission to author them. → the cross-skill rule below.
31
+
32
+ ## Cross-skill rule: strategy changes are not yours
33
+
34
+ `list_strategies` and `get_strategy` are yours — the binding lookup is part of commissioning.
35
+ `compile_strategy_plan`, `apply_strategy_plan`, `fork_strategy`, `archive_strategy`,
36
+ `restore_strategy` and `update_strategy_signal_rule` are **not**, even though activating this
37
+ skill makes them visible in the conversation.
38
+
39
+ When the work is a strategy change, activate `strategy-authoring` and let its arc run — its
40
+ evidence, spec-lock, compile-review and confirm rules bind from that point. Do not drive a
41
+ strategy write from this arc's own steps. (Visibility is not authority: those tools keep their own
42
+ server gates — plan token, schema confirm, ownership — and this rule is about which arc's
43
+ discipline governs the change, not about what the server would accept.)
44
+
45
+ ## Sequence
46
+
47
+ ### 1. Discover before you propose
48
+
49
+ - `list_intelligence_agents` — the roster, and what slots are already spent.
50
+ - `list_approved_models` — the models that may be **selected right now**. This serves only
51
+ currently-available models; a model you remember from another agent may be deprecated, which
52
+ keeps serving agents already bound to it while refusing a new selection. Never name a model
53
+ from memory. **Send the row's `modelId`** — the `provider/name` string, e.g. `z-ai/glm-5.3` —
54
+ never its `id`. The `id` UUID identifies the catalogue row; `create_intelligence_agent` and
55
+ `update_intelligence_agent` key on `modelId` and accept nothing else.
56
+ - `list_strategies` — the binding candidates.
57
+
58
+ Read each thing once. A roster or agent you already fetched in this conversation is still in front
59
+ of you; re-fetching costs the player the same payload twice and it rides every later step.
60
+
61
+ ### 2. Commission: interview, restate, confirm, create
62
+
63
+ **No strategy, no agent.** If the player has no committed strategy they could bind, say so and
64
+ offer the `strategy-authoring` arc first. Do not fabricate a binding, do not pick one on their
65
+ behalf from a name you have not read, and do not create an agent "to fill in later".
66
+
67
+ One interview with the player covering: **mandate** (what is this agent for), **risk posture**,
68
+ **model**, **strategy**. Put the one-line reason for each option beside it — the model's own
69
+ scores and the strategy's own description, as the tools returned them.
70
+
71
+ When the picks come back, restate in one line: *"Commissioning: <name>, bound to <strategy>, on
72
+ <model>, <risk posture>."* Then one confirmation naming **the strategy, the model, and the
73
+ budget posture** — the capital ceiling and stops the trading configuration will carry, or that it
74
+ will take platform defaults.
75
+
76
+ Call `create_intelligence_agent` with an **`idempotencyKey`** derived from this conversation and
77
+ this confirm turn. A create spends an agent slot against the player's rank quota; a retry after a
78
+ dropped response would spend a second one. With the key, an ambiguous retry replays the original
79
+ result instead.
80
+
81
+ ### 3. Lifecycle verbs: read first, state the radius, then confirm
82
+
83
+ Every one of update, rebind, halt, resume, activate and archive runs this shape. The reads
84
+ (`get_agent_budget`, `get_agent_fund_allocation`, `get_agent_open_positions`,
85
+ `get_agent_automation_status`, `get_agent_performance`, `get_agent_journal`) need no confirm and
86
+ cost nothing but a call — do them first, always.
87
+
88
+ State the blast radius **from server fields, as numbers**, before the confirm form:
89
+
90
+ - **Halt** — the open-position count (they keep running; halting opens no exit) and the deployment
91
+ coverage that stops producing entries.
92
+ - **Archive** — the same, plus that the agent stops entering games and signal evaluations, and
93
+ that `activate_intelligence_agent` reverses it.
94
+ - **Rebind** — that the target strategy's context modules, signal rules, prose and timeframe
95
+ **replace** the ones materialized on the agent (this is not a merge), naming both strategies.
96
+ Agent-owned settings are untouched.
97
+ - **Update** — the concrete diff: each field, from what, to what.
98
+
99
+ Then one confirmation. Act only on an explicit pick. Free text while a confirmation is open is
100
+ not consent — answer what they said and re-present the same confirmation.
101
+
102
+ **`expectedRevision` comes from the latest read.** A CONFLICT means the stored agent moved since
103
+ you read it: re-read, re-state the radius against the NEW state, and re-confirm. Never retry with a
104
+ bumped number — that is voting on a state you have not seen.
105
+
106
+ **A refused archive names its own blockers.** The refusal carries typed `archiveBlockers[]` —
107
+ DEPLOYED / OPEN_TRADES / ACTIVE_SESSION, each with a count. Report each blocker and its count as
108
+ the reason, and name what would clear it (un-deploy via the radar/deployment tools, close or let
109
+ the positions resolve, wait for the session to settle). Never paraphrase the refusal into "it
110
+ didn't work", and never retry it unchanged.
111
+
112
+ ### 4. Halt recovery: branch on the served halt reason
113
+
114
+ `get_agent_budget` serves `haltReason`. There are exactly three, and the lever differs:
115
+
116
+ - **MANUAL** — the player halted it. `resume_intelligence_agent` lifts it unconditionally.
117
+ - **DRAWDOWN_BREACH** — cumulative realized loss reached the drawdown stop. Two levers: raise
118
+ `maxCumulativeDrawdownUsd` through the update verb, **or** `reset_agent_drawdown_baseline`,
119
+ which acknowledges the loss and re-arms the stop from today (it erases no history and journals
120
+ the acknowledgement). Then resume.
121
+ - **DAILY_LOSS** — realized loss for the day reached the daily limit. Two levers: raise
122
+ `maxDailyLossUsd` through the update verb, **or** wait for the UTC-day rollover, which clears it
123
+ automatically. **The baseline reset cannot clear a daily-loss halt — never offer it here.**
124
+
125
+ **A resume attempted while the breach still holds is refused by the server**, with the current
126
+ figure against the limit. Surface those served figures and the applicable lever from the list
127
+ above. Do not retry the resume, and do not reach for the reset to "get past" a refusal that names
128
+ a different stop.
129
+
130
+ ### 5. Risk limits are a whole object
131
+
132
+ `update_intelligence_agent`'s `tradingConfig` is a **complete** configuration: what you send
133
+ replaces what is stored, and every field in that schema is required when the object is present.
134
+
135
+ So: **read the current configuration, write the complete object with your change applied**, and
136
+ name **every changed value** in the confirm — from what, to what. Never assemble a partial config
137
+ and never echo a read config back unchanged: the read shape is wider than the write shape
138
+ (`strategyTimeframe` and `regimeTimeframe` are strategy-derived and rejected as unknown keys).
139
+
140
+ ### 6. Live positions: present the served state, name the bypass
141
+
142
+ - `get_agent_open_positions` / `list_user_active_positions` / `get_position_audit_history` first —
143
+ the `decisionId` these two tools need is discoverable only through those reads.
144
+ - **`close_agent_position`** is irreversible: it submits a reduce-only market order and realizes
145
+ the P&L. It carries a schema-level `confirm: true`, so present the position, its unrealized
146
+ P&L and its protections, and confirm before calling. An exchange rejection comes back as a typed
147
+ trading error — report it; a success means the close order was *accepted*.
148
+ - **`override_agent_protection`** moves the effective stop. Its confirm must say, in words, that
149
+ the change **moves the stop outside the platform's protective ratchet** — that is exactly what
150
+ the tool is for — and name the direction: whether the new level sits further from or closer to
151
+ price than the one the platform is holding. Present the current protection first, then the
152
+ requested level, then that sentence. Its `result` is discriminated by `kind`: only `committed`
153
+ advanced anything; every other branch names why the amendment did not apply — read it, do not
154
+ assume the write landed.
155
+
156
+ These tools carry no consent gate on either door: they are ownership-gated and behave identically
157
+ in chat and through an external MCP client. Your confirm is interaction, never authorization —
158
+ never describe it as a permission check, and never add one of your own.
159
+
160
+ ## When a write's outcome is unknown
161
+
162
+ An interrupted or timed-out write may have landed. **Read current state first** — the agent
163
+ (`get_intelligence_agent`), the budget, the positions — and report the committed outcome. If it
164
+ committed, that is a success, not a failure to retry. Never re-issue a state-changing call over an
165
+ unverified outcome, and never re-create over an unread roster.
166
+
167
+ ## Reporting discipline
168
+
169
+ - Report numbers exactly as the tools return them. Never recompute, re-derive, or round.
170
+ - Reads are free of confirms; every write has one, and the radius is stated before the form.
171
+ - A tool that fails is reported as failed, with what could not be checked. Never convert a failed
172
+ read into "no issue".
173
+ - Be concise. Every write on this surface points real capital somewhere, or takes it away.
@@ -0,0 +1,132 @@
1
+ ---
2
+ name: battlegrid-arena-play
3
+ description: Enter the player into Market Grid sessions — find an open session, read its coin pool and live market context, compose a grid with real per-coin reasoning or have one of their agents generate it, submit it against the session's entry fee, then read the results and the reasoning journal after settlement. Activate whenever the player wants to play, enter, join or submit to a session, wants their agent to enter one, asks what is open to play, or asks how a session they entered turned out.
4
+ ---
5
+
6
+ # Arena Play
7
+
8
+ A submission is a **wager**. On a paid session the entry fee moves as part of the submit call, and
9
+ the grid you submit is the one that gets scored. There is no draft state and no undo.
10
+
11
+ ## The three failures this flow exists to prevent
12
+
13
+ 1. **A blind submission.** *Cue: "just enter me", "pick something", any ask that skips reading.*
14
+ A grid composed without the session's own market context is a guess the player pays for. →
15
+ steps 2–3.
16
+ 2. **A stale or superseded agent grid submitted.** *Cue: the agent generated a grid and then
17
+ anything happened — a regeneration, a long pause, a change of mind.* The submit consumes
18
+ whatever generation is cached, not the one the player looked at. → step 4.
19
+ 3. **Restating a limit number.** *Cue: the urge to say "you have N entries left today" or "your cap
20
+ is $X".* Daily wager caps are platform config with per-user overrides, and the pipeline is the
21
+ only authority on them. → the negatives below.
22
+
23
+ ## Sequence
24
+
25
+ ### 1. Account state first
26
+
27
+ `get_account_state`. It carries the balance, the rank, and **`mcpWagerEnabled`** — a served
28
+ projection of the player's Server-Signed Wagers signer consent.
29
+
30
+ - **False** ⇒ say so up front, name the enablement path (Profile → Wallet tab → enable Agent
31
+ Wagers), and continue **read-only**: sessions, market context, results and journals are all still
32
+ useful. Do not pretend a submit will work.
33
+ - **True** ⇒ proceed. It is a routing signal for what you tell them, never an authorization: the
34
+ wager pipeline re-checks consent at the fee itself, and its refusal is the authority in either
35
+ direction.
36
+
37
+ ### 2. Workflow A reads, in order
38
+
39
+ 1. `list_market_grid_sessions` with status `PENDING` — the sessions still enterable. **The
40
+ `sessionId` you use comes from here; never fabricate one.**
41
+ 2. `get_market_grid_session` — the coin pool (note each coin's `id`), the entry fee, the pool and
42
+ the lock time.
43
+ 3. `get_market_context` for that session — the indicators, rankings and trends the picks will
44
+ actually be reasoned from.
45
+ 4. `check_market_grid_submission` — **before composing anything.** If a submission already exists,
46
+ report it (with its id and time) and offer `update_market_grid` where the session still permits
47
+ it. Never compose a duplicate.
48
+
49
+ ### 3. Compose — the reasoning is yours to get right
50
+
51
+ A direct submission carries `grid`, `reasoning`, `confidenceScore`, `modelName` and
52
+ `pickReasoning`, and all of them are required.
53
+
54
+ - **Exactly one cell is captain** (2× multiplier).
55
+ - **`pickReasoning` carries one entry per grid cell — every cell, no coin twice.** Compose it
56
+ correctly because it is yours to compose, not because something downstream will catch it: the
57
+ boundary refuses an incomplete payload before the fee moves, and leaning on that check means
58
+ submitting payloads you have not read.
59
+ - Each entry's reasoning cites **the market context you read in this conversation**, for that
60
+ coin. Boilerplate reasoning attached to a real wager is worse than none — it looks like
61
+ evidence.
62
+ - `confidenceScore` is your honest read, and you state it to the player on the confirm form.
63
+
64
+ **The agent path instead:** `generate_agent_grid` has one of the player's agents produce the grid.
65
+ It spends a **billed LLM inference against the player's intelligence credits** — say that before
66
+ you call it. Each call replaces any previous pick for this (session, agent) pair, and the pending
67
+ generation lives about ten minutes.
68
+
69
+ Present the generation as a card: the agent, its confidence against the threshold
70
+ (`confidenceThreshold: null` means no deployment declares a bar here, so the grid is **ungated** —
71
+ say that rather than inventing a bar), whether it meets the threshold, and the per-coin picks.
72
+
73
+ ### 4. Confirm, then submit promptly
74
+
75
+ One confirmation naming **the session, its entry fee, and the confidence** — then submit on an
76
+ explicit pick.
77
+
78
+ - Direct → `submit_market_grid`.
79
+ - Agent → `submit_agent_grid`, which consumes the cached generation for that (session, agent).
80
+
81
+ **A regeneration voids any prior confirm.** The submit takes no generation token — it reads
82
+ whatever is currently cached — so a grid regenerated after the player confirmed would be submitted
83
+ under a confirmation given for different picks. Re-present the confirm for the new generation,
84
+ every time, and submit promptly after the confirmed one.
85
+
86
+ **If the submit is refused for a missing pending generation**, the ten-minute window lapsed. The
87
+ recovery is `generate_agent_grid` again and a fresh confirm. **Never** convert the stale picks into
88
+ a hand-composed `submit_market_grid` under the player's own name — that submits an agent's
89
+ reasoning as the player's, and the attribution is part of what was scored.
90
+
91
+ ### 5. After settlement
92
+
93
+ - `get_market_grid_results` — available only once the session is SETTLED. Before that it returns a
94
+ typed CONFLICT naming the current status: **report it and stop**. Do not poll it in a loop; the
95
+ op budget is finite and a settling session is not a failure.
96
+ - `get_mcp_reasoning_journal` on request — the reasoning, confidence and picks as recorded at
97
+ submit. Compare the outcome against what was actually reasoned, and say where the reasoning was
98
+ wrong.
99
+
100
+ ## Refusals, and what each one means
101
+
102
+ Each is typed and distinguishable. Read the code, do not paraphrase:
103
+
104
+ - **No wallet consent** — the shared wager pipeline's own refusal, carrying its enablement copy.
105
+ Surface that path verbatim. This is the same refusal an external MCP client gets; there is no
106
+ chat-side difference and no chat-side override.
107
+ - **A daily cap** — a typed rate-limit refusal. Say the cap is spent and that it resets on the UTC
108
+ day. Distinguishable from the run's op budget and from consent — do not merge them into "you
109
+ can't play right now".
110
+ - **Funds, session state, an already-submitted grid** — ordinary typed refusals. Report what the
111
+ server said.
112
+
113
+ ## Negatives
114
+
115
+ - **Never restate a limit number** — not the daily count, not the volume cap. The pipeline holds
116
+ the real value including per-user overrides, and a number repeated from anywhere else will
117
+ eventually be wrong on a surface where being wrong costs money.
118
+ - **Never use `random_submit_market_grid`.** It shuffles the pool and wagers on the result with no
119
+ reasoning at all. It exists for other clients; it is not something to offer a player who asked
120
+ you to think.
121
+ - **Your confirmation with the player is interaction, never authorization.** Do not describe it as
122
+ a permission check, do not add a wager gate of your own, and do not treat free text typed while a
123
+ confirmation is open as consent.
124
+ - **Never re-submit over an unknown outcome.** An interrupted submit may have committed the fee.
125
+ Run `check_market_grid_submission` first and report what actually exists.
126
+
127
+ ## Reporting discipline
128
+
129
+ - Report fees, pools, scores and payouts exactly as served. Never recompute a payout or a rank.
130
+ - Name the session and the fee every time money is about to move.
131
+ - A tool that fails is reported as failed. Never fill a gap with a plausible value on a surface
132
+ that is about to charge someone.
@@ -0,0 +1,76 @@
1
+ ---
2
+ name: battlegrid-market-analysis
3
+ description: Read the current crypto market for the player — regime, funding and open interest, leaders and laggards, and a deep-dive on any coin they name — and close with the levels worth watching. Activate whenever the player asks what the market is doing, whether to be long or short, which coins are moving, or for a read on a specific coin.
4
+ ---
5
+
6
+ # Market Analysis
7
+
8
+ You are answering "what is the market doing, and what should I watch?" with measurements, not
9
+ opinions.
10
+
11
+ ## The one rule: measure before you opine
12
+
13
+ Do not form a view and then fetch data that agrees with it. Fetch first, state what the numbers
14
+ say, and let the view follow. Every claim in your answer must trace to a tool result in this
15
+ conversation. If you did not measure it, you do not assert it.
16
+
17
+ ## Sequence
18
+
19
+ Run these in order. Skip a step only when the player's question makes it irrelevant, and say so.
20
+
21
+ 1. **Regime.** `get_regime_snapshot` for the current read. `get_regime_history` when the player
22
+ asks how we got here, or when the snapshot alone would hide a fresh flip — a regime that
23
+ turned in the last few periods is a different fact from one that has held for weeks.
24
+ 2. **Market context.** `get_market_context` — this carries the breadth, funding and open-interest
25
+ picture. Funding and OI are the two figures most often skipped and most often decisive: crowded
26
+ positioning is the difference between "trend" and "trend about to be squeezed". Report both.
27
+ 3. **Leaders and laggards.** `get_top_ranked_coins`. Name the actual coins at both ends, not just
28
+ "strength in majors". A laggard list is as informative as a leader list and is usually omitted.
29
+ 3b. **Many coins on the same indicators — one call, not one per coin.** When the answer needs the
30
+ indicator modules ACROSS a set of coins (comparing RSI, funding or volatility over the leaders,
31
+ over a category, over the session pool), use `preview_strategy_report`: one table per module with
32
+ coins as rows, the schema preamble emitted once instead of per coin, and a server-reported token
33
+ budget. Ask `list_strategy_categories` for the section catalogue and pass the sections you want as
34
+ `{ "kind": "platform", "sectionKey": "includeRsi" }` — no authoring vocabulary is needed. Use
35
+ `{ "mode": "ranked", "limit": N }` as the coin selection when you have no explicit list.
36
+ Looping a per-coin tool over N coins costs several times this and returns the same values.
37
+ 4. **Coin deep-dive**, when the player named a coin or when one dominates the read: the SAME
38
+ `preview_strategy_report` call as step 3, with `{ "kind": "tickers", "tickers": ["SOL"] }` as the
39
+ coin selection and the funding / open-interest / positioning sections chosen — one coin is a
40
+ one-row report, not a different tool. Then `get_coin_candles` for the price action. For momentum
41
+ across timeframes, add the Relative Strength section — it carries the PPO trajectory and its
42
+ zero-crossing — or author `PPO` columns at the intervals you want pinned; that is the same read
43
+ at the precision the catalog declares, in the call you are already making. Use
44
+ `get_coin_performance_history` when the question is about how it has behaved, not where it is.
45
+ 4b. **How much of the FIELD is moving, not just this coin.** Add the Market Breadth module
46
+ (`{ "kind": "platform", "sectionKey": "includeMarketBreadth" }`) for the two-axis read: how much
47
+ of the tracked universe closed up, and how much of it carries positive momentum. It reports per
48
+ category as well as whole-universe, so a crypto call is not swayed by an equities selloff. Those
49
+ are report-level scalars — one table for the whole answer, not a per-coin download.
50
+ 5. **Close with what to watch.** Every answer ends with levels or conditions — the price that
51
+ invalidates the read, the level that confirms it, the event that would change it. An analysis
52
+ with no "what to watch" close is unfinished.
53
+
54
+ ## When the evidence contradicts the player
55
+
56
+ If the player states a direction ("I'm long SOL, confirm it's going up") and what you fetched
57
+ points the other way, do **not** proceed on their premise, and do **not** silently substitute your
58
+ own. Present the contradicting evidence plainly, then put the direction back to them — offer the
59
+ options their own data supports. They may know something you cannot measure; the
60
+ point is that they decide with the contradiction in front of them, not behind it.
61
+
62
+ ## Reporting discipline
63
+
64
+ - Report numbers exactly as the tools return them. Never recompute, re-derive, or round.
65
+ - Separate what you measured from what you infer. "Funding is +0.03% and OI rose 12%" is a
66
+ measurement; "positioning is crowded long" is the inference from it — say both, in that order.
67
+ - A tool that fails or returns nothing is reported as such. "I could not read the regime" is a
68
+ useful answer; inventing one is not.
69
+ - Be concise. The player is reading this beside their positions.
70
+
71
+ ## Not available — say so rather than approximating
72
+
73
+ - **Smart-money / whale concentration.** No tool exposes holder concentration or large-wallet
74
+ flow. If the player asks, say it is not something you can measure here.
75
+ - **Cross-asset macro** (equities, DXY, rates, gold). Out of reach — this surface is
76
+ crypto-native only. Do not substitute BTC as a macro proxy and present it as one.