Skip to main content
Glama
dma9527

irs-taxpayer-mcp

by dma9527

analyze_relocation_taxes

Compare state income taxes when relocating to calculate effective combined rates, local taxes, and multi-year savings projections.

Instructions

In-depth relocation tax analysis comparing two states. Includes state income tax, effective combined rate, local taxes, and multi-year savings projection.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
taxYearYesTax year
filingStatusYes
grossIncomeYesAnnual gross income
fromStateYesCurrent state code
toStateYesTarget state code
selfEmploymentIncomeNo
capitalGainsNo
dependentsNo
yearsToProjectNoYears to project savings (default: 5)
incomeGrowthRateNoAnnual income growth rate (e.g., 0.03 for 3%)

Implementation Reference

  • The complete handler implementation for 'analyze_relocation_taxes' tool. Calculates federal tax, compares state taxes between two states, projects multi-year savings with optional income growth, analyzes SALT cap impact, and generates a comprehensive markdown report showing current year comparison, local tax considerations, and cumulative savings projection.
    server.tool(
      "analyze_relocation_taxes",
      "In-depth relocation tax analysis comparing two states. Includes state income tax, " +
      "effective combined rate, local taxes, and multi-year savings projection.",
      {
        taxYear: z.number().describe("Tax year"),
        filingStatus: FilingStatusEnum,
        grossIncome: z.number().min(0).describe("Annual gross income"),
        fromState: z.string().length(2).describe("Current state code"),
        toState: z.string().length(2).describe("Target state code"),
        selfEmploymentIncome: z.number().min(0).optional(),
        capitalGains: z.number().optional(),
        dependents: z.number().int().min(0).optional(),
        yearsToProject: z.number().int().min(1).max(10).optional().describe("Years to project savings (default: 5)"),
        incomeGrowthRate: z.number().min(0).max(0.5).optional().describe("Annual income growth rate (e.g., 0.03 for 3%)"),
      },
      async (params) => {
        const projYears = params.yearsToProject ?? 5;
        const growth = params.incomeGrowthRate ?? 0;
    
        // Federal tax (same regardless of state)
        const federal = calculateTax({
          taxYear: params.taxYear,
          filingStatus: params.filingStatus,
          grossIncome: params.grossIncome,
          selfEmploymentIncome: params.selfEmploymentIncome,
          capitalGains: params.capitalGains,
          capitalGainsLongTerm: true,
          dependents: params.dependents,
        });
    
        const stateFS = params.filingStatus === "married_filing_jointly" ? "married" as const : "single" as const;
    
        const fromResult = calculateStateTax({ stateCode: params.fromState, taxableIncome: federal.adjustedGrossIncome, filingStatus: stateFS });
        const toResult = calculateStateTax({ stateCode: params.toState, taxableIncome: federal.adjustedGrossIncome, filingStatus: stateFS });
    
        if (!fromResult || !toResult) {
          return ERRORS.invalidState(params.fromState);
        }
    
        const annualSavings = fromResult.tax - toResult.tax;
    
        // Multi-year projection
        let cumulativeSavings = 0;
        const projections: Array<{ year: number; income: number; fromTax: number; toTax: number; savings: number; cumulative: number }> = [];
    
        for (let i = 0; i < projYears; i++) {
          const yearIncome = Math.round(params.grossIncome * Math.pow(1 + growth, i));
          const yearFederal = calculateTax({
            taxYear: Math.min(params.taxYear + i, 2025),
            filingStatus: params.filingStatus,
            grossIncome: yearIncome,
          });
          const yearFrom = calculateStateTax({ stateCode: params.fromState, taxableIncome: yearFederal.adjustedGrossIncome, filingStatus: stateFS });
          const yearTo = calculateStateTax({ stateCode: params.toState, taxableIncome: yearFederal.adjustedGrossIncome, filingStatus: stateFS });
          const yearSavings = (yearFrom?.tax ?? 0) - (yearTo?.tax ?? 0);
          cumulativeSavings += yearSavings;
          projections.push({
            year: params.taxYear + i,
            income: yearIncome,
            fromTax: yearFrom?.tax ?? 0,
            toTax: yearTo?.tax ?? 0,
            savings: yearSavings,
            cumulative: cumulativeSavings,
          });
        }
    
        const lines = [
          `## 🏠 Relocation Tax Analysis`,
          `**${fromResult.stateName}** → **${toResult.stateName}** | $${fmt(params.grossIncome)} income`,
          "",
          `### Current Year Comparison`,
          `| | ${fromResult.stateName} | ${toResult.stateName} | Difference |`,
          `|---|---|---|---|`,
          `| Tax Type | ${fromResult.taxType} | ${toResult.taxType} | — |`,
          `| State Tax | $${fmt(fromResult.tax)} | $${fmt(toResult.tax)} | ${annualSavings >= 0 ? "-" : "+"}$${fmt(Math.abs(annualSavings))} |`,
          `| Effective Rate | ${(fromResult.effectiveRate * 100).toFixed(2)}% | ${(toResult.effectiveRate * 100).toFixed(2)}% | ${((toResult.effectiveRate - fromResult.effectiveRate) * 100).toFixed(2)}pp |`,
          `| Federal Tax | $${fmt(federal.totalFederalTax)} | $${fmt(federal.totalFederalTax)} | $0 |`,
          `| **Combined Tax** | **$${fmt(federal.totalFederalTax + fromResult.tax)}** | **$${fmt(federal.totalFederalTax + toResult.tax)}** | **${annualSavings >= 0 ? "-" : "+"}$${fmt(Math.abs(annualSavings))}** |`,
          "",
        ];
    
        if (annualSavings > 0) {
          lines.push(`💰 Moving to ${toResult.stateName} saves **$${fmt(annualSavings)}/year** ($${fmt(Math.round(annualSavings / 12))}/month) in state taxes.`);
        } else if (annualSavings < 0) {
          lines.push(`📈 Moving to ${toResult.stateName} costs **$${fmt(Math.abs(annualSavings))}/year** more in state taxes.`);
        } else {
          lines.push(`➡️ No state tax difference between ${fromResult.stateName} and ${toResult.stateName}.`);
        }
    
        // Local taxes warning
        if (fromResult.hasLocalTaxes || toResult.hasLocalTaxes) {
          lines.push(
            "",
            `### ⚠️ Local Tax Considerations`,
            fromResult.hasLocalTaxes ? `- ${fromResult.stateName} has local/city income taxes (not included above)` : "",
            toResult.hasLocalTaxes ? `- ${toResult.stateName} has local/city income taxes (not included above)` : "",
            `Use \`get_state_tax_info\` for specific local tax rates.`,
          );
        }
    
        // Multi-year projection
        lines.push(
          "",
          `### ${projYears}-Year Projection${growth > 0 ? ` (${(growth * 100).toFixed(0)}% annual income growth)` : ""}`,
          `| Year | Income | ${fromResult.stateName} Tax | ${toResult.stateName} Tax | Annual Savings | Cumulative |`,
          `|------|--------|---|---|---|---|`,
          ...projections.map((p) =>
            `| ${p.year} | $${fmt(p.income)} | $${fmt(p.fromTax)} | $${fmt(p.toTax)} | $${fmt(p.savings)} | $${fmt(p.cumulative)} |`
          ),
          "",
          `**${projYears}-year total savings: $${fmt(cumulativeSavings)}**`,
        );
    
        // SALT deduction impact
        const saltCap = getSaltCap(params.taxYear, params.filingStatus, params.grossIncome);
        if (fromResult.tax > saltCap) {
          lines.push(
            "",
            `### SALT Deduction Impact`,
            `Your ${fromResult.stateName} tax ($${fmt(fromResult.tax)}) exceeds the SALT cap ($${fmt(saltCap)}).`,
            `You lose $${fmt(fromResult.tax - saltCap)} in deductions due to the cap.`,
            toResult.tax <= saltCap ? `In ${toResult.stateName}, your full state tax would be deductible.` : "",
          );
        }
    
        lines.push(
          "",
          `> ⚠️ Does not include property tax, sales tax, or cost of living differences. These can significantly affect the total financial impact of relocation.`,
        );
    
        return { content: [{ type: "text", text: lines.filter(Boolean).join("\n") }] };
      }
    );
  • Input parameter schema using zod validation for the relocation tax analysis tool. Defines required parameters (taxYear, filingStatus, grossIncome, fromState, toState) and optional parameters (selfEmploymentIncome, capitalGains, dependents, yearsToProject, incomeGrowthRate).
    {
      taxYear: z.number().describe("Tax year"),
      filingStatus: FilingStatusEnum,
      grossIncome: z.number().min(0).describe("Annual gross income"),
      fromState: z.string().length(2).describe("Current state code"),
      toState: z.string().length(2).describe("Target state code"),
      selfEmploymentIncome: z.number().min(0).optional(),
      capitalGains: z.number().optional(),
      dependents: z.number().int().min(0).optional(),
      yearsToProject: z.number().int().min(1).max(10).optional().describe("Years to project savings (default: 5)"),
      incomeGrowthRate: z.number().min(0).max(0.5).optional().describe("Annual income growth rate (e.g., 0.03 for 3%)"),
    },
  • Tool registration with the MCP server. Defines the tool name 'analyze_relocation_taxes' and its description: 'In-depth relocation tax analysis comparing two states. Includes state income tax, effective combined rate, local taxes, and multi-year savings projection.'
    server.tool(
      "analyze_relocation_taxes",
      "In-depth relocation tax analysis comparing two states. Includes state income tax, " +
      "effective combined rate, local taxes, and multi-year savings projection.",
  • src/index.ts:199-199 (registration)
    Tool documentation entry in the help output listing 'analyze_relocation_taxes' under the Advanced tools section, showing it as one of 5 advanced tools available in the server.
    analyze_relocation_taxes     State relocation analysis
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. While it mentions the analysis includes specific components, it doesn't describe what the tool actually returns (format, structure), whether it makes assumptions about tax laws, accuracy limitations, or computational requirements. For a complex 10-parameter tool with no annotations, this is insufficient.

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 efficiently structured in a single sentence that front-loads the core purpose and lists key components. Every phrase adds value, though it could potentially benefit from a second sentence about output format or limitations given the tool's complexity.

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 complex 10-parameter tax analysis tool with no annotations and no output schema, the description is incomplete. It doesn't explain what the analysis output looks like, accuracy considerations, data sources, or limitations. The description covers what the analysis includes but not how the tool behaves or what it returns, which is inadequate for this level of complexity.

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 60%, so the description needs to compensate for gaps. The description mentions 'multi-year savings projection' which relates to 'yearsToProject' and 'incomeGrowthRate', and 'relocation' context relates to 'fromState' and 'toState'. However, it doesn't explain parameters like 'selfEmploymentIncome', 'capitalGains', or 'dependents' that lack schema descriptions. The description adds some context but doesn't fully compensate for the 40% coverage gap.

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 performs 'in-depth relocation tax analysis comparing two states' with specific components listed (state income tax, effective combined rate, local taxes, multi-year savings projection). It distinguishes from siblings like 'compare_state_taxes' by focusing specifically on relocation scenarios, though the distinction could be more explicit.

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 'compare_state_taxes' or 'simulate_tax_scenario'. It mentions what the analysis includes but gives no context about appropriate scenarios, prerequisites, or limitations compared to other tax tools available.

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