Skip to main content
Glama

explain factors

platform_explain_factors
Read-only

【行情】解释一次回测里各因子对收益的贡献:同一指标代码 / 区间 / 参数,逐个剔除一个因子列重跑,用指标差分(基准 − 剔除后)给出边际贡献,并把每个数字的 source 写明(基准结果 / ablate(id))。参数 runId / jobId 至少给一个,maxFactors 可选(默认 3,最大 5)。(cost: free)

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "platform_explain_factors"
  }
}

Input Schema

NameRequiredDescriptionDefault
jobIdNo回测任务 ID(run_backtest 返回,可选;经 backtest_jobs 桥接为 run)
runIdNo回测记录 ID(qd_backtest_runs.id,可选)
maxFactorsNo最多解释的因子个数(可选,默认 3,最大 5)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A3.8/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations only cover the safety profile (readOnly, non-destructive), so the description adds the meaningful behavior: it actually re-runs the backtest once per factor, producing up to maxFactors additional runs, and labels every returned number with its source (baseline result vs ablate(id)). The 'cost: free' note usefully signals that these re-runs are not billed. No contradiction with readOnlyHint, since nothing is mutated.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loaded: it says what it does and how before mentioning parameters. The single long sentence is dense but every clause carries information (method, output labeling, parameter rules, cost). Slight verbosity from the parenthetical source labels and duplicated maxFactors bounds.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

There is no output schema, and the description compensates by stating what the returned numbers mean (marginal contribution as a metric delta, each tagged with its source). Combined with the parameter constraint and the free-cost signal, an agent has what it needs to call this tool. Minor gap: no mention of failure modes when a run lacks factor columns.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so baseline is 3. The description nonetheless adds a constraint the schema does not encode (the schema lists no required fields): that at least one of runId/jobId must be supplied. The maxFactors default and cap are restated from the schema and add nothing new.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource: explain each factor's contribution to returns in a single backtest, and even names the method (leave-one-factor-out re-run, benchmark minus ablated metric). An agent can tell this is a per-factor attribution tool rather than a general backtest explanation. It stops short of explicitly naming the sibling it is not (e.g. platform_explain_backtest / platform_market_factors), so differentiation is inferential.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It gives one real usage constraint — 'runId / jobId at least one' — plus the optional maxFactors bounds and a cost note, which is enough to invoke it correctly. It never says when to prefer this over platform_explain_backtest or platform_market_factors, and gives no exclusions or prerequisites (e.g. must the run already exist and have factor columns?).

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.