Skip to main content
Glama
seanshin0214

Dr. QuantMaster MCP Server

by seanshin0214

power_curve

Generate power curve data for statistical tests to visualize how sample size and effect size impact detection probability, enabling researchers to design studies with adequate statistical power.

Instructions

검정력 곡선 데이터 생성 (시각화용)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
test_typeYes검정 유형
n_rangeYes[최소, 최대] 표본크기
effect_sizesYes효과크기 배열
alphaNo유의수준

Implementation Reference

  • Main handler function for 'power_curve' tool. Generates power curve data points for visualization by computing power across a range of sample sizes and effect sizes using the calculatePower helper function.
    function handlePowerCurve(args: Record<string, unknown>) {
      const nRange = args.n_range as number[];
      const effectSizes = args.effect_sizes as number[];
      const alpha = (args.alpha as number) || 0.05;
    
      const curveData: any[] = [];
      const nMin = nRange[0];
      const nMax = nRange[1];
      const step = Math.ceil((nMax - nMin) / 20);
    
      for (let n = nMin; n <= nMax; n += step) {
        for (const d of effectSizes) {
          const power = calculatePower(n, d, alpha);
          curveData.push({ n, effect_size: d, power: Math.min(power, 0.999).toFixed(3) });
        }
      }
    
      return {
        alpha,
        n_range: nRange,
        effect_sizes: effectSizes,
        curve_data: curveData,
        r_code: `library(pwr)\npower_curve <- pwr.t.test(n = seq(${nMin}, ${nMax}, by=${step}), d = c(${effectSizes.join(", ")}), sig.level = ${alpha}, type = "two.sample")`
      };
    }
  • Input schema definition for the 'power_curve' tool, specifying parameters such as test_type, n_range, effect_sizes, and alpha.
    inputSchema: {
      type: "object",
      properties: {
        test_type: { type: "string", description: "검정 유형" },
        n_range: { type: "array", items: { type: "number" }, description: "[최소, 최대] 표본크기" },
        effect_sizes: { type: "array", items: { type: "number" }, description: "효과크기 배열" },
        alpha: { type: "number", description: "유의수준" },
      },
      required: ["test_type", "n_range", "effect_sizes"],
    },
  • Tool definition object in the exported tools array, registering 'power_curve' with its name, description, and input schema.
      name: "power_curve",
      description: "검정력 곡선 데이터 생성 (시각화용)",
      inputSchema: {
        type: "object",
        properties: {
          test_type: { type: "string", description: "검정 유형" },
          n_range: { type: "array", items: { type: "number" }, description: "[최소, 최대] 표본크기" },
          effect_sizes: { type: "array", items: { type: "number" }, description: "효과크기 배열" },
          alpha: { type: "number", description: "유의수준" },
        },
        required: ["test_type", "n_range", "effect_sizes"],
      },
    },
  • Switch case in handleToolCall function that maps the 'power_curve' tool call to its handler function.
    case "power_curve":
      return handlePowerCurve(args);
  • Helper function to compute statistical power for a two-sample t-test, used by the power_curve handler to generate curve data points.
    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);
    }
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. While '데이터 생성' (data generation) implies a creation operation, the description doesn't specify whether this is a read-only calculation, a write operation that stores data, what format the output takes, or any performance characteristics. For a statistical tool with no annotation coverage, 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.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is extremely concise - a single phrase that directly states the tool's purpose. There's no wasted language, repetition, or unnecessary elaboration. It's front-loaded with the core functionality and includes the specific application (for visualization).

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 and no output schema, the description is insufficient. It doesn't explain what the tool returns (data format, structure), how the power curve is calculated, or what visualization it's preparing data for. With no annotations and no output schema, the description should provide more context about the tool's behavior and outputs.

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?

The schema has 100% description coverage, so all parameters are documented in the schema itself. The description doesn't add any parameter-specific information beyond what's already in the schema descriptions. According to the scoring rules, when schema_description_coverage is high (>80%), the baseline is 3 even with no parameter information in the description.

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: '검정력 곡선 데이터 생성 (시각화용)' translates to 'Power curve data generation (for visualization)'. This specifies both the action (data generation) and the resource (power curve), and distinguishes it from sibling tools like 'calc_power' or 'visualization_code' by focusing specifically on curve data generation rather than calculation or general visualization.

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 doesn't mention when this tool is appropriate, what prerequisites might be needed, or how it differs from similar tools like 'calc_power' or 'visualization_code'. The agent must infer usage from the name and description 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