get_eor_vs_entity_calc
Compare costs of using an EOR versus establishing a legal entity. Input country, headcount, and salary to get cost projections, recommendation, and break-even analysis.
Instructions
Live calculation of EOR vs setting up your own legal entity given headcount + salary. Returns 1-yr and 3-yr cost comparison, recommendation, break-even estimate, pros/cons.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| country | Yes | ||
| headcount | Yes | ||
| annual_salary_usd | Yes |
Implementation Reference
- src/main.ts:517-573 (handler)The core handler function `calcEorVsEntity` that executes the EOR vs Entity calculation logic. It takes country, headcount, and annual_salary_usd, parses markup percentages and entity setup costs from COUNTRY_BRIEFS, computes 1-year and 3-year cost comparisons, and returns a recommendation with pros/cons.
function calcEorVsEntity(country: string, headcount: number, salaryUsd: number) { const brief = COUNTRY_BRIEFS[country]; if (!brief) return { error: `Unknown country: ${country}` }; // Parse markup percentage range — take midpoint const markupMatch = brief.typical_eor_markup.match(/(\d+)-(\d+)/); const markupPct = markupMatch ? (parseInt(markupMatch[1]) + parseInt(markupMatch[2])) / 200 : 0.13; // Parse entity setup cost — take midpoint const setupMatch = brief.entity_setup_cost_usd.match(/\$([0-9KkMm,]+)-([0-9KkMm,]+)/); const parseAmount = (s: string) => { const num = parseFloat(s.replace(/[Kk,]/g, "")); return s.toLowerCase().includes("k") ? num * 1000 : num; }; const entitySetupMid = setupMatch ? (parseAmount(setupMatch[1]) + parseAmount(setupMatch[2])) / 2 : 15000; // Parse breakeven const beMatch = brief.typical_eor_breakeven_employees.match(/(\d+)-(\d+)/); const breakeven = beMatch ? Math.round((parseInt(beMatch[1]) + parseInt(beMatch[2])) / 2) : 8; const annualPayroll = headcount * salaryUsd; const eorAnnualCost = annualPayroll * markupPct; const entityAnnualOngoing = 24000; // ~$2K/mo accounting + legal + tax filings const entityYear1 = entitySetupMid + entityAnnualOngoing; const entityYear2Plus = entityAnnualOngoing; const eor3Year = eorAnnualCost * 3; const entity3Year = entitySetupMid + entityAnnualOngoing * 3; const recommendation = headcount < breakeven ? `EOR — at ${headcount} employees you're below the typical break-even of ~${breakeven} for ${brief.market}. Entity setup costs (~$${entitySetupMid.toLocaleString()}) and ongoing complexity outweigh the markup savings.` : headcount === breakeven ? `Borderline — at exactly ${breakeven} employees you're at the typical break-even. Stay on EOR if growth is uncertain. Switch to entity if you're committed to scaling 2x+ in the country.` : `Entity — at ${headcount} employees you're above the typical break-even of ~${breakeven}. Long-term, an entity is more cost-effective. EOR remains useful for the transition period (~3-6 mo).`; return { country: brief.market, inputs: { headcount, annual_salary_usd: salaryUsd }, eor: { annual_markup: `~${(markupPct * 100).toFixed(0)}% on payroll`, annual_cost_usd: Math.round(eorAnnualCost), cost_3yr_usd: Math.round(eor3Year), pros: ["Compliant from day 1", "No entity setup", "Easy exit if not scaling"], cons: ["Markup eats into margin", "Less control over benefits/perks", "Can't customize payroll"] }, entity: { setup_cost_usd: Math.round(entitySetupMid), annual_ongoing_usd: entityAnnualOngoing, year1_total_usd: Math.round(entityYear1), cost_3yr_usd: Math.round(entity3Year), pros: ["Lower long-term cost at scale", "Full control of HR, benefits, branding", "Local presence/credibility"], cons: [`Setup time: ${brief.entity_setup_time}`, "Ongoing compliance burden", "Cannot easily exit"] }, breakeven_estimate: `~${breakeven} employees`, recommendation, payroll_complexity: brief.payroll_complexity }; } - src/main.ts:688-698 (schema)Input schema definition for the tool. Defines required parameters: country (enum from COUNTRY_BRIEFS keys), headcount (integer >= 1), and annual_salary_usd (integer >= 10000).
name: "get_eor_vs_entity_calc", description: "Live calculation of EOR vs setting up your own legal entity given headcount + salary. Returns 1-yr and 3-yr cost comparison, recommendation, break-even estimate, pros/cons.", inputSchema: { type: "object", properties: { country: { type: "string", enum: Object.keys(COUNTRY_BRIEFS) }, headcount: { type: "integer", minimum: 1 }, annual_salary_usd: { type: "integer", minimum: 10000 } }, required: ["country", "headcount", "annual_salary_usd"] } - src/main.ts:746-752 (handler)The request handler case in the switch statement that extracts args and calls calcEorVsEntity, then returns the result as JSON.
case "get_eor_vs_entity_calc": { const country = args?.country as string; const headcount = args?.headcount as number; const salaryUsd = args?.annual_salary_usd as number; const result = calcEorVsEntity(country, headcount, salaryUsd); return { content: [{ type: "text", text: JSON.stringify({ module: "EOR vs Entity Calculator", ...result }, null, 2) }] }; } - src/main.ts:688-689 (registration)Tool registration entry in the tools list, with name "get_eor_vs_entity_calc" and its description.
name: "get_eor_vs_entity_calc", description: "Live calculation of EOR vs setting up your own legal entity given headcount + salary. Returns 1-yr and 3-yr cost comparison, recommendation, break-even estimate, pros/cons.",