Skip to main content
Glama

analysis_plan

Generate a deterministic statistical analysis plan from a natural language question. Get step-by-step tool calls and recommended methods for execution.

Instructions

analysis_plan —— 编排层 · 分析计划生成(工具 30,v1.2.0 方案 B 落地)。

把 design/08 决策树变成 100% 确定性规则工具:显式关键词表 + 列类型规则 + 表序优先级, 零 LLM、零模糊匹配;只出计划不执行(执行由外层 agent 逐步调用第一层工具)。

docstring = agent 使用说明书,与 statlab_mcp/docs/design/11_analysis_plan.md 同步维护。

参数: question (str): 必填,非空自然语言问题(空白/控制字符 → E1001) file_path (str|None): 可选数据源(与 inline_data 二选一,用于结构感知; 双缺合法 → data_aware=false、data_source=null;双给 → E1001) inline_data (list|dict|None): 内联小数据(同 file_path 二选一规则) column_hints (dict[str,str]|None): {"列名": "数值|类别|日期"} 显式类型覆盖; 值域非法 → E1001;引用不存在列 → 忽略并在 summary 注明

意图表(12 个,忠实转录 design/08 表格 11 行+头部功效路由;完整词表见 design/11): 概览/相关/类别关联/单组均值/两组比较/多组比较/预测连续/预测是否/分群/ 趋势预测/异常检测/样本量功效。多意图命中 → 按 08 表格行序取先者; 全部未命中 → fallback 计划(数据概览三件套+如实告知),不猜测任何方法。

返回: result = {intent, data_aware, data_source, chosen_methods:[{tool, reason_code, matched_keywords}], tool_calls_plan:[{step, tool, params, depends_on, needs?}], report_template:[五章], limitations:[四条]}。 summary 模板:"已生成分析计划:N 步,首选方法 X;计划由确定性规则生成, 执行请逐步调用对应工具"。

示例: analysis_plan("这两个门店的销量差多少是真实的", file_path="sales.csv") analysis_plan("帮我看看这堆数据长什么样", inline_data={"header":["v"],"rows":[[1]]})

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
questionYes
file_pathNo
inline_dataNo
column_hintsNo

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. First observedv1.2.0

TDQS

A4.7/5.0
Behavior5/5

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

With no annotations provided, the description carries the full burden and discharges it richly. It discloses deterministic rule-based behavior ('零 LLM、零模糊匹配'), fallback plan when no intent matches, multi-intent priority by table order, specific error codes (E1001) for invalid inputs, and the behavior of ignoring invalid column_hints references while noting them in the summary.

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?

The description is long but well-structured with clear sections for parameters, intent table, return value, and examples. Most content earns its place; minor meta-information like 'v1.2.0 方案 B 落地' and '与 statlab_mcp/docs/design/11_analysis_plan.md 同步维护' is useful context but not strictly needed for invoking the tool.

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

Completeness5/5

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

Given the tool's complexity, the absence of an output schema, and zero schema descriptions, the description is remarkably complete. It covers all parameters, the full intent list, fallback behavior, the result structure with keys like chosen_methods and tool_calls_plan, a summary template, and two representative examples. An agent has enough to select and call this tool correctly without external documentation.

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

Parameters5/5

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

Schema description coverage is 0%, so the description must compensate fully. It explains each parameter's meaning, requiredness, mutual exclusivity constraints, valid value domains for column_hints ('数值|类别|日期'), and error behavior for invalid values. This goes well beyond the raw type-only schema.

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

Purpose5/5

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

The description opens by identifying the tool as an orchestration-layer analysis plan generator ('编排层 · 分析计划生成') and immediately clarifies it converts a decision tree into a deterministic rule tool that '只出计划不执行' (only plans, does not execute). This clearly distinguishes it from all the sibling execution tools like hypothesis_test, linear_regression, and describe_statistics, which actually perform the analyses.

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

Usage Guidelines4/5

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

The description gives strong usage boundaries: it is for generating plans, execution is left to the outer agent calling first-layer tools, and it documents parameter preconditions (question required, file_path/inline_data mutually exclusive, both missing is legal, both provided triggers E1001). It stops short of naming specific sibling alternatives for when-to-use-not, but the orchestration-versus-execution contrast is explicit.

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

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/good-boy4069/statlab-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server