Skip to main content
Glama

normality_test

Check if a numeric column is normally distributed via Shapiro-Wilk or D'Agostino-Pearson tests. Outputs p-value, skew, kurtosis, and normality verdict at alpha=0.05.

Instructions

normality_test —— 统计推断组 · 正态性检验(工具 9,核心实现)。

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

参数: file_path (str): 本地数据文件(csv/tsv/xlsx/json) column (str): 分析列(须为数值列) method (str, "auto"): auto / shapiro / dagostino auto: n<=5000 -> Shapiro-Wilk(scipy 官方建议 3~5000);5000<n<=100000 -> D'Agostino-Pearson(scipy.stats.normaltest);n>100000 -> 中文报错提示抽样

输出: method_used, n, statistic, p_value, skew(Fisher 样本偏度,同 describe), kurtosis(超额峰度,正态=0), normal(判定 = p_value > 0.05), threshold_alpha(固定 0.05 并在输出注明)

边界: n<3 / 常数列(方差 0)/ 显式 shapiro 但 n>5000(scipy 限制)/ dagostino 且 n<8(scipy 要求)/ 非数值或缺失列 —— 全部中文报错。

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

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
columnNo
methodNoauto
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.2/5.0
Behavior5/5

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

With no annotations, the description carries the full behavioral burden and meets it: it enumerates exact method-switching thresholds, output keys, the fixed 0.05 alpha and normal decision rule, and all Chinese-error boundary cases. This goes well beyond the schema and gives the agent a precise model of tool behavior.

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 well structured with labeled sections and front-loads the core purpose in the first line. It is longer than necessary because the maintenance/docstring note and the SPEC.md pointer are meta-information rather than invocation guidance, but the density of actionable detail justifies most of the length.

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?

For a complex inference tool with no output schema and no annotations, it covers parameters, outputs, errors, and an example. The main gap is that inline_data limits and typing are deferred to an external SPEC.md document rather than summarized inline, which leaves some behavior undocumented for an agent that cannot follow that reference.

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%, but the description documents all four parameters: file_path formats, column numeric requirement, method enum values with auto logic, and inline_data's two accepted shapes plus its mutual exclusivity with file_path. It fully compensates for the empty schema.

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 a normality test in the statistical inference group and specifies the resource being analyzed (a numeric column). It is distinguishable from siblings by its name and function, but it does not explicitly contrast itself with related tools like nonparametric_test or hypothesis_test, so it stops short of full sibling 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 provides detailed method-selection rules (auto -> Shapiro-Wilk for n<=5000, D'Agostino-Pearson for 5000<n<=100000, and an error for larger samples), boundary conditions, and a working example. However, there is no explicit statement of when to prefer normality_test over sibling tools such as nonparametric_test or describe_statistics, so the usage context is implied rather than directly stated.

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