Skip to content
TotalFinance

MCP server · @insiderfinance/totalfinance-mcp

@insiderfinance/totalfinance-mcp

import { … } from '@insiderfinance/totalfinance-mcp'
preview (pre-1.0)iface 4fn 24JSON ↗
iface

McpServerOptions

#

Public declaration. Read the signature and member contracts below; no additional behaviour is inferred.

Signature
import type { McpServerOptions } from '@insiderfinance/totalfinance-mcp';

export interface McpServerOptions {
    /** Task selection when neither tools nor packs is supplied. Explicit tools/packs remain exact. */
    profile?: RegistryProfile;
    /** Maximum entries per tools/resources list page: integer 1–100, default 100. */
    pageSize?: number;
    /** Explicit local worker runner; requires its artifact reader. Adds typed job controls, never grants. */
    jobs?: JobRunner;
    /**
     * An artifact store (Decision 5): input handles resolve through it; permitted reports are listed
     * as `totalfinance://reports/<hash>` resources. With jobs attached, reports for excluded operations
     * are hidden. A constructor argument — nothing is looked up by "current session".
     */
    artifacts?: ArtifactStoreReader;
    /** Override the default tool set with an explicit list (the low-level escape hatch). */
    tools?: TotalFinanceTool[];
    /**
     * EXACT pack selection (alignment spec P1.1): omitted → the selected profile; provided → exactly
     * the packs given, nothing implicit. `packs: [optionsPack()]` exposes only the option tools;
     * expand the defaults with `packs: [...defaultPacks(), backtestPack()]`. When `tools` is also
     * given, the registry is their union (both are explicit). Pack tools obey the same read-only
     * filter, seed policy, and budgets as the defaults.
     */
    packs?: (ToolPack | OperationPack)[];
    /**
     * Reject any tool call whose serialized arguments exceed this many bytes (compute-budget guard,
     * spec §18.5). Default 64 KB.
     */
    maxInputBytes?: number;
    /**
     * Financial read-only mode (default `true`): tools flagged `mutates` or requiring a write/approval
     * capability are filtered out. Explicit artifact storage and job controls are independent.
     */
    readOnly?: boolean;
    /** What every caller of this server holds (Stage 7B.2 Decision 9); default the runtime's defaults. */
    capabilities?: readonly string[];
    /** The trade lifecycle's stores (Decision 10). */
    stores?: {
        authorization?: AuthorizationStore;
        journal?: ExecutionJournalStore;
    };
    /** The instant stamped on a stored result's handle when `artifacts` is writable — the edge's clock (default `new Date().toISOString()`). */
    clock?: () => string;
    /**
     * Deterministic seed policy (spec §18.5). Any stochastic CALL (Monte Carlo, resampling — a tool's
     * `stochastic` flag may be a per-call predicate) requires a seed; when absent, this default is
     * injected and echoed in `structured.assumptions.seed` so MCP results are reproducible. Default 0.
     * Deterministic calls (e.g. historical/parametric VaR) never get a meaningless seed injected.
     */
    defaultSeed?: number;
    /** Soft wall-clock budget per tool call (ms). A call exceeding it returns an error. */
    deadlineMs?: number;
}
Fields, parameters and returned members (157)

Loading 157 members…

Stability: preview (pre-1.0). Units come from declared names; “unitless by name” means the name alone does not establish a unit. See conventions and errors and warnings.

iface

ToolPack

#

Public declaration. Read the signature and member contracts below; no additional behaviour is inferred.

Signature
import type { ToolPack } from '@insiderfinance/totalfinance-mcp';

export interface ToolPack {
    name: string;
    tools: TotalFinanceTool[];
}
Fields, parameters and returned members (2)
Name · typeMeaning · unitRequired · default
namestring—unitless by nameRequiredNo @default declared
toolsTotalFinanceTool[]—unitless by nameRequiredNo @default declared

Stability: preview (pre-1.0). Units come from declared names; “unitless by name” means the name alone does not establish a unit. See conventions and errors and warnings.

iface

ToolResult

#

Public declaration. Read the signature and member contracts below; no additional behaviour is inferred.

Signature
import type { ToolResult } from '@insiderfinance/totalfinance-mcp';

export interface ToolResult {
    /** Human-readable one-line summary. */
    summary: string;
    /** Machine-readable structured output (returned as MCP `structuredContent`). */
    structured: Record<string, unknown>;
}
Fields, parameters and returned members (2)
Name · typeMeaning · unitRequired · default
structuredRecord<string, unknown>

Machine-readable structured output (returned as MCP structuredContent).

unitless by name
RequiredNo @default declared
summarystring

Human-readable one-line summary.

unitless by name
RequiredNo @default declared

Stability: preview (pre-1.0). Units come from declared names; “unitless by name” means the name alone does not establish a unit. See conventions and errors and warnings.

iface

TotalFinanceTool

#

Public declaration. Read the signature and member contracts below; no additional behaviour is inferred.

