Skip to main content
Glama
seanshin0214

Dr. QuantMaster MCP Server

by seanshin0214

get_formula

Retrieve statistical formulas and LaTeX notation for quantitative research concepts like OLS estimators, DID models, and hypothesis tests.

Instructions

통계 수식 및 LaTeX 표기법 제공

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
conceptYes개념 (예: ols_estimator, did_att, hausman_test)
formatNo출력 형식

Implementation Reference

  • The main handler function for the 'get_formula' tool. It retrieves predefined statistical formulas in LaTeX and/or text format based on the input 'concept' (e.g., 'ols_estimator', 'did_att'). Returns the formula or an error if not found.
    function handleGetFormula(args: Record<string, unknown>) {
      const concept = args.concept as string;
      const format = (args.format as string) || "both";
    
      const formulas: Record<string, any> = {
        ols_estimator: {
          latex: "\\hat{\\beta} = (X'X)^{-1}X'Y",
          text: "β̂ = (X'X)⁻¹X'Y"
        },
        did_att: {
          latex: "\\text{ATT} = (\\bar{Y}_{T,post} - \\bar{Y}_{T,pre}) - (\\bar{Y}_{C,post} - \\bar{Y}_{C,pre})",
          text: "ATT = (Ȳ_T,post - Ȳ_T,pre) - (Ȳ_C,post - Ȳ_C,pre)"
        },
        hausman_test: {
          latex: "H = (\\hat{\\beta}_{FE} - \\hat{\\beta}_{RE})'[Var(\\hat{\\beta}_{FE}) - Var(\\hat{\\beta}_{RE})]^{-1}(\\hat{\\beta}_{FE} - \\hat{\\beta}_{RE})",
          text: "H = (β̂_FE - β̂_RE)'[Var(β̂_FE) - Var(β̂_RE)]⁻¹(β̂_FE - β̂_RE) ~ χ²(k)"
        },
        cohens_d: {
          latex: "d = \\frac{\\bar{X}_1 - \\bar{X}_2}{S_{pooled}}",
          text: "d = (X̄₁ - X̄₂) / S_pooled"
        },
        r_squared: {
          latex: "R^2 = 1 - \\frac{SS_{res}}{SS_{tot}} = 1 - \\frac{\\sum(y_i - \\hat{y}_i)^2}{\\sum(y_i - \\bar{y})^2}",
          text: "R² = 1 - (SS_res / SS_tot)"
        }
      };
    
      const formula = formulas[concept.toLowerCase()];
    
      if (!formula) {
        return { concept, error: "Formula not found. Try: ols_estimator, did_att, hausman_test, cohens_d, r_squared" };
      }
    
      if (format === "latex") return { concept, latex: formula.latex };
      if (format === "text") return { concept, text: formula.text };
      return { concept, ...formula };
    }
  • The input schema definition for the 'get_formula' tool, specifying the expected parameters: 'concept' (required string) and optional 'format' (latex, text, or both).
      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"],
      },
    },
  • The switch case in handleToolCall that registers and routes calls to the 'get_formula' handler function.
    case "get_formula":
      return handleGetFormula(args);

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