Skip to main content
Glama

describe_statistics

Generate descriptive statistics for a dataset to assess distributions, central tendency, spread, and missingness, using a local file or inline data.

Instructions

describe_statistics —— 数据探查组 · 描述性统计(工具 1,核心实现)。

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

参数: file_path (str): 本地数据文件(csv/tsv/xlsx/json),仅接受本地路径(拒绝 UNC)

返回: 成功 {"status":"ok","result":{...},"summary":"一句话中文结论"} 失败 {"status":"error","message":"中文原因"}(error 时无 result 字段) result 结构见设计文档「工具 1」JSON Schema: {n_rows, n_columns, numeric_columns, non_numeric_columns, fully_missing_columns, columns: {<列名>: {n, mean, median, std, min, q1, q3, max, skew, kurtosis, n_missing}}}

统计定义(SPEC 裁决,测试断言口径): - 分位数 q1/q3 = linear 插值(=Excel QUARTILE.INC),Series.quantile 默认即 linear; - std 用 ddof=1(=Excel STDEV.S); - skew = scipy.stats.skew(x, bias=False)(Fisher 样本偏度); - kurtosis = scipy.stats.kurtosis(x, fisher=True, bias=False)(超额峰度,正态=0)。

边界语义(使用者已裁决): - 全缺失列:n=0、n_missing=总行数、其余统计键全 null,不中断整表; - 常数列(std=0):skew/kurtosis=null(方差为 0 无法定义); - n<2:std/q1/q3=null;n<3:skew/kurtosis=null; - 非数值列忽略统计并列入 non_numeric_columns。

示例: describe_statistics("samples/clean.csv") inline 数据: 本工具支持可选 inline_data 参数(v1.2.0 起):与 file_path 二选一, 支持 records 数组或 {"header": [...], "rows": [[...], ...]} 对象两种形态; 规模上限/类型域/data_source 来源标注见 statlab_mcp/docs/SPEC.md 第 12 节。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
file_pathNo
inline_dataNo

Schema Changelog

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

  1. First observedv1.2.0

TDQS

A4/5.0
Behavior5/5

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

With no annotations, the description carries full responsibility and delivers thoroughly: local-path-only restriction, UNC rejection, success/error shapes, exact statistical definitions (linear q1/q3, ddof=1, scipy skew/kurtosis), and edge-case semantics for missing/constant/small/non-numeric columns. This makes runtime behavior highly predictable.

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 organized into labeled sections (parameters, returns, definitions, edge cases, example, inline data), and the detail is largely earned because there is no output schema or annotations. Some meta text like 'docstring = agent 使用说明书' is unnecessary, keeping it just below top tier.

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?

It covers input formats, return schema, error shape, statistical formulas, and edge cases, which is substantial for a complex tool without annotations or an output schema. It falls short of 5 only by referencing external docs for inline-data size limits/type domains and lacking an explicit selection policy.

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?

Both parameters are given meaning far beyond the bare schema: file_path is restricted to local csv/tsv/xlsx/json paths (UNC rejected), and inline_data is described as a mutually exclusive alternative supporting records arrays or {header, rows} objects. Size limits/type domains are deferred to SPEC.md, so it is not perfectly self-contained.

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?

The description clearly identifies the tool as '数据探查组 · 描述性统计' and details its output schema (n_rows, n_columns, per-column statistics), so an agent can tell it computes descriptive statistics. It is clear on action and resource, but it never names sibling tools or explicitly states what it is not (e.g., not a hypothesis test), so it misses the strongest differentiation.

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 implies usage via '数据探查组' and an example invocation, and explains file_path vs inline_data mutual exclusivity, but it gives no explicit when-to-use vs alternatives or exclusions. An agent must infer when descriptive statistics is appropriate rather than a hypothesis test or correlation analysis.

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