opentax

v0.2.1
io.github.Invaro/opentax Checked 16 hours ago Published 4 months ago

Verifiable US tax oracle for AI agents: cited, machine-checkable federal and state tax computation

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

calculate_tax

Compute US federal INDIVIDUAL income tax (or balance due if withholding is given) from a content-addressed corpus of cited rules. NEVER estimate tax yourself — call this, and report ONLY numbers returned by oracle calls made with the real facts (never hand-check or approximate a line the oracle can compute: your recalled parameters may be stale). Negative result = refund. Returns the answer, every assumption made, and hashes that let anyone re-verify the full derivation offline. Facts are grouped (filing, income, retirement, credits, …) — fill the groups that apply; unknown keys are reje…

calculate_business_tax

Compute US federal BUSINESS-ENTITY tax from the same cited corpus: check-the-box entity classification, Form 1120 corporate income tax (§ 179/168(k)/174A/163(j)/DRD/NOL, § 250, GBC/FTC/BEAT), S-corp entity taxes, corporate estimates, the § 4501 buyback excise, AET and PHC taxes. Individual returns → calculate_tax. Unknown keys are rejected; unmodeled territory refuses loudly with the reason.

calculate_fiduciary_tax

Compute US federal income tax for an ESTATE or TRUST (Form 1041): the § 1(e) compressed brackets and § 642(b) exemption. Input is taxable income before the exemption, after the §§ 651/661 distribution deduction. Retained capital gains refuse loudly (§ 1(h) trust breakpoints not modeled). Grantor trusts belong on the grantor's individual return via calculate_tax.

ParameterTypeDescription
asOfstringREQUIRED for computation: the law-in-force date — use the intended tax year's year-end (e.g. "2025-12-31" for TY2025). Omitting it is an error, never a default.
fiduciaryIncomeBeforeExemptionnumber | stringThe estate/trust's taxable income BEFORE the § 642(b) exemption but AFTER the §§ 651/661 income-distribution deduction (the DNI machinery is attested by this input). In dollars.
fiduciaryLongTermGainsnumber | stringNet long-term capital gain retained by the estate/trust. Any positive amount REFUSES — the § 1(h) preferential breakpoints for estates and trusts are not modeled. In dollars.
fiduciaryTypestringForm 1041 filer type for the § 642(b) exemption: estate ($600), simple trust required to distribute all income currently ($300), or complex trust ($100). Grantor trusts do not file their own tax —…
targetstringrule to derive (default: us.federal.fiduciary.income_tax).

determine_dependent

Determine whether ONE candidate person is the taxpayer's § 152 dependent — qualifying child or qualifying relative, including multiple-support agreements and the divorced-parents release — as a proof-backed yes/no with citations. Feed the result into calculate_tax's credits group (qualifyingChildren / otherDependents).

ParameterTypeDescription
asOfstringREQUIRED for computation: the law-in-force date — use the intended tax year's year-end (e.g. "2025-12-31" for TY2025). Omitting it is an error, never a default.
custodialParentReleasedClaimbooleanThe custodial parent signed a written declaration (Form 8332) releasing the claim to the child for this year (§ 152(e)(2)).
depAgeCandidate's age at the end of the year (§ 152(c)(3)).
depDivorcedParentsRuleboolean§ 152(e) applies to the candidate child: the parents are divorced, separated, or lived apart the last 6 months of the year; the child received over half their support from the parents and was in thei…
depFilesJointReturnbooleanCandidate files a joint return with a spouse (other than a refund-only claim) (§ 152(c)(1)(E)).
depGrossIncomenumber | stringCandidate's gross income for the year (§ 152(d)(1)(B) limit: $5,200 TY2025 / $5,300 TY2026). In dollars.
depIsFullTimeStudentbooleanCandidate was a full-time student for at least 5 months (§ 152(f)(2)).
depIsQualifyingChildOfAnotherbooleanCandidate is the qualifying child of the taxpayer or any other taxpayer (§ 152(d)(1)(D)).
depLivedWithTaxpayerOverHalfYearbooleanCandidate had the same principal residence as the taxpayer for more than half the year (§ 152(c)(1)(B)).
depPermanentlyDisabledbooleanCandidate is permanently and totally disabled (§ 152(c)(3)(B)).
depProvidedOwnSupportOverHalfbooleanCandidate provided more than half of their own support (§ 152(c)(1)(D)).
depRelationshipChildbooleanCandidate is the taxpayer's child, stepchild, foster child, sibling, step-sibling, or a descendant of any of them (§ 152(c)(2)).
depRelationshipRelativebooleanCandidate bears a § 152(d)(2) relationship to the taxpayer (parent, grandparent, sibling, in-law, etc.) or lived in the household all year.
depYoungerThanTaxpayerbooleanCandidate is younger than the taxpayer (§ 152(c)(3)(A)).
hasMultipleSupportAgreementbooleanA § 152(d)(3) multiple-support agreement is in place for the candidate: the group together provided over half the support, no one person provided over half, each member could otherwise claim the cand…
targetstringrule to derive (default: us.federal.dependent.is_dependent). Other targets: us.federal.dependent.qualifying_child, us.federal.dependent.qualifying_relative
taxpayerIsCustodialParentbooleanThe taxpayer is the custodial parent (the parent with whom the child resided the greater number of nights, § 152(e)(4)(A)).
taxpayerProvidedOver10PercentSupportbooleanThe taxpayer contributed over 10 percent of the candidate's support (§ 152(d)(3)(D) — the support test under a multiple-support agreement).
taxpayerProvidedOverHalfSupportbooleanThe taxpayer provided more than half of the candidate's support (§ 152(d)(1)(C)).

