Skip to main content
Glama
seanshin0214

Dr. QuantMaster MCP Server

by seanshin0214

mde_calculator

Calculate Minimum Detectable Effect size for A/B tests and experiments using sample size, baseline, significance level, and power.

Instructions

최소탐지효과크기(MDE) 계산 - A/B 테스트, 실험설계

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
n_per_groupYes그룹당 표본크기
baselineYes기준값 (비율 또는 평균)
alphaNo유의수준
powerNo검정력
test_typeNo검정 유형

Implementation Reference

  • Implements the core logic for mde_calculator tool: calculates Minimum Detectable Effect (MDE) for proportion or mean tests using standard normal approximations for alpha=0.05 and power=0.80.
    function handleMdeCalculator(args: Record<string, unknown>) {
      const nPerGroup = args.n_per_group as number;
      const baseline = args.baseline as number;
      const alpha = (args.alpha as number) || 0.05;
      const power = (args.power as number) || 0.80;
      const testType = (args.test_type as string) || "proportion";
    
      const zAlpha = 1.96;
      const zBeta = 0.84;
    
      let mde: number;
      if (testType === "proportion") {
        const se = Math.sqrt(2 * baseline * (1 - baseline) / nPerGroup);
        mde = (zAlpha + zBeta) * se;
      } else {
        mde = (zAlpha + zBeta) / Math.sqrt(nPerGroup / 2);
      }
    
      return {
        n_per_group: nPerGroup,
        baseline,
        alpha,
        power,
        mde: mde.toFixed(4),
        mde_percentage: (mde / baseline * 100).toFixed(2) + "%",
        interpretation: `현재 표본으로 baseline 대비 ${(mde / baseline * 100).toFixed(1)}% 차이 탐지 가능`
      };
    }
  • Defines the input schema and metadata for the mde_calculator tool, including parameters for sample size per group, baseline value, significance level, power, and test type.
    {
      name: "mde_calculator",
      description: "최소탐지효과크기(MDE) 계산 - A/B 테스트, 실험설계",
      inputSchema: {
        type: "object",
        properties: {
          n_per_group: { type: "number", description: "그룹당 표본크기" },
          baseline: { type: "number", description: "기준값 (비율 또는 평균)" },
          alpha: { type: "number", description: "유의수준" },
          power: { type: "number", description: "검정력" },
          test_type: { type: "string", enum: ["proportion", "mean"], description: "검정 유형" },
        },
        required: ["n_per_group", "baseline"],
      },
  • Registers the mde_calculator tool in the exported tools array used by the MCP server.
    export const tools: Tool[] = [
      // === CATEGORY 1: Knowledge Search (5 tools) ===
      {
        name: "search_stats_knowledge",
        description: "통계/계량경제학 지식베이스 RAG 검색. 방법론, 가정, 해석 가이드 제공",
        inputSchema: {
          type: "object",
          properties: {
            query: { type: "string", description: "검색 쿼리" },
            category: {
              type: "string",
              enum: ["foundations", "regression", "econometrics", "advanced", "meta", "all"],
              description: "검색 카테고리"
            },
            n_results: { type: "number", description: "결과 수 (기본: 5)" },
          },
          required: ["query"],
        },
      },
      {
        name: "get_method_guide",
        description: "특정 통계 방법의 상세 가이드 (가정, 절차, 해석, 보고)",
        inputSchema: {
          type: "object",
          properties: {
            method: {
              type: "string",
              description: "방법론 (예: ols, panel_fe, did, sem, meta)"
            },
            aspect: {
              type: "string",
              enum: ["assumptions", "procedure", "interpretation", "reporting", "all"],
              description: "가이드 측면"
            },
          },
          required: ["method"],
        },
      },
      {
        name: "suggest_method",
        description: "연구질문과 데이터 특성에 맞는 통계 방법 추천",
        inputSchema: {
          type: "object",
          properties: {
            research_question: { type: "string", description: "연구 질문" },
            dv_type: {
              type: "string",
              enum: ["continuous", "binary", "ordinal", "count", "time_to_event", "proportion"],
              description: "종속변수 유형"
            },
            data_structure: {
              type: "string",
              enum: ["cross_sectional", "panel", "time_series", "clustered", "multilevel"],
              description: "데이터 구조"
            },
            causal_design: {
              type: "string",
              enum: ["none", "experimental", "quasi_experimental", "observational"],
              description: "인과추론 설계"
            },
          },
          required: ["research_question", "dv_type"],
        },
      },
      {
        name: "compare_methods",
        description: "여러 통계 방법 비교 (장단점, 적용조건)",
        inputSchema: {
          type: "object",
          properties: {
            methods: {
              type: "array",
              items: { type: "string" },
              description: "비교할 방법들"
            },
            criteria: {
              type: "array",
              items: { type: "string" },
              description: "비교 기준 (예: assumptions, efficiency, robustness)"
            },
          },
          required: ["methods"],
        },
      },
      {
        name: "get_formula",
        description: "통계 수식 및 LaTeX 표기법 제공",
        inputSchema: {
          type: "object",
          properties: {
            concept: { type: "string", description: "개념 (예: ols_estimator, did_att, hausman_test)" },
            format: { type: "string", enum: ["latex", "text", "both"], description: "출력 형식" },
          },
          required: ["concept"],
        },
      },
    
      // === CATEGORY 2: Sample Size & Power (5 tools) ===
      {
        name: "calc_sample_size",
        description: "필요 표본크기 계산 (t-test, ANOVA, regression, proportion)",
        inputSchema: {
          type: "object",
          properties: {
            test_type: {
              type: "string",
              enum: ["t_test_two", "t_test_paired", "anova", "regression", "proportion", "chi_square"],
              description: "검정 유형"
            },
            effect_size: { type: "number", description: "효과크기 (Cohen's d, f, f²)" },
            alpha: { type: "number", description: "유의수준 (기본: 0.05)" },
            power: { type: "number", description: "검정력 (기본: 0.80)" },
            groups: { type: "number", description: "집단 수 (ANOVA)" },
            predictors: { type: "number", description: "예측변수 수 (회귀)" },
          },
          required: ["test_type", "effect_size"],
        },
      },
      {
        name: "calc_power",
        description: "주어진 표본크기에서 검정력 계산",
        inputSchema: {
          type: "object",
          properties: {
            test_type: { type: "string", description: "검정 유형" },
            n: { type: "number", description: "표본크기" },
            effect_size: { type: "number", description: "효과크기" },
            alpha: { type: "number", description: "유의수준" },
          },
          required: ["test_type", "n", "effect_size"],
        },
      },
      {
        name: "calc_effect_size",
        description: "효과크기 계산 및 해석 (Cohen's d, η², f², OR, RR)",
        inputSchema: {
          type: "object",
          properties: {
            type: {
              type: "string",
              enum: ["cohens_d", "eta_squared", "f_squared", "odds_ratio", "correlation"],
              description: "효과크기 유형"
            },
            values: { type: "object", description: "계산에 필요한 값들" },
          },
          required: ["type", "values"],
        },
      },
      {
        name: "mde_calculator",
        description: "최소탐지효과크기(MDE) 계산 - A/B 테스트, 실험설계",
        inputSchema: {
          type: "object",
          properties: {
            n_per_group: { type: "number", description: "그룹당 표본크기" },
            baseline: { type: "number", description: "기준값 (비율 또는 평균)" },
            alpha: { type: "number", description: "유의수준" },
            power: { type: "number", description: "검정력" },
            test_type: { type: "string", enum: ["proportion", "mean"], description: "검정 유형" },
          },
          required: ["n_per_group", "baseline"],
        },
  • Registers the handler function in the main tool dispatcher switch statement.
    case "mde_calculator":
      return handleMdeCalculator(args);
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. The description only states what the tool calculates without explaining how it behaves: it doesn't mention output format, error handling, computational limitations, or whether it's a pure calculation versus a data-modifying operation. For a statistical tool with 5 parameters, this leaves significant behavioral gaps.

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 extremely concise - a single phrase that efficiently conveys the core purpose. It's front-loaded with the main function. However, the brevity comes at the cost of completeness, as it lacks necessary context for proper tool selection and usage.

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

Completeness2/5

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

Given the tool's complexity (5 parameters, statistical calculation) and the absence of both annotations and output schema, the description is insufficient. It doesn't explain what the tool returns, how results should be interpreted, or provide context about the statistical methodology. For a specialized calculation tool in a server with many statistical alternatives, more guidance is needed.

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

Parameters3/5

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

Schema description coverage is 100%, so all parameters are documented in the schema. The description adds no additional parameter information beyond what's in the schema - it doesn't explain relationships between parameters, typical values, or calculation methodology. With complete schema coverage, the baseline score of 3 is appropriate as the description doesn't enhance parameter understanding.

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 states the tool's purpose: calculating Minimum Detectable Effect (MDE) for A/B testing and experimental design. It specifies the verb 'calculate' and the resource 'MDE', making the function unambiguous. However, it doesn't explicitly differentiate from sibling tools like 'calc_power' or 'calc_sample_size', which are related statistical calculation tools in the same domain.

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 provides no guidance on when to use this tool versus alternatives. It mentions 'A/B testing, experimental design' as context, but doesn't specify prerequisites, when not to use it, or how it differs from sibling tools like 'calc_power' or 'calc_sample_size' that handle related statistical calculations. The agent must infer usage from the tool name and parameters alone.

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

Install Server

Other Tools

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/seanshin0214/quantmaster-mcp-server'

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