IMCPSchema

Registration schema of an MCP (Model Context Protocol) instance.

Binds an MCP name to a strategy: status and position commands operate on every live instance of that strategy.

  • mcpName — registry key; duplicate registration is a validation error.
  • strategyName — the strategy whose live instances the MCP observes and trades. Optional: when omitted, the SINGLE registered strategy is used; with two or more strategies registered every MCP call throws until the schema names one explicitly — ambiguity is an error, not a guess.
  • positionCost — entry cost in USD for commitPositionOpen; defaults to GLOBAL_CONFIG.CC_POSITION_ENTRY_COST when omitted.
  • permissions — per-method grants for the agent-facing methods; defaults to ALL of them when omitted. Listing permissions explicitly narrows the agent to exactly those methods; a call to a method whose permission is missing throws with an agent-readable denial. The check runs per call, so an overridden schema applies immediately.
  • getMessages — renders the portfolio snapshot into agent messages; when omitted the default renderer emits one text message per symbol.
  • callbacks — all optional; an omitted callback is simply never fired.
mcpName: string

Unique MCP (Model Context Protocol) identifier for the schema registry

strategyName: string

Strategy whose live instances this MCP (Model Context Protocol) observes and trades. Optional: defaults to the single registered strategy; ambiguous (2+ registered) requires it

positionCost: number

Entry cost in USD for opened positions. Default: GLOBAL_CONFIG.CC_POSITION_ENTRY_COST

minuteEstimatedTime: number

Estimated time in minutes for a position to reach its TP or SL.

permissions: MCPPermission[]

Per-method grants for the agent; each permission name gates the agent-facing MCP (Model Context Protocol) method of the same name. Default: all of them

getMessages: (context: IMCPContext, when: Date, mcpName: string) => IMCPMessage[] | Promise<IMCPMessage[]>

Renders the portfolio snapshot into messages for the MCP (Model Context Protocol) agent (default: text per symbol)

callbacks: Partial<IMCPCallbacks>

Lifecycle callbacks (all optional)