compute_state_return

Compose a STATE return's printed-form line set deterministically (2025 IL-1040 / VA 760 / CA 540 / NY IT-201) — correct line NUMBERS from the printed forms and whole-dollar rounding, with the state tax computed by the oracle targets internally. Workflow: run compute_return first for the federal substrate, compute any state-specific components the citations describe (additions, subtractions, credits without targets — disclose each), then call this ONCE and report its line set VERBATIM. Never hand-assemble state line numbers: transposed lines on correct dollars are the dominant state error m…

compute_return

Compute the COMPLETE scored Form 1040 line set in one call — the exact 17 lines TaxCalcBench-style evaluations grade (1a, 9, 10, 11, 12e, 15, 16, 17 AMT, 19, 22, 23, 24, 25d, 27a, 28, 32, 33, 34/37), each whole-dollar rounded by the engine. Takes the SAME input as calculate_tax (prefer the documents block: transcribe W-2/1099-R/SSA-1099 boxes and dependent birth dates — SSA-1099s are first-class, box 5 and box 6 are summed for you; the tool derives ages, classifications, Part IV withholding, and penalties deterministically). Never assemble return lines by hand — this tool is the return.…

verify_tax_claim

Verify a claimed tax amount (yours, a user's, or another tool's) against the law. Returns verdict 'verified' or 'refuted' with the correct value. Use this as a self-check before presenting any tax number. Put asOf (and target, if any) INSIDE the facts object — e.g. facts: {..., "asOf": "2025-12-31"} — otherwise the claim is checked under today's law.

ParameterTypeDescription
claimedAmount *number | stringthe amount to verify (negative = refund)
facts *objectfacts for the computation: either flat corpus fact ids (see list_input_facts) or the same group objects calculate_tax accepts (filing, income, retirement, …), plus optional target and asOf. Business…
toleranceDollarsnumberdefault 1

list_input_facts

Discover every input the tax corpus understands: id, type, whether required, and its documented default. Call this if unsure what information to collect from the user.

explain_rule

Get a tax rule's statutory citation, verbatim excerpt, validity window, parameters, and dependencies. Use to quote the actual law behind an answer.

ParameterTypeDescription
ruleId *stringe.g. "us.federal.standard_deduction" — list via calculate_tax proof or corpus

find_tax_cliffs

Find exact dollar amounts where one more cent of an input costs MORE than a cent of tax (marginal rate over 100%) — e.g. the EITC investment-income kill switch, CTC phase-out steps. Every probe is a real evaluation.

ParameterTypeDescription
facts *objectfacts for the computation: either flat corpus fact ids (see list_input_facts) or the same group objects calculate_tax accepts (filing, income, retirement, …), plus optional target and asOf. Business…
fromDollars *number
toDollars *number
vary *stringmoney fact to vary, e.g. "wages" or "taxableInterest"
stepDollarsnumbercoarse scan step, default 1000

compare_filing_statuses

Compute the answer under every filing status for the same facts — e.g. to answer 'should we file jointly or separately?'. Statuses that need more facts report their error instead of guessing.

ParameterTypeDescription
facts *objectfacts for the computation: either flat corpus fact ids (see list_input_facts) or the same group objects calculate_tax accepts (filing, income, retirement, …), plus optional target and asOf. Business…

lookup_tax_parameter

Look up the current-law dollar amounts behind a question ('standard deduction', 'CTC phase-out threshold', 'tips deduction cap') with their statutory citations and validity windows. Use this to fact-check ANY tax number before stating it — your training data likely predates the OBBBA.

ParameterTypeDescription
query *stringplain-English search, e.g. 'standard deduction'
asOfstring

verify_fact

Fact-check a claimed dollar amount about tax law ('the 2026 MFJ standard deduction is $32,200', 'CTC is $2,000 per child') against the corpus. Returns verified / refuted (with the correct value and citation) / unknown. Never states a verdict it cannot ground.

ParameterTypeDescription
claimedAmount *number | stringdollars, e.g. 50000 or "1234.56"
query *stringwhat the amount is, e.g. 'standard deduction'
asOfstring
filingStatusstring

is_tipped_occupation

Determine whether a job is on the Treasury Tipped Occupation list (Treas. Reg. § 1.224-1, final Apr 2026) for the § 224 'no tax on tips' deduction. Fuzzy-matches the job name; returns the official listing (name, TTC code, category) or a definitive 'not listed'.

ParameterTypeDescription
job *stringe.g. "bartender", "software engineer", "DJ"