Signature
import type { TotalFinanceTool } from '@insiderfinance/totalfinance-mcp';

export interface TotalFinanceTool {
    name: string;
    title: string;
    description: string;
    schema: Schema<unknown>;
    /**
     * JSON Schema describing the structured output (the `structured` slot). On the wire every
     * tool's `outputSchema` is the full `OperationResult` envelope wrapping this schema.
     */
    outputSchema?: JSONSchema;
    /** Whether the tool mutates state (filtered out in read-only mode). Default `false`. */
    mutates?: boolean;
    /**
     * Whether a call draws random samples, so the server's deterministic seed policy applies (inject
     * the default seed when absent; echo it in `structured.assumptions.seed`). `true` = every call;
     * a predicate = per-call (e.g. VaR is stochastic only for `method: 'monteCarlo'`). Default `false`.
     */
    stochastic?: boolean | ((args: Record<string, unknown>) => boolean);
    run(input: unknown): ToolResult;
}
Fields, parameters and returned members (143)

Loading 143 members…

Stability: preview (pre-1.0). Units come from declared names; “unitless by name” means the name alone does not establish a unit. See conventions and errors and warnings.

fn

analysisTools

#

The analysis-role tools beyond the compute defaults, as MCP tools.

Signature
import { analysisTools } from '@insiderfinance/totalfinance-mcp';

export declare function analysisTools(): TotalFinanceTool[];

Stability: preview (pre-1.0). Units come from declared names; “unitless by name” means the name alone does not establish a unit. See conventions and errors and warnings.

fn

artifactPack

#

Public declaration. Read the signature and member contracts below; no additional behaviour is inferred.

Signature
import { artifactPack } from '@insiderfinance/totalfinance-mcp';

export declare function artifactPack(): ToolPack;
Fields, parameters and returned members (2)
Name · typeMeaning · unitRequired · default
return.namestring—unitless by nameRequiredNo @default declared
return.toolsTotalFinanceTool[]—unitless by nameRequiredNo @default declared

Stability: preview (pre-1.0). Units come from declared names; “unitless by name” means the name alone does not establish a unit. See conventions and errors and warnings.

fn

backtestPack

#

The opt-in backtest pack (payload/runtime heavy — deliberately not a default).

Signature
import { backtestPack } from '@insiderfinance/totalfinance-mcp';

export declare function backtestPack(): ToolPack;
Fields, parameters and returned members (2)
Name · typeMeaning · unitRequired · default
return.namestring—unitless by nameRequiredNo @default declared
return.toolsTotalFinanceTool[]—unitless by nameRequiredNo @default declared

Stability: preview (pre-1.0). Units come from declared names; “unitless by name” means the name alone does not establish a unit. See conventions and errors and warnings.

fn

calendarPack

#

Public declaration. Read the signature and member contracts below; no additional behaviour is inferred.

Signature
import { calendarPack } from '@insiderfinance/totalfinance-mcp';

export declare function calendarPack(): ToolPack;
Fields, parameters and returned members (2)
Name · typeMeaning · unitRequired · default
return.namestring—unitless by nameRequiredNo @default declared
return.toolsTotalFinanceTool[]—unitless by nameRequiredNo @default declared

Stability: preview (pre-1.0). Units come from declared names; “unitless by name” means the name alone does not establish a unit. See conventions and errors and warnings.

fn

createTotalFinanceMcpServer

#

Build (but do not connect) a TotalFinance MCP server.

Signature
import { createTotalFinanceMcpServer } from '@insiderfinance/totalfinance-mcp';

export declare function createTotalFinanceMcpServer(options?: McpServerOptions): Server;
Fields, parameters and returned members (16)

Loading 16 members…

Stability: preview (pre-1.0). Units come from declared names; “unitless by name” means the name alone does not establish a unit. See conventions and errors and warnings.

fn

cryptoPack

#

Public declaration. Read the signature and member contracts below; no additional behaviour is inferred.

Signature
import { cryptoPack } from '@insiderfinance/totalfinance-mcp';

export declare function cryptoPack(): ToolPack;
Fields, parameters and returned members (2)
Name · typeMeaning · unitRequired · default
return.namestring—unitless by nameRequiredNo @default declared
return.toolsTotalFinanceTool[]—unitless by nameRequiredNo @default declared

Stability: preview (pre-1.0). Units come from declared names; “unitless by name” means the name alone does not establish a unit. See conventions and errors and warnings.

fn

defaultPacks

#

The ten domain packs that make up the default read-only server, in tool-list order.

Signature
import { defaultPacks } from '@insiderfinance/totalfinance-mcp';

export declare function defaultPacks(): ToolPack[];

Stability: preview (pre-1.0). Units come from declared names; “unitless by name” means the name alone does not establish a unit. See conventions and errors and warnings.

fn

defaultTools

#

The default read-only tool set — every domain pack flattened (dx §WS-5).

Signature
import { defaultTools } from '@insiderfinance/totalfinance-mcp';

