Skip to main content
Glama
seanshin0214

Dr. QuantMaster MCP Server

by seanshin0214

calc_power

Calculate statistical power for hypothesis tests given sample size, effect size, and significance level to determine if a study can detect meaningful effects.

Instructions

주어진 표본크기에서 검정력 계산

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
test_typeYes검정 유형
nYes표본크기
effect_sizeYes효과크기
alphaNo유의수준

Implementation Reference

  • Primary handler for 'calc_power' tool: extracts n, effectSize, alpha; computes power via helper; returns formatted result with interpretation and R code.
    function handleCalcPower(args: Record<string, unknown>) {
      const n = args.n as number;
      const effectSize = args.effect_size as number;
      const alpha = (args.alpha as number) || 0.05;
    
      // Simplified power calculation using helper function
      const power = calculatePower(n, effectSize, alpha);
    
      return {
        n,
        effect_size: effectSize,
        alpha,
        estimated_power: Math.min(power, 0.999).toFixed(3),
        interpretation: power >= 0.80 ? "적절한 검정력 (≥80%)" : "낮은 검정력 - 표본 증가 권장",
        r_code: `pwr.t.test(n = ${n}, d = ${effectSize}, sig.level = ${alpha}, type = "two.sample")`
      };
    }
  • Core power calculation using normal approximation for two-sample t-test (non-centrality parameter, CDF). Uses normalQuantile and normalCDF.
    export function calculatePower(
      n: number,
      effectSize: number,
      alpha: number = 0.05
    ): number {
      const zAlpha = normalQuantile(1 - alpha / 2);
      const ncp = effectSize * Math.sqrt(n / 2);
      const power = 1 - normalCDF(zAlpha - ncp);
      return Math.min(Math.max(power, 0), 1);
    }
  • Tool registration in exported tools array: defines name, description, input schema (note: test_type required but unused in handler).
    {
      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"],
      },
    },
  • Dispatch registration in handleToolCall switch statement.
    case "calc_power":
      return handleCalcPower(args);
Behavior2/5

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

No annotations are provided, so the description carries full burden for behavioral disclosure. The description only states what the tool does (calculates power) without mentioning any behavioral traits - no information about what statistical methods are used, what assumptions are made, whether it's a read-only calculation, what format the output takes, or any limitations. This is inadequate for a statistical calculation tool with no annotation coverage.

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 Korean sentence that directly states the tool's purpose. There's no wasted language or unnecessary elaboration. However, the extreme brevity comes at the cost of completeness, which affects other dimensions.

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?

For a statistical calculation tool with 4 parameters, no annotations, and no output schema, the description is insufficient. It doesn't explain what statistical methods are used, what assumptions underlie the calculation, what format the result takes, or how it differs from related sibling tools. The description leaves too many contextual questions unanswered for effective tool selection and use.

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 the schema already documents all four parameters (test_type, n, effect_size, alpha) with descriptions. The tool description adds no additional parameter information beyond what's in the schema. This meets the baseline of 3 when schema coverage is high, but doesn't provide extra value.

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 as 'calculating statistical power given sample size' (주어진 표본크기에서 검정력 계산), which is a specific verb+resource combination. However, it doesn't differentiate from sibling tools like 'calc_sample_size' or 'power_curve' that likely handle related power analysis functions, so it doesn't reach the highest clarity level.

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. With multiple sibling tools related to statistical calculations (calc_effect_size, calc_sample_size, power_curve, mde_calculator), there's no indication of when this specific power calculation tool is appropriate versus other options.

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