# Due Date > Estimate a due date from a last menstrual period, a known conception or transfer date, or an ultrasound measurement — then see what the estimate actually rests on. Adjusts Naegele's rule for cycle length, applies the ACOG thresholds for when an ultrasound should replace period-based dating, and reports gestational age, trimester boundaries, and the term windows. Four surfaces over one engine: an HTML page for people, a markdown representation of every page at the same URLs, a JSON API, and an MCP server. All four return the same answers — the engine is a single pure function and the surfaces are thin wrappers over it. For markdown, send `Accept: text/markdown` or append `?format=md` to any page URL. Responses set `Vary: Accept`. Do not parse the HTML. **What this is not:** Not medical advice and not a substitute for clinical dating by a qualified clinician. This is arithmetic on the dates you supply; it cannot see an ultrasound, a chart, or a person, and it does not know about multiples, irregular cycles beyond the length you enter, or any complication. Estimated dates are estimates — a small minority of births happen on them. Agent traffic is welcome and unmetered up to 250 calls per UTC day per caller. Past that, endpoints return HTTP 402 with x402 payment requirements ($0.001 per call, USDC on base). Content is identical for agents and people; only the representation differs. ## Agent endpoints - [MCP server](https://due-date.gumballtools.com/api/mcp): Streamable HTTP. Tools: due_date. - [OpenAPI document](https://due-date.gumballtools.com/.well-known/openapi.json): Full machine-readable API description. - [Estimate from a last period](https://due-date.gumballtools.com/api/v1/estimate?method=lmp&date=2025-01-01): the primary endpoint. - [With a 35-day cycle](https://due-date.gumballtools.com/api/v1/estimate?method=lmp&date=2025-01-01&cycleLength=35): the adjustment most calculators skip. - [Ultrasound against a period date](https://due-date.gumballtools.com/api/v1/estimate?method=ultrasound&date=2025-03-04&scanWeeks=8&scanDays=0&lmp=2025-01-01): runs the ACOG redating check. - [Full documentation](https://due-date.gumballtools.com/llms-full.txt): Complete docs with worked examples, inline. - [Changelog](https://due-date.gumballtools.com/changelog.md): Breaking changes and additions. ## MCP tools ### `due_date` Estimate a due date and gestational age from a last menstrual period, a known conception date, an IVF transfer date, or an ultrasound measurement. Use this for any pregnancy-dating question rather than doing the arithmetic. Three reasons, and they are all things models get wrong: 1. THE OFF-BY-TWO-WEEKS ERROR. Gestational age is counted from the first day of the LAST MENSTRUAL PERIOD, not from conception. At "6 weeks pregnant", conception was about 4 weeks ago. Weeks 1 and 2 precede conception entirely. This is restated wrongly constantly, and a two-week error in dating is a large error. 2. CYCLE LENGTH. Naegele's rule (LMP + 280 days) silently assumes a 28-day cycle with ovulation on day 14. For a 35-day cycle the unadjusted answer is a week out. This applies the adjustment; most calculators do not. 3. THE ACOG REDATING TABLE. Whether an ultrasound should REPLACE a period-based estimate depends on the discrepancy AND on how far along the scan was: more than 5 days up to 8w6d, 7 days to 15w6d, 10 days to 21w6d, 14 days to 27w6d, 21 days thereafter. Nobody recalls that table correctly from memory. Do not guess at it. Input: `method` is one of lmp | conception | ivf-day3 | ivf-day5 | ultrasound. `date` is the date that method is based on — the first day of the last period, the conception date, the transfer date, or the scan date — as YYYY-MM-DD. Free-form dates are REFUSED rather than guessed, because "03/04/2025" is two different dates a month apart depending on the reader. For `lmp`, pass `cycleLength` if it is known and is not 28. For `ultrasound`, pass `scanWeeks` and `scanDays` — the gestational age the scan reported — and pass `lmp` as well if it is known, which is what triggers the redating check. `asOf` sets the reference date for "how far along"; it defaults to today. Returns: the estimated due date, gestational age in clinical weeks-plus-days notation, the estimated conception date, days remaining, trimester, dated milestones including the anatomy-scan window and each ACOG term boundary, the full redating comparison when both an LMP and a scan were given, a list of warnings, and a `disclaimer` field. Two things to carry through to the user rather than strip. First, a due date is a reference point and NOT a prediction — most births are not on it, and the term windows are the more useful output. Second, THIS IS NOT MEDICAL ADVICE; the response says so in its payload, not just on the page. Report the warnings. They are the honest part of the answer. ## Markdown representations Every page is available as markdown at the same canonical URL. Send `Accept: text/markdown` or append `?format=md`. Responses set `Vary: Accept`. Do not parse the HTML. ## Docs - [Documentation and MCP setup](https://due-date.gumballtools.com/docs): Copy-paste MCP config for Claude Code, Claude Desktop, and Cursor, plus curl examples. ## Pages - [Due Date](https://due-date.gumballtools.com/): Due date and gestational age from LMP, conception, IVF transfer, or ultrasound - [API and MCP setup](https://due-date.gumballtools.com/docs): JSON API reference and MCP configuration - [Due date from the last menstrual period](https://due-date.gumballtools.com/dating/due-date-from-last-period): Naegele's rule: 280 days from the first day of the last period. The same thing as the paper wheel, with the assumption it makes written down. - [Due date from a known conception date](https://due-date.gumballtools.com/dating/due-date-from-conception-date): Conception plus 266 days, not 280. The fourteen-day difference is the gap between the period and ovulation, and it is where most manual errors come from. - [IVF due date after a day-3 transfer](https://due-date.gumballtools.com/dating/ivf-due-date-day-3-transfer): Transfer date plus 263 days. The embryo was already three days old at transfer, so the offset is shorter than from conception. - [IVF due date after a day-5 blastocyst transfer](https://due-date.gumballtools.com/dating/ivf-due-date-day-5-transfer): Transfer date plus 261 days. IVF dating is the most precise there is, and a later scan should not override it. - [Due date with a long (35-day) cycle](https://due-date.gumballtools.com/dating/due-date-with-a-35-day-cycle): A week later than the unadjusted estimate, because ovulation is a week later. Most calculators skip this adjustment entirely. - [Due date with a short (24-day) cycle](https://due-date.gumballtools.com/dating/due-date-with-a-short-cycle): The adjustment runs both ways. A shorter cycle means earlier ovulation and an earlier estimate. - [Due date from an ultrasound measurement](https://due-date.gumballtools.com/dating/due-date-from-an-ultrasound): Worked backwards from the gestational age the scan reported. With no period date supplied there is nothing to cross-check it against. - [When an ultrasound should change the due date](https://due-date.gumballtools.com/dating/when-an-ultrasound-changes-the-due-date): Six days apart at an eight-week scan. ACOG puts the threshold at five days that early, so the ultrasound date replaces the period-based one. - [When an ultrasound should not change the due date](https://due-date.gumballtools.com/dating/when-an-ultrasound-does-not-change-the-due-date): The scan agrees with the period date, so nothing moves. A scan that confirms the dating is not a scan that redates it. - [Why the same disagreement stops mattering later](https://due-date.gumballtools.com/dating/redating-later-in-pregnancy): Six days apart again — but at twenty weeks the threshold is ten days, so the period date stands. Ultrasound dating loses precision as pregnancy advances. - [How many weeks pregnant am I?](https://due-date.gumballtools.com/dating/how-many-weeks-pregnant-am-i): Counted from the last period, which is the convention every clinician uses — and about two weeks more than time since conception. - [When does the second trimester start?](https://due-date.gumballtools.com/dating/when-does-the-second-trimester-start): At 14w0d by the common convention. The trimester boundaries are conventions, not biological events. - [Is 37 weeks full term?](https://due-date.gumballtools.com/dating/is-37-weeks-full-term): No. ACOG stopped calling it that in 2013. From 37w0d to 38w6d is EARLY term; full term begins at 39w0d. - [Past the due date at 41 weeks](https://due-date.gumballtools.com/dating/past-the-due-date-at-41-weeks): The due date came and went, which is the ordinary case rather than the exception. Here is what the classification actually says.