Skip to main content
Glama

effect_size

Compute effect sizes (Cohen's d, Hedges' g, Cliff's delta) between two groups to quantify the magnitude of differences, with confidence intervals and standard thresholds.

Instructions

effect_size —— 统计推断组 · 效应量(工具 11,简化实现)。

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

参数: file_path (str): 本地数据文件(csv/tsv/xlsx/json) group_col (str): 分组列(须恰好 2 组) value_col (str): 数值列 method (str, "cohens_d"): cohens_d / hedges_g / cliff_delta paired (bool, False): True 时两组样本数必须相等,按"各自有效值序列的 第 i 个"配对(简化语义:无 ID 列时的确定性约定,见设计文档)

口径: cohens_d: |m1-m2|/pooled_sd(pooled_sd 同 hypothesis_test) hedges_g: d * (1 - 3/(4(n1+n2)-9))(小样本修正) cliff_delta: delta = (gt-lt)/(n1n2),gt/lt 为所有跨组值对比较计数(numpy 向量化, 不依赖 mannwhitneyu 的 U 定义,避免方向歧义) CI: 正态近似 se(d/g: sqrt(1/n1+1/n2+d^2/(2(n1+n2)));cliff: sqrt((1-delta^2)/(n1n2))), mean ± 1.96*se;输出注明"正态近似" 阈值(标注为经验惯例):d/g 0.2/0.5/0.8(Cohen);cliff 0.147/0.33/0.474(Romano)

【简化】略过声明: 无 bootstrap CI、无分布假设检验、cliff_delta 无配对版本。

示例: effect_size("samples/clean.csv", group_col="category", value_col="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
methodNocohens_d
pairedNo
file_pathNo
group_colNo
value_colNo
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 provided, the description carries the full behavioral burden and does so thoroughly. It discloses exact formulas, normal-approximation CI construction with 1.96*se, explicit labeling of '正态近似', empirical thresholds, simplifications (no bootstrap CI, no distribution tests, cliff_delta lacks a paired version), and the deterministic paired-matching semantics without ID columns.

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 dense and information-rich, with formulas, defaults, simplification notes, and an example all earning their place. It is long but well organized by labeled sections. Minor verbosity exists around docstring maintenance references and the inline_data section, which could be tightened without losing value.

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?

Given the tool's complexity, six parameters, no output schema, and no annotations, the description is nearly complete: it covers inputs, method semantics, constraints, and output caveats. The main gap is that it does not explicitly specify the shape or keys of the returned result object, only indicating that the CI will be labeled as '正态近似'.

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 and does fully compensate. Every parameter is explained: file_path and inline_data are explicitly alternatives, group_col and value_col have constraints, method lists valid options with defaults, and paired describes the equality requirement and matching convention. This goes well beyond the bare schema types.

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 an effect-size calculator for statistical inference, and lists the supported methods (cohens_d, hedges_g, cliff_delta) plus the input roles (group_col, value_col). It is specific about what the tool computes, though it does not explicitly contrast itself with sibling tools such as hypothesis_test or nonparametric_test.

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

Usage Guidelines2/5

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

The description gives operational constraints (e.g., group_col must have exactly 2 groups, paired samples must have equal sizes) and notes simplification choices, but it provides no explicit guidance on when to choose this tool over alternatives like hypothesis_test, anova_test, or confidence_interval. The usage context is implied rather than 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