estimated_quarterly_taxes
Calculate quarterly tax payments based on annual income, filing status, and self-employment status for accurate tax planning and compliance.
Instructions
Calculate estimated quarterly tax payments
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| annualIncome | Yes | ||
| filingStatus | No | single | |
| selfEmployed | No |
Implementation Reference
- src/python/tax_calculations.py:256-301 (handler)Core handler function implementing the estimated quarterly taxes calculation logic, including income adjustments, tax computations, and quarterly payment estimates.def estimated_quarterly_taxes(self, annual_income: float, filing_status: str = 'single', self_employed: bool = False) -> Dict: """Calculate estimated quarterly tax payments""" # Calculate income tax adjusted_income = annual_income if self_employed: # Deduct SE tax deduction se_tax_info = self.calculate_self_employment_tax(annual_income) adjusted_income -= se_tax_info['deductible_portion'] # Apply standard deduction standard_deduction = self.standard_deductions.get(filing_status, 13850) taxable_income = max(0, adjusted_income - standard_deduction) # Calculate federal income tax federal_tax_info = self.calculate_federal_income_tax(taxable_income, filing_status) federal_tax = federal_tax_info['total_tax'] # Add SE tax if applicable se_tax = 0 if self_employed: se_tax = self.calculate_self_employment_tax(annual_income)['total_se_tax'] total_tax = federal_tax + se_tax # Safe harbor rule (pay 100% of prior year tax or 90% of current year) safe_harbor_90 = total_tax * 0.9 quarterly_payment_90 = safe_harbor_90 / 4 return { 'annual_income': annual_income, 'adjusted_income': round(adjusted_income, 2), 'taxable_income': round(taxable_income, 2), 'federal_income_tax': round(federal_tax, 2), 'self_employment_tax': round(se_tax, 2), 'total_annual_tax': round(total_tax, 2), 'quarterly_payment_90_percent': round(quarterly_payment_90, 2), 'due_dates': [ f"{date.today().year}-01-15", # Q4 prior year f"{date.today().year}-04-15", # Q1 f"{date.today().year}-06-15", # Q2 f"{date.today().year}-09-15" # Q3 ] }
- src/tools/tax-tools.ts:134-146 (schema)Input schema defining parameters for the estimated_quarterly_taxes tool: annualIncome (required number), filingStatus (string enum with default), selfEmployed (boolean default false).inputSchema: { type: "object", properties: { annualIncome: { type: "number" }, filingStatus: { type: "string", enum: ["single", "married_filing_jointly"], default: "single" }, selfEmployed: { type: "boolean", default: false } }, required: ["annualIncome"] },
- src/tools/tax-tools.ts:131-162 (registration)Tool registration in taxTools array, including name, description, schema, and handler that proxies to Python TaxCalculator.estimated_quarterly_taxes via PythonBridge.{ name: "estimated_quarterly_taxes", description: "Calculate estimated quarterly tax payments", inputSchema: { type: "object", properties: { annualIncome: { type: "number" }, filingStatus: { type: "string", enum: ["single", "married_filing_jointly"], default: "single" }, selfEmployed: { type: "boolean", default: false } }, required: ["annualIncome"] }, handler: async (args: any): Promise<ToolResult> => { try { const result = await pythonBridge.callPythonFunction({ module: 'tax_calculations', function: 'TaxCalculator.estimated_quarterly_taxes', args: [args.annualIncome, args.filingStatus || 'single', args.selfEmployed || false] }); return result; } catch (error) { return { success: false, error: error instanceof Error ? error.message : String(error) }; } } },