{"openapi":"3.1.0","info":{"title":"TestWell Agent API","version":"1.2.0","description":"Cash-pay lab tests without insurance: search TestWell's catalog, get all-in quotes by state (Quest, Labcorp, BioReference in NY/NJ), find draw sites by ZIP, look up physician-reviewed reference ranges, convert units, calculate free testosterone, compare providers and read guides. Read-only; purchases complete on test-well.com.\n\nPricing rule: sticker prices plus one flat $6.00 lab processing fee per order. All endpoints are public, read-only and rate limited (120 requests/minute/IP).","contact":{"name":"TestWell","url":"https://www.test-well.com/developers","email":"support@test-well.com"},"termsOfService":"https://www.test-well.com/terms"},"servers":[{"url":"https://www.test-well.com"}],"externalDocs":{"url":"https://www.test-well.com/developers","description":"Developer documentation"},"x-mcp":{"url":"https://www.test-well.com/mcp","serverCard":"https://www.test-well.com/.well-known/mcp/server-card.json"},"paths":{"/api/catalog.json":{"get":{"operationId":"listCatalog","summary":"Search or page TestWell's public tests and panels with per-lab prices","description":"Paged catalog. Prefer q= (keyword, biomarker, CPT, category) with limit≤50; the full catalog is ~350 KB and must be paged with limit/offset. Sticker prices; every order adds one $6 lab processing fee.","x-openai-isConsequential":false,"parameters":[{"name":"q","in":"query","schema":{"type":"string"},"description":"Search keyword, biomarker or CPT code"},{"name":"type","in":"query","schema":{"type":"string","enum":["test","panel"]}},{"name":"category","in":"query","schema":{"type":"string"}},{"name":"orderable","in":"query","schema":{"type":"boolean"},"description":"true to exclude coming-soon items"},{"name":"limit","in":"query","required":true,"schema":{"type":"integer","minimum":1,"maximum":100,"default":50},"description":"Page size — always pass it (1–100). Use q= to narrow instead of paging the whole catalog."},{"name":"offset","in":"query","schema":{"type":"integer","minimum":0,"default":0}}],"responses":{"200":{"description":"Catalog page","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CatalogResponse"}}}}}}},"/api/catalog/{slug}":{"get":{"operationId":"getCatalogItem","summary":"One test or panel by slug or id","x-openai-isConsequential":false,"parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Item","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CatalogItem"}}}},"404":{"description":"Unknown or non-public item"}}}},"/api/reference-ranges.json":{"get":{"operationId":"listReferenceRanges","summary":"Physician-reviewed reference ranges for common blood biomarkers","description":"Reviewed reference intervals with sex/age/pregnancy bands, plain-language high/low context, retest cadence and the pre-analytical factors that can move each marker. Use markers= to fetch only the markers in a patient's report. Educational, not diagnostic.","x-openai-isConsequential":false,"parameters":[{"name":"markers","in":"query","schema":{"type":"string"},"description":"Comma-separated marker slugs or names, e.g. tsh,ferritin,vitamin-d"}],"responses":{"200":{"description":"Reference-range document","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/api/agent/search_tests":{"post":{"operationId":"search_tests","summary":"Search the TestWell catalog","description":"Search TestWell's public catalog of cash-pay lab tests and panels by keyword, biomarker, CPT code, or category. Returns name, slug, per-lab prices, sample, fasting, turnaround and order URL. Prices are stickers; every order adds one $6 lab processing fee (see quote_order for all-in totals).","tags":["catalog"],"x-openai-isConsequential":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"query":{"type":"string","minLength":1,"maxLength":120,"description":"Keyword, biomarker, CPT code or health goal, e.g. 'vitamin d', 'TSH', '80053', 'cholesterol'"},"type":{"description":"Restrict to individual tests or bundled panels","type":"string","enum":["test","panel"]},"category":{"description":"Catalog category, e.g. 'Thyroid', 'Heart Health'","type":"string","maxLength":60},"orderableOnly":{"description":"Exclude items listed as coming soon (default true)","type":"boolean"},"limit":{"description":"Max results (default 10)","type":"integer","minimum":1,"maximum":50},"lang":{"description":"Return Spanish names/descriptions where a translation exists (default en)","type":"string","enum":["en","es"]}},"required":["query"]},"examples":{"example1":{"summary":"Find the 25-hydroxy vitamin D test and panels that include it","value":{"query":"vitamin d"}},"example2":{"summary":"Thyroid panels only","value":{"query":"thyroid","type":"panel","limit":5}}}}}},"responses":{"200":{"description":"Tool result","content":{"application/json":{"schema":{"type":"object","required":["tool","result"],"properties":{"tool":{"type":"string","enum":["search_tests"]},"result":{"type":"object","properties":{"query":{"type":"string"},"lang":{"type":"string"},"count":{"type":"number"},"labFee":{"type":"number","description":"USD"},"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"slug":{"type":"string"},"type":{"type":"string","enum":["test","panel"]},"name":{"type":"string"},"category":{"type":"string"},"description":{"type":"string"},"aliases":{"type":"array","items":{"type":"string"}},"cpt":{"description":"CPT code when verified","anyOf":[{"type":"string"},{"type":"null"}]},"biomarkers":{"type":"array","items":{"type":"string"}},"biomarkerCount":{"type":"number"},"sampleType":{"type":"string"},"fastingRequired":{"type":"boolean"},"resultsIn":{"description":"Turnaround, e.g. '1-3 business days'","type":"string"},"measuredTurnaround":{"description":"Measured medians from real TestWell orders (specimen at lab → final results), per lab, in days; a pair is published only when it has 30+ completed orders. Sample sizes are not published.","type":"array","items":{"type":"object","properties":{"lab":{"type":"string"},"medianDays":{"type":"number"},"p90Days":{"anyOf":[{"type":"number"},{"type":"null"}]},"asOf":{"type":"string"}},"required":["lab","medianDays","asOf"],"additionalProperties":false}},"prepInstructions":{"anyOf":[{"type":"string"},{"type":"null"}]},"eligibility":{"anyOf":[{"type":"object","properties":{"unavailableStates":{"type":"array","items":{"type":"string"}},"mustOrderAlone":{"type":"boolean"},"minAge":{"type":"number"},"attestation":{"type":"string"}},"additionalProperties":false},{"type":"null"}]},"labs":{"description":"Labs that run it: Quest, Labcorp, BioReference","type":"array","items":{"type":"string"}},"prices":{"type":"object","properties":{"quest":{"anyOf":[{"type":"number","description":"USD"},{"type":"null"}]},"labcorp":{"anyOf":[{"type":"number","description":"USD"},{"type":"null"}]},"bioreference":{"anyOf":[{"type":"number","description":"USD"},{"type":"null"}]}},"additionalProperties":{},"description":"Sticker price per lab; null where the lab does not run the item"},"labFee":{"description":"Flat per-order lab processing fee (charged once per order)","type":"number"},"currency":{"type":"string"},"orderable":{"type":"boolean"},"url":{"type":"string","description":"Absolute https URL on test-well.com"},"markdownUrl":{"type":"string","description":"Absolute https URL on test-well.com"},"orderUrl":{"description":"Prefilled cart link","type":"string"},"reviewedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"popular":{"type":"boolean"}},"additionalProperties":{}}}},"additionalProperties":{}}}}}}},"400":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ToolError"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ToolError"}}}}}}},"/api/agent/get_test":{"post":{"operationId":"get_test","summary":"Get a test or panel","description":"Full public detail for one TestWell test or panel by slug or id: description, biomarkers, CPT, per-lab prices, labs, fasting/prep, turnaround, included tests (panels), FAQ, related conditions, order URL and a Markdown page URL.","tags":["catalog"],"x-openai-isConsequential":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"slug":{"type":"string","minLength":1,"maxLength":120,"description":"Catalog slug (from search_tests) or id, e.g. 'tsh', 'general-wellness-panel'"},"lang":{"description":"Spanish prose where a translation exists (default en)","type":"string","enum":["en","es"]}},"required":["slug"]},"examples":{"example1":{"summary":"The annual-checkup panel with its four included tests","value":{"slug":"general-wellness-panel"}}}}}},"responses":{"200":{"description":"Tool result","content":{"application/json":{"schema":{"type":"object","required":["tool","result"],"properties":{"tool":{"type":"string","enum":["get_test"]},"result":{"type":"object","properties":{"found":{"type":"boolean"},"item":{"type":"object","properties":{"id":{"type":"string"},"slug":{"type":"string"},"type":{"type":"string","enum":["test","panel"]},"name":{"type":"string"},"category":{"type":"string"},"description":{"type":"string"},"aliases":{"type":"array","items":{"type":"string"}},"cpt":{"description":"CPT code when verified","anyOf":[{"type":"string"},{"type":"null"}]},"biomarkers":{"type":"array","items":{"type":"string"}},"biomarkerCount":{"type":"number"},"sampleType":{"type":"string"},"fastingRequired":{"type":"boolean"},"resultsIn":{"description":"Turnaround, e.g. '1-3 business days'","type":"string"},"measuredTurnaround":{"description":"Measured medians from real TestWell orders (specimen at lab → final results), per lab, in days; a pair is published only when it has 30+ completed orders. Sample sizes are not published.","type":"array","items":{"type":"object","properties":{"lab":{"type":"string"},"medianDays":{"type":"number"},"p90Days":{"anyOf":[{"type":"number"},{"type":"null"}]},"asOf":{"type":"string"}},"required":["lab","medianDays","asOf"],"additionalProperties":false}},"prepInstructions":{"anyOf":[{"type":"string"},{"type":"null"}]},"eligibility":{"anyOf":[{"type":"object","properties":{"unavailableStates":{"type":"array","items":{"type":"string"}},"mustOrderAlone":{"type":"boolean"},"minAge":{"type":"number"},"attestation":{"type":"string"}},"additionalProperties":false},{"type":"null"}]},"labs":{"description":"Labs that run it: Quest, Labcorp, BioReference","type":"array","items":{"type":"string"}},"prices":{"type":"object","properties":{"quest":{"anyOf":[{"type":"number","description":"USD"},{"type":"null"}]},"labcorp":{"anyOf":[{"type":"number","description":"USD"},{"type":"null"}]},"bioreference":{"anyOf":[{"type":"number","description":"USD"},{"type":"null"}]}},"additionalProperties":{},"description":"Sticker price per lab; null where the lab does not run the item"},"labFee":{"description":"Flat per-order lab processing fee (charged once per order)","type":"number"},"currency":{"type":"string"},"orderable":{"type":"boolean"},"url":{"type":"string","description":"Absolute https URL on test-well.com"},"markdownUrl":{"type":"string","description":"Absolute https URL on test-well.com"},"orderUrl":{"description":"Prefilled cart link","type":"string"},"reviewedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"popular":{"type":"boolean"}},"additionalProperties":{}},"suggestions":{"type":"array","items":{"type":"string"}}},"additionalProperties":{}}}}}}},"400":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ToolError"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ToolError"}}}}}}},"/api/agent/list_panels":{"post":{"operationId":"list_panels","summary":"List panels","description":"List TestWell's bundled panels (multi-test packages priced below the sum of their tests), optionally filtered by category or maximum price. Sorted by price.","tags":["catalog"],"x-openai-isConsequential":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"category":{"description":"Catalog category, e.g. 'Hormones', 'General Health'","type":"string","maxLength":60},"maxPrice":{"description":"Only panels at or under this sticker price (USD)","type":"number","exclusiveMinimum":0},"limit":{"description":"Max results (default 25)","type":"integer","minimum":1,"maximum":100}}},"examples":{"example1":{"summary":"Panels under $100","value":{"maxPrice":100}}}}}},"responses":{"200":{"description":"Tool result","content":{"application/json":{"schema":{"type":"object","required":["tool","result"],"properties":{"tool":{"type":"string","enum":["list_panels"]},"result":{"type":"object","properties":{"count":{"type":"number"},"labFee":{"type":"number","description":"USD"},"panels":{"type":"array","items":{"type":"object","properties":{"slug":{"type":"string"},"name":{"type":"string"},"price":{"type":"number","description":"USD"},"prices":{"type":"object","properties":{"quest":{"anyOf":[{"type":"number","description":"USD"},{"type":"null"}]},"labcorp":{"anyOf":[{"type":"number","description":"USD"},{"type":"null"}]},"bioreference":{"anyOf":[{"type":"number","description":"USD"},{"type":"null"}]}},"additionalProperties":{},"description":"Sticker price per lab; null where the lab does not run the item"},"tests":{"description":"Number of tests in the panel","type":"number"},"biomarkers":{"description":"Number of biomarkers reported","type":"number"},"category":{"type":"string"},"labs":{"type":"array","items":{"type":"string"}},"url":{"type":"string","description":"Absolute https URL on test-well.com"},"orderUrl":{"type":"string","description":"Absolute https URL on test-well.com"}},"additionalProperties":{}}}},"additionalProperties":{}}}}}}},"400":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ToolError"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ToolError"}}}}}}},"/api/agent/recommend_tests":{"post":{"operationId":"recommend_tests","summary":"Recommend tests for goals or symptoms","description":"Suggest TestWell panels and tests for stated health goals (e.g. 'annual checkup', 'heart health', 'TRT monitoring') and/or symptoms (e.g. 'fatigue', 'hair loss'). Prefers a curated pre-built panel when one fits; otherwise assembles individual tests within a budget.","tags":["catalog"],"x-openai-isConsequential":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"goals":{"description":"Health goals, e.g. ['energy', 'thyroid']","maxItems":8,"type":"array","items":{"type":"string","maxLength":60}},"symptoms":{"description":"Symptoms, e.g. ['always cold', 'weight gain']","maxItems":8,"type":"array","items":{"type":"string","maxLength":60}},"budget":{"description":"Budget band: low ≈ $80, medium ≈ $200, high ≈ $400","type":"string","enum":["low","medium","high","no_limit"]}}},"examples":{"example1":{"summary":"Returns the General Wellness Panel","value":{"goals":["annual checkup"],"budget":"low"}},"example2":{"summary":"Symptom mapping to ferritin, thyroid, vitamin D and matching panels","value":{"symptoms":["fatigue","hair loss"]}}}}}},"responses":{"200":{"description":"Tool result","content":{"application/json":{"schema":{"type":"object","required":["tool","result"],"properties":{"tool":{"type":"string","enum":["recommend_tests"]},"result":{"type":"object","properties":{"goals":{"type":"array","items":{"type":"string"}},"symptoms":{"type":"array","items":{"type":"string"}},"byGoal":{"description":"Recommended panel and alternatives for the stated goals","anyOf":[{"type":"object","properties":{},"additionalProperties":{}},{"type":"null"}]},"bySymptom":{"description":"Panels, individual tests and explanations for the stated symptoms","anyOf":[{"type":"object","properties":{},"additionalProperties":{}},{"type":"null"}]},"labFee":{"type":"number","description":"USD"},"next":{"description":"Suggested next tool call","type":"string"},"disclaimer":{"type":"string"}},"additionalProperties":{}}}}}}},"400":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ToolError"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ToolError"}}}}}}},"/api/agent/quote_order":{"post":{"operationId":"quote_order","summary":"All-in order quote","description":"Price a set of tests/panels exactly as TestWell's checkout would: per-lab prices for the user's state (New York and New Jersey route to BioReference; Rhode Island is not served), the single $6 lab processing fee, the total, items that can't be ordered and why, and a prefilled cart URL.","tags":["quote"],"x-openai-isConsequential":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"minItems":1,"maxItems":25,"type":"array","items":{"type":"string","minLength":1,"maxLength":120},"description":"Catalog slugs or ids, e.g. ['tsh', 'vitamin-d']"},"state":{"description":"US state code or name where the user will be drawn, e.g. 'FL' or 'Florida'","type":"string","minLength":2,"maxLength":40},"lab":{"description":"Preferred lab outside NY/NJ (default quest)","type":"string","enum":["quest","labcorp","bioreference"]}},"required":["items"]},"examples":{"example1":{"summary":"Two tests in Florida at Quest","value":{"items":["tsh","vitamin-d"],"state":"FL","lab":"quest"}},"example2":{"summary":"Routed to BioReference with its price","value":{"items":["general-wellness-panel"],"state":"NY"}}}}}},"responses":{"200":{"description":"Tool result","content":{"application/json":{"schema":{"type":"object","required":["tool","result"],"properties":{"tool":{"type":"string","enum":["quote_order"]},"result":{"type":"object","properties":{"ok":{"type":"boolean"},"error":{"description":"Present when ok=false, e.g. state not served","type":"string"},"state":{"type":"string"},"lab":{"type":"string"},"labName":{"type":"string"},"lines":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"slug":{"type":"string"},"type":{"type":"string"},"name":{"type":"string"},"lab":{"type":"string"},"price":{"type":"number","description":"USD"},"url":{"type":"string","description":"Absolute https URL on test-well.com"}},"additionalProperties":{}}},"unavailable":{"description":"Requested items the routed lab cannot run in this state","type":"array","items":{}},"subtotal":{"type":"number","description":"USD"},"labFee":{"type":"number","description":"USD"},"total":{"description":"All-in total: subtotal + the single lab processing fee","type":"number"},"currency":{"type":"string"},"checkoutUrl":{"description":"Prefilled cart on test-well.com — purchases complete there; null when nothing is orderable","anyOf":[{"type":"string","description":"Absolute https URL on test-well.com"},{"type":"null"}]},"notes":{"type":"array","items":{"type":"string"}}},"additionalProperties":{}}}}}}},"400":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ToolError"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ToolError"}}}}}}},"/api/agent/create_checkout":{"post":{"operationId":"create_checkout","summary":"Create a checkout session","description":"Start a TestWell order for the user: tests/panels, the US state where they will visit the lab (required for pricing and lab routing), and the buyer's name, email and phone.","tags":["checkout"],"x-openai-isConsequential":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"minItems":1,"maxItems":25,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":120,"description":"Test or panel slug/id"},"quantity":{"type":"integer","minimum":1,"maximum":1}},"required":["id"]}},"state":{"description":"US state code or name where the blood will be drawn","type":"string","minLength":2,"maxLength":40},"buyer":{"type":"object","properties":{"first_name":{"type":"string","maxLength":80},"last_name":{"type":"string","maxLength":80},"email":{"type":"string","format":"email","pattern":"^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"phone_number":{"type":"string","maxLength":20}}},"dry_run":{"description":"Price only; do not create a session","type":"boolean"}},"required":["items"]},"examples":{"example1":{"summary":"Preview pricing for two tests in Florida","value":{"items":[{"id":"tsh"},{"id":"vitamin-d"}],"state":"FL","dry_run":true}},"example2":{"summary":"Create a session ready for payment","value":{"items":[{"id":"general-wellness-panel"}],"state":"TX","buyer":{"first_name":"Ana","last_name":"Ruiz","email":"ana@example.com"}}}}}}},"responses":{"200":{"description":"Tool result","content":{"application/json":{"schema":{"type":"object","required":["tool","result"],"properties":{"tool":{"type":"string","enum":["create_checkout"]},"result":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string","enum":["not_ready_for_payment","ready_for_payment","in_progress","completed","canceled"]},"currency":{"type":"string","const":"usd"},"line_items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"item":{"type":"object","properties":{"id":{"type":"string"},"quantity":{"type":"number"}},"required":["id","quantity"],"additionalProperties":false},"base_amount":{"type":"number"},"subtotal":{"type":"number"},"total":{"type":"number"},"name":{"type":"string"},"lab":{"type":"string"},"url":{"type":"string"}},"required":["id","item","base_amount","subtotal","total"],"additionalProperties":{}}},"totals":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string"},"display_text":{"type":"string"},"amount":{"type":"number"}},"required":["type","display_text","amount"],"additionalProperties":false}},"messages":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["info","error"]},"content":{"type":"string"},"param":{"type":"string"}},"required":["type","content"],"additionalProperties":{}}},"fulfillment_options":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","const":"digital"},"id":{"type":"string"},"title":{"type":"string"}},"required":["type","id","title"],"additionalProperties":{}}},"links":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string"},"url":{"type":"string"}},"required":["type","url"],"additionalProperties":false}},"pay_online_url":{"description":"Prefilled cart for browser payment when the platform has no payment token","anyOf":[{"type":"string"},{"type":"null"}]},"order":{"type":"object","properties":{"id":{"type":"string"},"checkout_session_id":{"type":"string"},"permalink_url":{"type":"string"}},"required":["id","checkout_session_id","permalink_url"],"additionalProperties":false},"dry_run":{"type":"boolean"}},"required":["id","status","currency","line_items","totals","messages","fulfillment_options","links"],"additionalProperties":{}}}}}}},"400":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ToolError"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ToolError"}}}}}}},"/api/agent/update_checkout":{"post":{"operationId":"update_checkout","summary":"Update a checkout session","description":"Change items, state or buyer details on an open checkout session and get it re-priced. Returns the same session object as create_checkout.","tags":["checkout"],"x-openai-isConsequential":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"checkout_session_id":{"type":"string","minLength":8,"maxLength":80},"items":{"minItems":1,"maxItems":25,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":120},"quantity":{"type":"integer","minimum":1,"maximum":1}},"required":["id"]}},"state":{"type":"string","minLength":2,"maxLength":40},"buyer":{"type":"object","properties":{"first_name":{"type":"string","maxLength":80},"last_name":{"type":"string","maxLength":80},"email":{"type":"string","format":"email","pattern":"^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"phone_number":{"type":"string","maxLength":20}}}},"required":["checkout_session_id"]},"examples":{"example1":{"summary":"Re-route to BioReference pricing for New York","value":{"checkout_session_id":"cs_agent_…","state":"NY"}}}}}},"responses":{"200":{"description":"Tool result","content":{"application/json":{"schema":{"type":"object","required":["tool","result"],"properties":{"tool":{"type":"string","enum":["update_checkout"]},"result":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string"},"line_items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"total":{"type":"number"}},"required":["id","total"],"additionalProperties":{}}},"totals":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string"},"display_text":{"type":"string"},"amount":{"type":"number"}},"required":["type","display_text","amount"],"additionalProperties":false}},"messages":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["info","error"]},"content":{"type":"string"}},"required":["type","content"],"additionalProperties":{}}}},"required":["id","status","line_items","totals","messages"],"additionalProperties":{}}}}}}},"400":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ToolError"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ToolError"}}}}}}},"/api/agent/get_checkout":{"post":{"operationId":"get_checkout","summary":"Read a checkout session","description":"Current state of a checkout session (status, line items, totals, messages, order once paid). Read-only.","tags":["checkout"],"x-openai-isConsequential":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"checkout_session_id":{"type":"string","minLength":8,"maxLength":80}},"required":["checkout_session_id"]},"examples":{"example1":{"summary":"Poll a session","value":{"checkout_session_id":"cs_agent_…"}}}}}},"responses":{"200":{"description":"Tool result","content":{"application/json":{"schema":{"type":"object","required":["tool","result"],"properties":{"tool":{"type":"string","enum":["get_checkout"]},"result":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string"},"line_items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"total":{"type":"number"}},"required":["id","total"],"additionalProperties":{}}},"totals":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string"},"display_text":{"type":"string"},"amount":{"type":"number"}},"required":["type","display_text","amount"],"additionalProperties":false}},"messages":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["info","error"]},"content":{"type":"string"}},"required":["type","content"],"additionalProperties":{}}}},"required":["id","status","line_items","totals","messages"],"additionalProperties":{}}}}}}},"400":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ToolError"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ToolError"}}}}}}},"/api/agent/cancel_checkout":{"post":{"operationId":"cancel_checkout","summary":"Cancel a checkout session","description":"Cancel an open (unpaid) checkout session. Paid sessions cannot be canceled here — the patient's complete-details email explains refunds.","tags":["checkout"],"x-openai-isConsequential":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"checkout_session_id":{"type":"string","minLength":8,"maxLength":80}},"required":["checkout_session_id"]},"examples":{"example1":{"summary":"User changed their mind","value":{"checkout_session_id":"cs_agent_…"}}}}}},"responses":{"200":{"description":"Tool result","content":{"application/json":{"schema":{"type":"object","required":["tool","result"],"properties":{"tool":{"type":"string","enum":["cancel_checkout"]},"result":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string"}},"required":["id","status"],"additionalProperties":{}}}}}}},"400":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ToolError"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ToolError"}}}}}}},"/api/agent/complete_checkout":{"post":{"operationId":"complete_checkout","summary":"Pay and place the order","description":"Charge the payment credential the platform obtained for a session that is ready_for_payment and create the order. Input follows the ChatGPT payment-sheet contract: checkout_session_id, buyer, payment_data { token, provider: 'stripe', billing_address }.","tags":["checkout"],"x-openai-isConsequential":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"checkout_session_id":{"type":"string","minLength":8,"maxLength":80},"buyer":{"anyOf":[{"type":"object","properties":{"name":{"anyOf":[{"type":"string","maxLength":160},{"type":"null"}]},"first_name":{"anyOf":[{"type":"string","maxLength":80},{"type":"null"}]},"last_name":{"anyOf":[{"type":"string","maxLength":80},{"type":"null"}]},"email":{"anyOf":[{"type":"string","format":"email","pattern":"^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},{"type":"null"}]},"phone_number":{"anyOf":[{"type":"string","maxLength":20},{"type":"null"}]}}},{"type":"null"}]},"payment_data":{"type":"object","properties":{"token":{"type":"string","minLength":4,"maxLength":400},"provider":{"description":"'stripe'","type":"string","maxLength":40},"billing_address":{"anyOf":[{"type":"object","properties":{"name":{"type":"string"},"line_one":{"type":"string"},"line_two":{"type":"string"},"city":{"type":"string"},"state":{"type":"string"},"country":{"type":"string"},"postal_code":{"type":"string"}}},{"type":"null"}]}},"required":["token"]},"idempotency_key":{"type":"string","maxLength":128}},"required":["checkout_session_id","payment_data"]},"examples":{"example1":{"summary":"Complete with a shared payment token","value":{"checkout_session_id":"cs_agent_…","buyer":{"first_name":"Ana","last_name":"Ruiz","email":"ana@example.com"},"payment_data":{"token":"spt_…","provider":"stripe"}}}}}}},"responses":{"200":{"description":"Tool result","content":{"application/json":{"schema":{"type":"object","required":["tool","result"],"properties":{"tool":{"type":"string","enum":["complete_checkout"]},"result":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string"},"totals":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string"},"display_text":{"type":"string"},"amount":{"type":"number"}},"required":["type","display_text","amount"],"additionalProperties":false}},"messages":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["info","error"]},"content":{"type":"string"}},"required":["type","content"],"additionalProperties":{}}},"order":{"type":"object","properties":{"id":{"type":"string"},"checkout_session_id":{"type":"string"},"permalink_url":{"type":"string"}},"required":["id","checkout_session_id","permalink_url"],"additionalProperties":false}},"required":["id","status","totals","messages"],"additionalProperties":{}}}}}}},"400":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ToolError"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ToolError"}}}}}}},"/api/agent/find_draw_sites":{"post":{"operationId":"find_draw_sites","summary":"Find draw sites near a ZIP","description":"Find Quest Diagnostics, Labcorp and BioReference patient service centers near a US ZIP code, with address, distance, phone and hours. Walk-ins are accepted at most sites; the requisition arrives by email after physician authorization.","tags":["locations"],"x-openai-isConsequential":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"zip":{"type":"string","pattern":"^\\d{5}$","description":"5-digit US ZIP code"},"radiusMiles":{"description":"Search radius in miles (snapped to 10/20/25/50/100; default 25)","type":"integer","minimum":5,"maximum":100},"lab":{"description":"Limit to one lab","type":"string","enum":["quest","labcorp","bioreference"]},"limit":{"description":"Max sites (default 10)","type":"integer","minimum":1,"maximum":50}},"required":["zip"]},"examples":{"example1":{"summary":"Sites near Fort Lauderdale","value":{"zip":"33301","radiusMiles":10}}}}}},"responses":{"200":{"description":"Tool result","content":{"application/json":{"schema":{"type":"object","required":["tool","result"],"properties":{"tool":{"type":"string","enum":["find_draw_sites"]},"result":{"type":"object","properties":{"zip":{"type":"string"},"radiusMiles":{"type":"number"},"count":{"type":"number"},"sites":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"address":{"type":"string"},"city":{"type":"string"},"state":{"type":"string"},"zip":{"type":"string"},"phone":{"anyOf":[{"type":"string"},{"type":"null"}]},"lab":{"type":"string"},"distance":{"description":"Miles from the ZIP centroid","type":"number"},"hours":{}},"additionalProperties":{}}},"mapUrl":{"type":"string","description":"Absolute https URL on test-well.com"}},"additionalProperties":{}}}}}}},"400":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ToolError"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ToolError"}}}}}}},"/api/agent/lookup_reference_range":{"post":{"operationId":"lookup_reference_range","summary":"Reference range for a biomarker","description":"Physician-reviewed reference range for a blood test marker (130+ markers), filtered by sex and age when they matter, with what high and low values suggest, retest cadence, how to get tested, cited sources and the review date. Educational; the user's own report range takes precedence.","tags":["reference"],"x-openai-isConsequential":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"marker":{"type":"string","minLength":1,"maxLength":80,"description":"Marker name or alias, e.g. 'TSH', 'ferritin', 'HbA1c', 'LDL'"},"sex":{"type":"string","enum":["male","female"]},"age":{"type":"integer","minimum":0,"maximum":120},"pregnancy":{"type":"boolean"},"postmenopausal":{"type":"boolean"}},"required":["marker"]},"examples":{"example1":{"summary":"Sex-specific ferritin band","value":{"marker":"ferritin","sex":"female","age":34}}}}}},"responses":{"200":{"description":"Tool result","content":{"application/json":{"schema":{"type":"object","required":["tool","result"],"properties":{"tool":{"type":"string","enum":["lookup_reference_range"]},"result":{"type":"object","properties":{"found":{"type":"boolean"},"marker":{"type":"string"},"aliases":{"type":"array","items":{"type":"string"}},"category":{"type":"string"},"units":{"type":"array","items":{"type":"string"}},"measures":{"type":"string"},"filteredToQuery":{"type":"boolean"},"ranges":{"type":"array","items":{"type":"object","properties":{"qualifier":{"description":"Who the band applies to, e.g. 'Female, age 18+'","type":"string"},"range":{"type":"string"},"min":{"type":"number"},"max":{"type":"number"},"unit":{"type":"string"}},"additionalProperties":{}}},"highSuggests":{"anyOf":[{"type":"string"},{"type":"null"}]},"lowSuggests":{"anyOf":[{"type":"string"},{"type":"null"}]},"retest":{"anyOf":[{"type":"string"},{"type":"null"}]},"howToTest":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"kind":{"type":"string"},"price":{"type":"number","description":"USD"},"url":{"type":"string","description":"Absolute https URL on test-well.com"}},"additionalProperties":{}}},"citations":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string"},"url":{"type":"string"}},"additionalProperties":{}}},"suggestions":{"type":"array","items":{"type":"string"}},"browse":{"type":"string"}},"additionalProperties":{}}}}}}},"400":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ToolError"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ToolError"}}}}}}},"/api/agent/compare_prices":{"post":{"operationId":"compare_prices","summary":"Compare all-in prices across providers for a test","description":"For one blood test, the all-in single-test price (sticker + per-order fees) at TestWell and at every tracked direct-to-consumer provider with a verified equivalent — JustLabs, Quest, Labcorp OnDemand, Ulta Lab Tests, Walk-In Lab, HealthLabs and more — each with the date it was verified, plus…","tags":["compare"],"x-openai-isConsequential":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"test":{"type":"string","minLength":1,"maxLength":80,"description":"Test slug or name, e.g. 'tsh', 'lipid panel', 'vitamin-d'"}},"required":["test"]},"examples":{"example1":{"summary":"TSH all-in at TestWell vs JustLabs, Quest, Labcorp and others","value":{"test":"tsh"}}}}}},"responses":{"200":{"description":"Tool result","content":{"application/json":{"schema":{"type":"object","required":["tool","result"],"properties":{"tool":{"type":"string","enum":["compare_prices"]},"result":{"type":"object","properties":{"found":{"type":"boolean"},"test":{"type":"object","properties":{"name":{"type":"string"},"slug":{"type":"string"},"cpt":{"anyOf":[{"type":"string"},{"type":"null"}]},"category":{"type":"string"}},"additionalProperties":{}},"cheapestSingleTestAllIn":{"type":"object","properties":{"provider":{"type":"string"},"providerName":{"type":"string"},"sticker":{"type":"number","description":"USD"},"perOrderFees":{"type":"number","description":"USD"},"allIn":{"description":"Sticker + that provider's per-order fees, one test ordered alone","type":"number"},"pricedAt":{"description":"Date the price was verified (YYYY-MM-DD)","type":"string"},"url":{"type":"string"},"note":{"anyOf":[{"type":"string"},{"type":"null"}]}},"additionalProperties":{}},"providers":{"description":"Sorted by all-in price, TestWell included","type":"array","items":{"type":"object","properties":{"provider":{"type":"string"},"providerName":{"type":"string"},"sticker":{"type":"number","description":"USD"},"perOrderFees":{"type":"number","description":"USD"},"allIn":{"description":"Sticker + that provider's per-order fees, one test ordered alone","type":"number"},"pricedAt":{"description":"Date the price was verified (YYYY-MM-DD)","type":"string"},"url":{"type":"string"},"note":{"anyOf":[{"type":"string"},{"type":"null"}]}},"additionalProperties":{}}},"reference":{"type":"object","properties":{"hospitalTypical":{"anyOf":[{"type":"number","description":"USD"},{"type":"null"}]},"questDirect":{"anyOf":[{"type":"number","description":"USD"},{"type":"null"}]}},"additionalProperties":{}},"caveats":{"type":"array","items":{"type":"string"}},"dataset":{"type":"string","description":"Absolute https URL on test-well.com"},"methodology":{"type":"string"},"license":{"type":"string"},"query":{"type":"string"},"hint":{"type":"string"}},"additionalProperties":{}}}}}}},"400":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ToolError"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ToolError"}}}}}}},"/api/agent/interpret_results":{"post":{"operationId":"interpret_results","summary":"Explain lab results against reviewed reference ranges","description":"Flag each pasted lab value as low / normal / high against TestWell's physician-reviewed reference catalog (130+ markers; sex- and age-specific bands where they exist), with the reviewed 'what high/low suggests' copy, retest guidance, cited sources and links to the marker's page and, where one…","tags":["reference"],"x-openai-isConsequential":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"values":{"minItems":1,"maxItems":40,"type":"array","items":{"type":"object","properties":{"marker":{"type":"string","minLength":1,"maxLength":80},"value":{"type":"number"},"unit":{"type":"string","maxLength":20}},"required":["marker","value"]},"description":"Results to explain, e.g. [{marker:'TSH', value:5.2, unit:'mIU/L'}, {marker:'ferritin', value:12}]"},"sex":{"type":"string","enum":["male","female"]},"age":{"type":"integer","minimum":0,"maximum":120},"pregnancy":{"type":"boolean"},"postmenopausal":{"type":"boolean"}},"required":["values"]},"examples":{"example1":{"summary":"Two results flagged against sex-specific bands","value":{"values":[{"marker":"TSH","value":5.2,"unit":"mIU/L"},{"marker":"ferritin","value":12,"unit":"ng/mL"}],"sex":"female","age":34}}}}}},"responses":{"200":{"description":"Tool result","content":{"application/json":{"schema":{"type":"object","required":["tool","result"],"properties":{"tool":{"type":"string","enum":["interpret_results"]},"result":{"type":"object","properties":{"results":{"type":"array","items":{"type":"object","properties":{"input":{"type":"object","properties":{"marker":{"type":"string"},"value":{"type":"number"},"unit":{"anyOf":[{"type":"string"},{"type":"null"}]}},"additionalProperties":{}},"found":{"type":"boolean"},"marker":{"anyOf":[{"type":"string"},{"type":"null"}]},"slug":{"anyOf":[{"type":"string"},{"type":"null"}]},"flag":{"type":"string","enum":["low","normal","high","unknown"]},"range":{"anyOf":[{"type":"object","properties":{"qualifier":{"type":"string"},"min":{"type":"number"},"max":{"type":"number"},"unit":{"type":"string"},"text":{"type":"string"}},"additionalProperties":{}},{"type":"null"}]},"deviationPct":{"description":"Distance outside the band as % of band width","anyOf":[{"type":"number"},{"type":"null"}]},"unitMismatch":{"type":"boolean"},"suggests":{"description":"Reviewed copy for this direction","anyOf":[{"type":"string"},{"type":"null"}]},"retest":{"anyOf":[{"type":"string"},{"type":"null"}]},"citations":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string"},"url":{"type":"string"}},"additionalProperties":{}}},"links":{"type":"object","properties":{"biomarker":{"anyOf":[{"type":"string"},{"type":"null"}]},"interpretation":{"anyOf":[{"type":"string"},{"type":"null"}]},"orderTest":{"anyOf":[{"type":"string"},{"type":"null"}]}},"additionalProperties":{}},"suggestions":{"type":"array","items":{"type":"string"}}},"additionalProperties":{}}},"summary":{"type":"object","properties":{"total":{"type":"number"},"matched":{"type":"number"},"high":{"type":"number"},"low":{"type":"number"},"normal":{"type":"number"},"unknown":{"type":"number"}},"additionalProperties":{}},"disclaimer":{"type":"string"},"reviewed":{"type":"object","properties":{"catalog":{"anyOf":[{"type":"string"},{"type":"null"}]},"reviewer":{"type":"string"}},"additionalProperties":{}}},"additionalProperties":{}}}}}}},"400":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ToolError"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ToolError"}}}}}}},"/api/agent/convert_units":{"post":{"operationId":"convert_units","summary":"Convert lab units","description":"Convert a lab value between US conventional and SI units for 30 common analytes (glucose, cholesterol, testosterone, vitamin D, …) using published factors; hemoglobin A1c uses the NGSP↔IFCC master equation and also returns estimated average glucose.","tags":["reference"],"x-openai-isConsequential":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"analyte":{"type":"string","minLength":1,"maxLength":60,"description":"Analyte slug or name, e.g. 'glucose', 'total-cholesterol', 'testosterone', 'vitamin-d', 'a1c'"},"value":{"type":"number","description":"The numeric value to convert"},"direction":{"description":"Default toSI (US → SI)","type":"string","enum":["toSI","toConventional"]}},"required":["analyte","value"]},"examples":{"example1":{"summary":"100 mg/dL → 5.55 mmol/L","value":{"analyte":"glucose","value":100}},"example2":{"summary":"5.7% → 39 mmol/mol, eAG 117 mg/dL","value":{"analyte":"a1c","value":5.7}}}}}},"responses":{"200":{"description":"Tool result","content":{"application/json":{"schema":{"type":"object","required":["tool","result"],"properties":{"tool":{"type":"string","enum":["convert_units"]},"result":{"type":"object","properties":{"analyte":{"type":"string"},"input":{"type":"object","properties":{"value":{"type":"number"},"unit":{"type":"string"}},"additionalProperties":{}},"output":{"type":"object","properties":{"value":{"type":"number"},"unit":{"type":"string"}},"additionalProperties":{}},"factor":{"type":"number"},"method":{"type":"string"},"estimatedAverageGlucose":{"type":"object","properties":{"value":{"type":"number"},"unit":{"type":"string"}},"additionalProperties":{}},"note":{"anyOf":[{"type":"string"},{"type":"null"}]},"biomarkerUrl":{"anyOf":[{"type":"string"},{"type":"null"}]},"error":{"type":"string"}},"additionalProperties":{}}}}}}},"400":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ToolError"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ToolError"}}}}}}},"/api/agent/calculate_free_testosterone":{"post":{"operationId":"calculate_free_testosterone","summary":"Calculate free testosterone (Vermeulen)","description":"Calculate free and bioavailable testosterone from total testosterone, SHBG and albumin using the Vermeulen (1999) mass-action equation — the method behind lab-reported 'calculated free testosterone'. Educational; not a diagnosis.","tags":["reference"],"x-openai-isConsequential":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"totalT":{"type":"number","exclusiveMinimum":0,"description":"Total testosterone"},"totalTUnit":{"description":"Default ng/dL","type":"string","enum":["ng/dL","nmol/L"]},"shbg":{"type":"number","exclusiveMinimum":0,"description":"SHBG in nmol/L"},"albuminGdL":{"description":"Albumin in g/dL (default 4.3)","type":"number","exclusiveMinimum":0,"maximum":6}},"required":["totalT","shbg"]},"examples":{"example1":{"summary":"Typical male values","value":{"totalT":450,"shbg":35}}}}}},"responses":{"200":{"description":"Tool result","content":{"application/json":{"schema":{"type":"object","required":["tool","result"],"properties":{"tool":{"type":"string","enum":["calculate_free_testosterone"]},"result":{"type":"object","properties":{"inputs":{"type":"object","properties":{"totalT":{"type":"number"},"totalTUnit":{"type":"string"},"shbg":{"type":"number"},"albuminGdL":{"type":"number"}},"additionalProperties":{}},"freeTestosterone":{"type":"object","properties":{"pgmL":{"type":"number"},"ngdL":{"type":"number"},"nmolL":{"type":"number"}},"additionalProperties":{}},"bioavailableTestosterone":{"type":"object","properties":{"ngdL":{"type":"number"},"nmolL":{"type":"number"}},"additionalProperties":{}},"freePercent":{"type":"number"},"method":{"type":"string"},"tests":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"url":{"type":"string"}},"additionalProperties":{}}},"toolUrl":{"type":"string"}},"additionalProperties":{}}}}}}},"400":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ToolError"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ToolError"}}}}}}},"/api/agent/compare_provider":{"post":{"operationId":"compare_provider","summary":"Compare TestWell with another lab-testing service","description":"Honest side-by-side of TestWell and another direct-to-consumer lab service (Quest Direct, Labcorp OnDemand, Function Health, JustLabs, Ulta Lab Tests, …): pricing model, per-order fees, labs, turnaround, where each wins, spot prices on common tests as sticker AND all-in, with verification dates…","tags":["compare"],"x-openai-isConsequential":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"provider":{"description":"Competitor slug or name, e.g. 'quest-direct', 'Function Health', 'justlabs'","type":"string","maxLength":60}}},"examples":{"example1":{"summary":"Sticker vs all-in with their per-order fees","value":{"provider":"justlabs"}}}}}},"responses":{"200":{"description":"Tool result","content":{"application/json":{"schema":{"type":"object","required":["tool","result"],"properties":{"tool":{"type":"string","enum":["compare_provider"]},"result":{"type":"object","properties":{"found":{"type":"boolean"},"competitor":{"type":"object","properties":{"name":{"type":"string"},"url":{"type":"string"},"pricingModel":{"type":"string"},"perOrderFees":{},"labPartners":{"type":"array","items":{"type":"string"}},"statesServed":{"type":"number"}},"additionalProperties":{}},"testwell":{"type":"object","properties":{},"additionalProperties":{}},"verdict":{"type":"string"},"spotPrices":{"type":"array","items":{"type":"object","properties":{"test":{"type":"string"},"testwell":{},"competitor":{},"note":{"anyOf":[{"type":"string"},{"type":"null"}]}},"additionalProperties":{}}},"testWellWinsAt":{"type":"array","items":{"type":"string"}},"competitorWinsAt":{"type":"array","items":{"type":"string"}},"testWellNotFor":{"type":"array","items":{"type":"string"}},"verified":{"description":"Date the competitor's prices were verified","type":"string"},"sources":{"type":"array","items":{"type":"string"}},"url":{"type":"string","description":"Absolute https URL on test-well.com"},"providers":{"description":"Returned when no provider was named","type":"array","items":{"type":"object","properties":{"slug":{"type":"string"},"name":{"type":"string"},"url":{"type":"string"}},"additionalProperties":{}}}},"additionalProperties":{}}}}}}},"400":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ToolError"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ToolError"}}}}}}},"/api/agent/get_guide":{"post":{"operationId":"get_guide","summary":"Get a guide, condition or answer page as Markdown","description":"Return one of TestWell's educational pages as Markdown: guides (/guides/<slug>), condition workups (/conditions/<slug>), biomarker pages (/biomarkers/<slug>), state pages (/lab-locations/<slug>) or comparisons (/compare/<slug>). Call with no path to list the available guides and conditions.","tags":["content"],"x-openai-isConsequential":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"path":{"description":"Site path, e.g. '/guides/annual-blood-work' or 'conditions/anemia'","type":"string","maxLength":160},"lang":{"description":"Spanish version when one exists (default en)","type":"string","enum":["en","es"]}}},"examples":{"example1":{"summary":"Reviewed TB testing guide","value":{"path":"/guides/tb-blood-test-vs-skin-test"}}}}}},"responses":{"200":{"description":"Tool result","content":{"application/json":{"schema":{"type":"object","required":["tool","result"],"properties":{"tool":{"type":"string","enum":["get_guide"]},"result":{"type":"object","properties":{"found":{"type":"boolean"},"path":{"type":"string"},"title":{"type":"string"},"url":{"type":"string","description":"Absolute https URL on test-well.com"},"markdown":{"description":"Full page as Markdown","type":"string"},"guides":{"description":"Index, returned when no path was given","type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"title":{"type":"string"}},"additionalProperties":{}}},"conditions":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"title":{"type":"string"}},"additionalProperties":{}}},"answers":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"}},"additionalProperties":{}}}},"additionalProperties":{}}}}}}},"400":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ToolError"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ToolError"}}}}}}}},"components":{"schemas":{"CatalogPrices":{"type":"object","properties":{"list":{"type":"number"},"quest":{"type":"number"},"labcorp":{"type":"number"},"bioreference":{"type":"number"}},"required":["list"]},"CatalogItem":{"type":"object","properties":{"id":{"type":"string"},"slug":{"type":"string"},"type":{"type":"string","enum":["test","panel"]},"name":{"type":"string"},"category":{"type":"string"},"description":{"type":"string"},"aliases":{"type":"array","items":{"type":"string"}},"cpt":{"type":["string","null"]},"biomarkers":{"type":"array","items":{"type":"string"}},"biomarkerCount":{"type":"integer"},"includedTests":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"slug":{"type":"string"},"name":{"type":"string"},"price":{"type":"number"},"url":{"type":"string"}}}},"sampleType":{"type":"string"},"fastingRequired":{"type":"boolean"},"resultsIn":{"type":"string"},"prepInstructions":{"type":["string","null"]},"labs":{"type":"array","items":{"type":"string","enum":["Quest","Labcorp","BioReference"]}},"prices":{"$ref":"#/components/schemas/CatalogPrices"},"labFee":{"type":"number"},"currency":{"type":"string"},"orderable":{"type":"boolean"},"url":{"type":"string"},"markdownUrl":{"type":"string"},"orderUrl":{"type":["string","null"]},"reviewedAt":{"type":["string","null"]},"popular":{"type":"boolean"}},"required":["id","slug","type","name","prices","labFee","orderable","url"]},"ToolResult":{"type":"object","properties":{"tool":{"type":"string","description":"Tool name that produced the result"},"result":{"type":"object","additionalProperties":true,"description":"Tool-specific payload; shapes are documented per tool at /developers"}},"required":["tool","result"]},"ToolError":{"type":"object","properties":{"error":{"type":"string"},"issues":{"type":"array","items":{"type":"object","additionalProperties":true}}},"required":["error"]},"CatalogResponse":{"type":"object","properties":{"total":{"type":"integer"},"count":{"type":"integer"},"labFee":{"type":"number"},"currency":{"type":"string"},"items":{"type":"array","items":{"$ref":"#/components/schemas/CatalogItem"}}}}}}}