Skip to main content
Glama
dma9527

irs-taxpayer-mcp

by dma9527

calculate_eitc

Calculate your exact Earned Income Tax Credit (EITC) amount based on tax year, filing status, income, and qualifying children to determine refund eligibility.

Instructions

Calculate the exact Earned Income Tax Credit (EITC) amount. The EITC is one of the largest refundable credits for low-to-moderate income workers.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
taxYearYesTax year (2024 or 2025)
filingStatusYes
earnedIncomeYesEarned income (wages, salary, self-employment)
agiYesAdjusted Gross Income
qualifyingChildrenYesNumber of qualifying children (0-3)
investmentIncomeNoInvestment income (interest, dividends, capital gains)

Implementation Reference

  • The MCP tool handler that registers 'calculate_eitc' with the server, validates input using Zod schema, calls the calculateEITC function, and formats the result into a user-friendly markdown response.
    server.tool(
      "calculate_eitc",
      "Calculate the exact Earned Income Tax Credit (EITC) amount. " +
      "The EITC is one of the largest refundable credits for low-to-moderate income workers.",
      {
        taxYear: z.number().describe("Tax year (2024 or 2025)"),
        filingStatus: z.enum(["single", "married_filing_jointly", "married_filing_separately", "head_of_household"]),
        earnedIncome: z.number().min(0).describe("Earned income (wages, salary, self-employment)"),
        agi: z.number().min(0).describe("Adjusted Gross Income"),
        qualifyingChildren: z.number().int().min(0).max(3).describe("Number of qualifying children (0-3)"),
        investmentIncome: z.number().min(0).optional().describe("Investment income (interest, dividends, capital gains)"),
      },
      async (params) => {
        const result = calculateEITC(params);
    
        if (!result.eligible) {
          const lines = [
            `## EITC Calculation — TY${params.taxYear}`,
            "",
            `❌ **Not eligible for EITC**`,
            result.reason ? `Reason: ${result.reason}` : `Income exceeds the limit for ${result.qualifyingChildren} qualifying children.`,
            "",
            `> The EITC is available for earned income up to ~$${result.incomeLimit > 0 ? result.incomeLimit.toLocaleString() : "varies"} (depending on filing status and children).`,
          ];
          return { content: [{ type: "text", text: lines.join("\n") }] };
        }
    
        const lines = [
          `## EITC Calculation — TY${params.taxYear}`,
          "",
          `| Item | Value |`,
          `|------|-------|`,
          `| Filing Status | ${params.filingStatus.replace(/_/g, " ")} |`,
          `| Earned Income | $${params.earnedIncome.toLocaleString()} |`,
          `| AGI | $${params.agi.toLocaleString()} |`,
          `| Qualifying Children | ${result.qualifyingChildren} |`,
          `| Phase | ${result.phase} |`,
          `| Max Possible Credit | $${result.maxPossibleCredit.toLocaleString()} |`,
          `| **Your EITC** | **$${result.credit.toLocaleString()}** |`,
          "",
          `✅ **Fully refundable** — you get this even if you owe no tax.`,
          "",
          result.phase === "phase-in" ? `📈 Your credit increases as your income rises (up to $${result.maxPossibleCredit.toLocaleString()}).` : "",
          result.phase === "phase-out" ? `📉 Your credit is being reduced as income exceeds the phase-out threshold.` : "",
          "",
          `> ⚠️ EITC refunds are typically delayed until mid-February. File early to get your refund sooner.`,
        ].filter(Boolean);
    
        return { content: [{ type: "text", text: lines.join("\n") }] };
      }
    );
  • The core calculation function that implements the EITC calculation logic, including eligibility checks (filing status, investment income limits), phase-in/plateau/phase-out calculations based on IRS parameters for tax years 2024 and 2025.
    export function calculateEITC(input: EITCInput): EITCResult {
      const yearData = EITC_DATA[input.taxYear];
      if (!yearData) {
        return { eligible: false, credit: 0, maxPossibleCredit: 0, phase: "ineligible", reason: `TY${input.taxYear} not supported`, qualifyingChildren: 0, incomeLimit: 0 };
      }
    
      // MFS not eligible
      if (input.filingStatus === "married_filing_separately") {
        return { eligible: false, credit: 0, maxPossibleCredit: 0, phase: "ineligible", reason: "Married filing separately cannot claim EITC", qualifyingChildren: 0, incomeLimit: 0 };
      }
    
      // Investment income check
      const investLimit = INVESTMENT_INCOME_LIMIT[input.taxYear] ?? 11600;
      if ((input.investmentIncome ?? 0) > investLimit) {
        return { eligible: false, credit: 0, maxPossibleCredit: 0, phase: "ineligible", reason: `Investment income exceeds $${investLimit.toLocaleString()} limit`, qualifyingChildren: input.qualifyingChildren, incomeLimit: 0 };
      }
    
      const children = Math.min(input.qualifyingChildren, 3); // max 3 for EITC
      const params = yearData[children];
      if (!params) {
        return { eligible: false, credit: 0, maxPossibleCredit: 0, phase: "ineligible", reason: "Invalid parameters", qualifyingChildren: children, incomeLimit: 0 };
      }
    
      const isMFJ = input.filingStatus === "married_filing_jointly";
      const phaseoutStart = isMFJ ? params.phaseoutStartMFJ : params.phaseoutStart;
      const incomeLimit = isMFJ
        ? params.completionThreshold + (params.phaseoutStartMFJ - params.phaseoutStart)
        : params.completionThreshold;
    
      // Use the greater of earned income or AGI for phase-out
      const phaseoutIncome = Math.max(input.earnedIncome, input.agi);
    
      let credit: number;
      let phase: "phase-in" | "plateau" | "phase-out" | "ineligible";
    
      if (input.earnedIncome <= 0) {
        credit = 0;
        phase = "ineligible";
      } else if (input.earnedIncome <= params.earnedIncomeThreshold) {
        // Phase-in: credit increases with income
        credit = input.earnedIncome * params.creditRate;
        phase = "phase-in";
      } else if (phaseoutIncome <= phaseoutStart) {
        // Plateau: max credit
        credit = params.maxCredit;
        phase = "plateau";
      } else if (phaseoutIncome < incomeLimit) {
        // Phase-out: credit decreases
        credit = params.maxCredit - (phaseoutIncome - phaseoutStart) * params.phaseoutRate;
        phase = "phase-out";
      } else {
        credit = 0;
        phase = "ineligible";
      }
    
      credit = Math.max(0, Math.round(credit));
    
      return {
        eligible: credit > 0,
        credit,
        maxPossibleCredit: params.maxCredit,
        phase,
        qualifyingChildren: children,
        incomeLimit,
      };
    }
  • Zod input validation schema defining the required parameters for calculate_eitc: taxYear, filingStatus, earnedIncome, agi, qualifyingChildren, and optional investmentIncome with constraints.
    {
      taxYear: z.number().describe("Tax year (2024 or 2025)"),
      filingStatus: z.enum(["single", "married_filing_jointly", "married_filing_separately", "head_of_household"]),
      earnedIncome: z.number().min(0).describe("Earned income (wages, salary, self-employment)"),
      agi: z.number().min(0).describe("Adjusted Gross Income"),
      qualifyingChildren: z.number().int().min(0).max(3).describe("Number of qualifying children (0-3)"),
      investmentIncome: z.number().min(0).optional().describe("Investment income (interest, dividends, capital gains)"),
    },
  • TypeScript interface definitions for EITCInput (tax year, filing status, income, children) and EITCResult (eligibility, credit amount, phase, reason) used by the calculator.
    export interface EITCInput {
      taxYear: number;
      filingStatus: FilingStatus;
      earnedIncome: number;
      agi: number;
      qualifyingChildren: number;
      investmentIncome?: number;
    }
    
    export interface EITCResult {
      eligible: boolean;
      credit: number;
      maxPossibleCredit: number;
      phase: "phase-in" | "plateau" | "phase-out" | "ineligible";
      reason?: string;
      qualifyingChildren: number;
      incomeLimit: number;
  • Tool registration point where 'calculate_eitc' is registered with the MCP server using server.tool() with the tool name and description.
    server.tool(
      "calculate_eitc",
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. It states the tool 'calculates' but doesn't clarify if this is a read-only operation, whether it requires authentication, what the output format might be, or any rate limits. The description adds minimal behavioral context beyond the basic action, which is insufficient for a tool with no annotations.

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 two sentences with zero waste: the first sentence directly states the tool's purpose, and the second adds useful background about the EITC's significance. It's front-loaded with the core functionality and avoids unnecessary elaboration, making it highly efficient.

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

Completeness3/5

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

The description is concise and clear for a calculation tool, but with no annotations and no output schema, it lacks details on behavioral aspects like mutability, error handling, or output format. The high schema coverage helps, but for a tool with 6 parameters and no structured safety hints, the description should ideally provide more context about what the calculation entails and any limitations.

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 description coverage is 83% (high), with all parameters except 'filingStatus' having descriptions. The description adds no additional parameter semantics beyond what the schema provides, such as explaining relationships between parameters (e.g., how earnedIncome and AGI interact) or providing examples. Given the high schema coverage, the baseline score of 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the specific verb 'calculate' and resource 'Earned Income Tax Credit (EITC) amount,' with additional context that it's 'exact' and provides background about the credit being 'one of the largest refundable credits for low-to-moderate income workers.' This distinguishes it from sibling tools like 'calculate_federal_tax' or 'list_tax_credits' by focusing specifically on EITC calculation.

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 like 'calculate_federal_tax' or 'check_credit_eligibility.' It mentions the EITC's general purpose but doesn't specify scenarios, prerequisites, or exclusions for using this particular calculation tool, leaving the agent to infer usage from the tool name 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/dma9527/irs-taxpayer-mcp'

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