export declare function defaultTools(): TotalFinanceTool[];

Stability: preview (pre-1.0). Units come from declared names; “unitless by name” means the name alone does not establish a unit. See conventions and errors and warnings.

fn

defineTool

#

Define a caller's own tool (the escape hatch for a custom server); validated on every run.

Signature
import { defineTool } from '@insiderfinance/totalfinance-mcp';

export declare function defineTool<I>(definition: { name: string; title: string; description: string; schema: Schema<I>; outputSchema?: JSONSchema; mutates?: boolean; stochastic?: boolean | ((args: Record<string, unknown>) => boolean); run: (input: I) => ToolResult | OperationOutput<Record<string, unknown>>; }): TotalFinanceTool;
Fields, parameters and returned members (17)

Loading 17 members…

Stability: preview (pre-1.0). Units come from declared names; “unitless by name” means the name alone does not establish a unit. See conventions and errors and warnings.

fn

fixedIncomePack

#

Public declaration. Read the signature and member contracts below; no additional behaviour is inferred.

Signature
import { fixedIncomePack } from '@insiderfinance/totalfinance-mcp';

export declare function fixedIncomePack(): ToolPack;
Fields, parameters and returned members (2)
Name · typeMeaning · unitRequired · default
return.namestring—unitless by nameRequiredNo @default declared
return.toolsTotalFinanceTool[]—unitless by nameRequiredNo @default declared

Stability: preview (pre-1.0). Units come from declared names; “unitless by name” means the name alone does not establish a unit. See conventions and errors and warnings.

fn

journeyPacks

#

The five journey packs as tool packs (the valuation pack joined in Stage 4.7): createTotalFinanceMcpServer({ packs: [...defaultPacks(), ...journeyPacks()] }).

Signature
import { journeyPacks } from '@insiderfinance/totalfinance-mcp';

export declare function journeyPacks(): ToolPack[];

Stability: preview (pre-1.0). Units come from declared names; “unitless by name” means the name alone does not establish a unit. See conventions and errors and warnings.

fn

optionsPack

#

Public declaration. Read the signature and member contracts below; no additional behaviour is inferred.

Signature
import { optionsPack } from '@insiderfinance/totalfinance-mcp';

export declare function optionsPack(): ToolPack;
Fields, parameters and returned members (2)
Name · typeMeaning · unitRequired · default
return.namestring—unitless by nameRequiredNo @default declared
return.toolsTotalFinanceTool[]—unitless by nameRequiredNo @default declared

Stability: preview (pre-1.0). Units come from declared names; “unitless by name” means the name alone does not establish a unit. See conventions and errors and warnings.

fn

performancePack

#

Public declaration. Read the signature and member contracts below; no additional behaviour is inferred.

Signature
import { performancePack } from '@insiderfinance/totalfinance-mcp';

export declare function performancePack(): ToolPack;
Fields, parameters and returned members (2)
Name · typeMeaning · unitRequired · default
return.namestring—unitless by nameRequiredNo @default declared
return.toolsTotalFinanceTool[]—unitless by nameRequiredNo @default declared

Stability: preview (pre-1.0). Units come from declared names; “unitless by name” means the name alone does not establish a unit. See conventions and errors and warnings.

fn

portfolioPack

#

Public declaration. Read the signature and member contracts below; no additional behaviour is inferred.

Signature
import { portfolioPack } from '@insiderfinance/totalfinance-mcp';

export declare function portfolioPack(): ToolPack;
Fields, parameters and returned members (2)
Name · typeMeaning · unitRequired · default
return.namestring—unitless by nameRequiredNo @default declared
return.toolsTotalFinanceTool[]—unitless by nameRequiredNo @default declared

Stability: preview (pre-1.0). Units come from declared names; “unitless by name” means the name alone does not establish a unit. See conventions and errors and warnings.

fn

researchPack

#

Public declaration. Read the signature and member contracts below; no additional behaviour is inferred.

Signature
import { researchPack } from '@insiderfinance/totalfinance-mcp';

export declare function researchPack(): ToolPack;
Fields, parameters and returned members (2)
Name · typeMeaning · unitRequired · default
return.namestring—unitless by nameRequiredNo @default declared
return.toolsTotalFinanceTool[]—unitless by nameRequiredNo @default declared

Stability: preview (pre-1.0). Units come from declared names; “unitless by name” means the name alone does not establish a unit. See conventions and errors and warnings.

fn

riskPack

#

Public declaration. Read the signature and member contracts below; no additional behaviour is inferred.

Signature
import { riskPack } from '@insiderfinance/totalfinance-mcp';

export declare function riskPack(): ToolPack;
Fields, parameters and returned members (2)
Name · typeMeaning · unitRequired · default
return.namestring—unitless by nameRequiredNo @default declared
return.toolsTotalFinanceTool[]—unitless by nameRequiredNo @default declared

Stability: preview (pre-1.0). Units come from declared names; “unitless by name” means the name alone does not establish a unit. See conventions and errors and warnings.