Skip to main content
Glama

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
BACKTRADER_MCP_RUNTIMESYesJSON object mapping runtime IDs to absolute Backtrader source root paths (e.g., {"default":"/absolute/backtrader/source/root"}).
BACKTRADER_MCP_STATE_ROOTYesThe absolute path to the private state root directory.
BACKTRADER_MCP_SOURCE_ROOTSYesJSON object mapping source root IDs to absolute read-only paths (e.g., {"market_data":"/absolute/read-only/csv"}).
BACKTRADER_MCP_TARGET_ROOTSYesJSON object mapping target root IDs to absolute paths (e.g., {"strategies":"/absolute/generated/strategies"}).

Instructions

Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.

This server publishes no instructions, or was last inspected before Glama recorded them.

Capabilities

Features and capabilities supported by this server

Protocol revision2025-11-25

CapabilityDetails
tools
{
  "listChanged": false
}
prompts
{
  "listChanged": false
}
resources
{
  "subscribe": false,
  "listChanged": false
}
experimental
{}

Tools

Functions exposed to the LLM to take actions

NameDescription
doctorA

Diagnose package dependencies, configured roots, and Backtrader runtimes.

inspect_datasetA

Inspect a confined local CSV without registering it.

    Returns the detected columns and a bounded sample. Use this before
    register_dataset to build an explicit column map.
    
register_datasetB

Normalize a confined CSV into the immutable content-addressed store.

Requires an explicit canonical column map (datetime/open/high/low/close/ volume/openinterest). Identical content maps to the same dataset ID.

register_local_datasetA

Register one or more local feeds from a hash-bound DataSpec v1.

    Accepts the six typed adapters (generic_csv, backtrader_csv, yahoo_csv,
    mt5_csv, pandas, pandas_custom_lines) with optional bar_operation
    (direct/resample/replay). Rejections enumerate the valid values.
    
preview_datasetA

Return a bounded preview of an immutable dataset.

    Includes a truncation_message telling how to raise the limit (up to the
    configured max) or derive a filtered dataset.
    
derive_tabular_datasetA

Run one product-owned tabular transform into a new immutable dataset.

    Supported profiles: identity, dropna, returns, sma. Requires the exact
    source-manifest hash; identical inputs yield the same derived dataset ID.
    
get_catalog_snapshotA

Read the bundled immutable strategy catalog snapshot.

    By default returns only counts, hashes, and provenance (extensions.
    entry_count reports the 1155 records). Set include_entries=true to page
    through entries with limit (1-100) and offset; pagination reports
    total/has_more/truncated. Prefer search_strategy_catalog for queries.
    
search_strategy_catalogA

Search deterministic built-in patterns by text and archetype.

    Returns total/has_more/offset pagination metadata. Empty results carry
    suggestions with the valid archetype list. Unknown archetypes enumerate
    the valid values in the error message.
    
refresh_strategy_catalogA

Refresh one AST root, or rebuild both metadata corpora when package_root_id is set.

    Scans metadata and hashes only; corpus files are never imported or executed.
    
inspect_strategyB

Inspect bundled or source-attached strategy metadata without importing it.

list_strategy_templatesA

List the fourteen archetype/output-profile scaffold templates.

create_strategy_draftB

Create a private single-test or Python-bundle draft.

    strategy_spec must satisfy the strategy-spec-v1 JSON Schema contract
    (available at backtrader-mcp://contracts/strategy-spec). Each call
    creates a new draft ID.
    
validate_strategy_specA

Validate and canonicalize StrategySpec against its immutable dataset.

    Read-only: no draft, token, or state record is created.
    
get_strategy_draftB

Read a private draft with exact file hashes.

update_strategy_draftB

Update one editable draft file with optimistic concurrency.

Requires the current revision and exact file hash; stale values are rejected with a conflict error.

validate_strategy_draftB

Statically validate a draft and issue an exact hash-bound capability.

Parses and compiles AST without importing the candidate. Every call creates a new validation record and capability.

apply_strategy_repairB

Apply an exact-hash repair and invalidate the old validation capability.

list_target_treeA

Read a confined target directory tree as relative-path to sha256.

    Use before prepare_strategy_changes to construct exact
    expected_target_hashes preimages.
    
prepare_strategy_changesA

Prepare an exact diff; this does not approve or write the target.

    Returns a signed change token and the printed local approval command.
    apply_strategy_changes requires the approval created by that command.
    
apply_strategy_changesA

Apply only an exact change with a trusted local CLI approval record.

    Destructive: replaces the entire managed target strategy directory after
    rechecking every preimage hash.
    
prepare_strategy_runA

Freeze exact run inputs and return a signed plan requiring local approval.

    The response includes the printed local approval command. A separate
    execution approval is mandatory before start_strategy_run. For
    run_profile_id=parameter_sweep, param_grid maps StrategySpec parameter
    names to value lists (at most 64 combinations); one approval covers
    the whole grid.
    
start_strategy_runA

Consume a distinct local execution approval and launch a durable job.

    Returns a job_id; poll get_run_status until a terminal state, then read
    get_run_result on SUCCEEDED or get_run_logs on failure.
    
get_run_statusA

Read the durable state of a product-owned asynchronous run.

    Includes derived polling fields: log_uri (see get_run_logs),
    elapsed_seconds, and eta_bound for active jobs. Terminal states:
    SUCCEEDED, FAILED, TIMED_OUT, CANCELLED, ORPHANED.
    
cancel_strategy_runB

Cancel a queued or running product job.

    Destructive: terminates the worker and candidate processes.
    
get_run_resultA

Read the normalized result and Markdown report for a successful job.

list_jobsA

List durable jobs newest-first with pagination metadata.

    Filter by a job state or the pseudo-state "active" (QUEUED/RUNNING/
    CANCEL_REQUESTED). Unknown states enumerate the valid values. Advance
    through pages with offset while has_more is true.
    
get_run_logsA

Read bounded tails of a job's private log files.

    Use after a FAILED/TIMED_OUT/ORPHANED job to diagnose the cause before
    changing the strategy. tail_bytes is capped at 25000; absolute paths in
    log content are redacted.
    
compare_strategy_runsB

Compare canonical metrics and provenance using comparison-profile-v1.

render_strategy_reportA

Render a successful canonical result as Markdown or JSON.

audit_independenceA

Audit source imports and dynamic execution against product boundaries.

Prompts

Interactive templates invoked by user choice

NameDescription
design_strategy
map_dataset
scaffold_strategy
review_validation
review_change
run_backtest
review_run_result
recover_job

Resources

Contextual data attached and managed by the client

NameDescription
product-info
catalog-snapshot
strategy-templates
strategy-contract

TDQS

B3.4/5.0

Scored across 30 tools

Disambiguation4/5

The toolset separates phases clearly (inspect/register/preview, draft/validate/change, prepare/start/run), and most tools have unique resource-action pairings. Minor confusion exists between register_dataset and register_local_dataset, and between inspect_dataset and preview_dataset, since both deal with bounded CSV/dataset inspection.

Naming Consistency4/5

Almost every tool follows a consistent verb_noun snake_case pattern (register_dataset, preview_dataset, start_strategy_run, get_run_logs). The single outlier 'doctor' breaks the pattern, and 'list_jobs' is slightly less descriptive than the strategy-specific names, but the convention is otherwise uniform.

Tool Count2/5

30 tools is above the 25+ threshold and feels heavy for a typical MCP server, even though the lifecycle is broad. The set could be consolidated into fewer, higher-level tools or grouped behind subresources.

Completeness4/5

The server covers the full dataset/strategy/run lifecycle: ingest and derive datasets, create/validate/deploy strategy drafts, execute and compare runs, and render reports. Notable gaps are lack of dataset enumeration/listing and no explicit discard/delete operation for strategy drafts, though immutability and approval flows mitigate this.

Maintenance

ActivitySlowing
ResponsivenessNo issues