{"ok":true,"site":{"host":"thehealthbook.vercel.app","url":"https://thehealthbook.vercel.app/","type":"live","desc":"Your health, all in one place — medicines, labs, and notes connected and easy to understand.","tools":[{"name":"extract_fact","kind":"act","impl":"imperative","description":"Extracts clinical facts (labs, medications, allergies, conditions) from uploaded medical documents or image slips.","title":"extract_fact","annotations":{"readOnlyHint":true},"inputSchema":{"type":"object","properties":{"documentId":{"type":"string","description":"ID of the document record in vault"},"docType":{"type":"string","description":"Type of document (e.g. discharge_summary, lab_slip_photo, clinic_note)"},"targetCategories":{"type":"array","items":{"type":"string"},"description":"Categories to extract"},"rawText":{"type":"string","description":"Raw OCR or file text content to derive facts from"},"imageDataUrl":{"type":"string","description":"Optional base64 data URL of document/image file"}},"required":["documentId"]},"hasHandler":true,"hasExecute":true,"__source":"spec","executable":true,"handlerField":"execute"},{"name":"confirm_fact","kind":"act","impl":"imperative","description":"Strict Human-in-the-Loop approval gate for extracted facts. Approves, edits, or rejects facts before they propagate to downstream canvases.","title":"confirm_fact","annotations":{"readOnlyHint":true},"inputSchema":{"type":"object","properties":{"factId":{"type":"string","description":"Unique identifier of the fact, or \"all\" to confirm all pending facts"},"action":{"type":"string","enum":["approve","reject","edit"],"description":"Action to take"},"edits":{"type":"object","description":"Patient-modified fields if action is edit"}},"required":["factId","action"]},"hasHandler":true,"hasExecute":true,"__source":"spec","executable":true,"handlerField":"execute"},{"name":"compile_health_record","kind":"act","impl":"imperative","description":"Compiles lifetime health record from Approved Fact Vault (demographics, active meds, multi-year labs, danger alerts, proxy audit logs, source citations, emergency snapshot, FHIR R4 bundle).","title":"compile_health_record","annotations":{"readOnlyHint":true},"inputSchema":{"type":"object","properties":{"patientId":{"type":"string","description":"Patient ID"},"sections":{"type":"array","items":{"type":"string"},"description":"Sections to include (e.g. all, labs, meds, audit)"},"format":{"type":"string","enum":["json_dossier","fhir_r4","emergency_snapshot"],"description":"Export format"},"includeAuditTrail":{"type":"boolean","description":"Whether to include audit logs"}},"required":["patientId"]},"hasHandler":true,"hasExecute":true,"__source":"spec","executable":true,"handlerField":"execute"},{"name":"extract_labs","kind":"act","impl":"imperative","description":"Ingests multi-year PDF/image lab drops, normalizes units (e.g. mmol/L to mg/dL), tags reference/optimal ranges, ±10% borderline buffers, and places points on DuckDB/LocalVault timeline.","title":"extract_labs","annotations":{"readOnlyHint":true},"inputSchema":{"type":"object","properties":{"documentId":{"type":"string","description":"Document or slip ID"},"patientId":{"type":"string","description":"Patient ID"},"rawLabData":{"type":"array","items":{"type":"object"},"description":"Optional raw extracted lab items"},"rawText":{"type":"string","description":"Optional raw OCR or text content to parse"}},"required":["documentId"]},"hasHandler":true,"hasExecute":true,"__source":"spec","executable":true,"handlerField":"execute"},{"name":"correlate_meds","kind":"act","impl":"imperative","description":"Causal biomarker query engine that correlates biomarker fluctuations (e.g. glucose spikes, eGFR declines) with active medication starts, dose titrations, or adherence.","title":"correlate_meds","annotations":{"readOnlyHint":true},"inputSchema":{"type":"object","properties":{"biomarker":{"type":"string","description":"Biomarker to correlate (e.g. eGFR, Creatinine, Glucose Fasting, HbA1c, Potassium, Cholesterol)"},"startDate":{"type":"string","description":"Start date of query window (ISO)"},"endDate":{"type":"string","description":"End date of query window (ISO)"},"patientId":{"type":"string","description":"Patient ID"},"queryText":{"type":"string","description":"Optional natural language question"}},"required":["biomarker"]},"hasHandler":true,"hasExecute":true,"__source":"spec","executable":true,"handlerField":"execute"},{"name":"add_medication","kind":"act","impl":"imperative","description":"Adds a prescription medication or OTC supplement onto the 7x4 PillMap canvas in designated time slots.","title":"add_medication","annotations":{"readOnlyHint":true},"inputSchema":{"type":"object","properties":{"name":{"type":"string","description":"Medication or supplement name"},"dose":{"type":"string","description":"Dose strength (e.g. 500mg, 10mg)"},"frequency":{"type":"string","description":"Frequency (e.g. QD, BID, PRN)"},"slot":{"type":"string","description":"Primary daily time slot (morning|noon|evening|bedtime, case-insensitive; invalid values return INVALID_SLOT)"},"days":{"type":"array","items":{"type":"string"},"description":"Active days of the week"},"withFood":{"type":"boolean","description":"Take with food instruction"}},"required":["name","dose","slot"]},"hasHandler":true,"hasExecute":true,"__source":"spec","executable":true,"handlerField":"execute"},{"name":"check_interactions","kind":"answer","impl":"imperative","description":"Evaluates drug-drug interactions across active medications and returns SVG conflict arcs with plain-language mechanisms and severity colors.","title":"check_interactions","annotations":{"readOnlyHint":true},"inputSchema":{"type":"object","properties":{"medList":{"type":"array","items":{"type":"string"},"description":"List of medication names to evaluate (defaults to active medications in vault)"}}},"hasHandler":true,"hasExecute":true,"__source":"spec","executable":true,"handlerField":"execute"},{"name":"check_diet_interactions","kind":"answer","impl":"imperative","description":"Evaluates food and diet interactions (e.g. grapefruit, vitamin K leafy greens, dairy/calcium, alcohol) and generates meal badges.","title":"check_diet_interactions","annotations":{"readOnlyHint":true},"inputSchema":{"type":"object","properties":{"medList":{"type":"array","items":{"type":"string"},"description":"Medications to check"},"patientDiet":{"type":"object","description":"Diet profile flags (drinksGrapefruitDaily, etc.)"}},"required":["medList"]},"hasHandler":true,"hasExecute":true,"__source":"spec","executable":true,"handlerField":"execute"},{"name":"check_duplicate_ingredient","kind":"answer","impl":"imperative","description":"Detects hidden duplicate active ingredients across brand and generic combinations (e.g. Acetaminophen, Ibuprofen, Statins).","title":"check_duplicate_ingredient","annotations":{"readOnlyHint":true},"inputSchema":{"type":"object","properties":{"medList":{"type":"array","items":{"type":"object"},"description":"Array of { name, dose } objects"}},"required":["medList"]},"hasHandler":true,"hasExecute":true,"__source":"spec","executable":true,"handlerField":"execute"},{"name":"suggest_schedule","kind":"act","impl":"imperative","description":"Computes chronotype-aware schedule timing shifts with ghost preview animations on PillMap canvas.","title":"suggest_schedule","annotations":{"readOnlyHint":true},"inputSchema":{"type":"object","properties":{"medList":{"type":"array","items":{"type":"object"},"description":"Array of { id, name, currentSlot }"},"chronotype":{"type":"string","enum":["early_bird","night_owl","standard"],"description":"Patient chronotype"}},"required":["medList"]},"hasHandler":true,"hasExecute":true,"__source":"spec","executable":true,"handlerField":"execute"},{"name":"simulate_adherence","kind":"act","impl":"imperative","description":"Simulates clinical risk deltas and recovery protocols when a patient misses a scheduled medication dose.","title":"simulate_adherence","annotations":{"readOnlyHint":true},"inputSchema":{"type":"object","properties":{"medName":{"type":"string","description":"Name of the missed medication"},"slot":{"type":"object","description":"{ day: string, slot: string }"}},"required":["medName"]},"hasHandler":true,"hasExecute":true,"__source":"spec","executable":true,"handlerField":"execute"},{"name":"export_for_pharmacist","kind":"act","impl":"imperative","description":"Generates a 1-page visual medication map, brand/generic crosswalk, and drug-drug separation rules for pharmacist review.","title":"export_for_pharmacist","annotations":{"readOnlyHint":true},"inputSchema":{"type":"object","properties":{"patientId":{"type":"string","description":"Patient ID"},"format":{"type":"string","enum":["pdf_map","json"],"description":"Export format"}},"required":["patientId"]},"hasHandler":true,"hasExecute":true,"__source":"spec","executable":true,"handlerField":"execute"},{"name":"set_reminder","kind":"act","impl":"imperative","description":"Registers time-slot batch notifications for scheduled daily medications.","title":"set_reminder","annotations":{"readOnlyHint":true},"inputSchema":{"type":"object","properties":{"slotTimes":{"type":"object","description":"Mapping of slots to times (e.g. { morning: \"08:00\", bedtime: \"22:00\" })"},"patientId":{"type":"string","description":"Patient ID"}},"required":["slotTimes"]},"hasHandler":true,"hasExecute":true,"__source":"spec","executable":true,"handlerField":"execute"},{"name":"explain_med_change","kind":"act","impl":"imperative","description":"Walks patient through each medication change across 3 lists (Pre-admission, In-hospital, Discharge) with plain-language explanations and 5 status badges (Continued, Dose Changed, Stopped, New, Held).","title":"explain_med_change","annotations":{"readOnlyHint":true},"inputSchema":{"type":"object","properties":{"medName":{"type":"string","description":"Name of the medication"},"preHospDose":{"type":"string","description":"Home baseline dose or \"none\""},"inHospAction":{"type":"string","description":"Hospital chart action or rationale"},"dischargeDose":{"type":"string","description":"Discharge prescription order dose"},"reason":{"type":"string","description":"Documented clinical reason for change"}},"required":["medName","dischargeDose"]},"hasHandler":true,"hasExecute":true,"__source":"spec","executable":true,"handlerField":"execute"},{"name":"flag_interaction","kind":"act","impl":"imperative","description":"Checks discharge prescription list against pre-admission OTC supplements, herbs, active vault meds, and biomarker safety (e.g. Apixaban vs Fish Oil, Lisinopril vs Spironolactone, eGFR < 30).","title":"flag_interaction","annotations":{"readOnlyHint":true},"inputSchema":{"type":"object","properties":{"dischargeMeds":{"type":"array","items":{"type":"string"},"description":"Discharge medications"},"preAdmitOTCs":{"type":"array","items":{"type":"string"},"description":"Pre-admission OTCs or home supplements"},"patientLabs":{"type":"array","items":{"type":"object"},"description":"Recent laboratory biomarker values"}},"required":["dischargeMeds"]},"hasHandler":true,"hasExecute":true,"__source":"spec","executable":true,"handlerField":"execute"},{"name":"flag_diet_interaction","kind":"act","impl":"imperative","description":"Checks discharge medications against patient diet habits (e.g. Atorvastatin vs Grapefruit, Warfarin vs Vitamin K, Levothyroxine vs Dairy/Empty Stomach, Metronidazole vs Alcohol).","title":"flag_diet_interaction","annotations":{"readOnlyHint":true},"inputSchema":{"type":"object","properties":{"dischargeMeds":{"type":"array","items":{"type":"string"},"description":"Discharge prescription meds"},"patientDietProfile":{"type":"object","description":"Diet profile flags"}},"required":["dischargeMeds"]},"hasHandler":true,"hasExecute":true,"__source":"spec","executable":true,"handlerField":"execute"},{"name":"suggest_question_for_doctor","kind":"act","impl":"imperative","description":"Auto-generates targeted doctor questions for unclear medication changes or monitoring cadences and appends them to Question Bank.","title":"suggest_question_for_doctor","annotations":{"readOnlyHint":true},"inputSchema":{"type":"object","properties":{"context":{"type":"string","description":"Clinical context (e.g. stopped lisinopril, new blood thinner, potassium monitoring, dose increase)"},"medName":{"type":"string","description":"Medication name if applicable"},"autoAddToBank":{"type":"boolean","description":"Auto add question to central Question Bank"},"documentContext":{"type":"string","description":"Optional discharge document text context for grounding"},"imageDataUrl":{"type":"string","description":"Optional data URL image of discharge list for vision+text multimodal"}},"required":["context"]},"hasHandler":true,"hasExecute":true,"__source":"spec","executable":true,"handlerField":"execute"},{"name":"export_patient_summary","kind":"act","impl":"imperative","description":"Generates a 1-page printable patient discharge home summary containing What Changed, Daily Schedule, Food/Diet Rules, Doctor Questions, and Emergency Red Flags.","title":"export_patient_summary","annotations":{"readOnlyHint":true},"inputSchema":{"type":"object","properties":{"patientId":{"type":"string","description":"Patient ID"},"format":{"type":"string","enum":["one_page_pdf","json","teach_back_summary"],"description":"Export format"},"dataset":{"type":"object","description":"Optional custom 3-list discharge dataset"},"language":{"type":"string","enum":["en","es","hi"],"description":"Summary language"}},"required":["patientId"]},"hasHandler":true,"hasExecute":true,"__source":"spec","executable":true,"handlerField":"execute"},{"name":"upload_lab_image","kind":"act","impl":"imperative","description":"Ingests smartphone photo or PDF of remote lab slip, extracts lab markers with confidence metrics.","title":"upload_lab_image","annotations":{"readOnlyHint":true},"inputSchema":{"type":"object","properties":{"imageBlob":{"type":"string","description":"Base64 image/document URI"},"patientId":{"type":"string","description":"Patient ID"},"linkedDueCardId":{"type":"string","description":"Linked prescribed due card ID"},"rawText":{"type":"string","description":"Optional text context"},"imageDataUrl":{"type":"string","description":"Optional Data URL of file"}},"required":["imageBlob"]},"hasHandler":true,"hasExecute":true,"__source":"spec","executable":true,"handlerField":"execute"},{"name":"doctor_review_comment","kind":"act","impl":"imperative","description":"Attaches doctor clinical review comment (📌) to specific longitudinal lab points in LabStory.","title":"doctor_review_comment","annotations":{"readOnlyHint":true},"inputSchema":{"type":"object","properties":{"labId":{"type":"string","description":"Target lab record ID"},"commentText":{"type":"string","description":"Clinical review note"},"doctorId":{"type":"string","description":"Doctor ID"},"doctorName":{"type":"string","description":"Doctor full name"},"pinnedMarker":{"type":"string","description":"Marker point to pin on chart (e.g. Creatinine 2026-08-28)"}},"required":["labId","commentText"]},"hasHandler":true,"hasExecute":true,"__source":"spec","executable":true,"handlerField":"execute"},{"name":"propose_dosage_change","kind":"act","impl":"imperative","description":"Doctor or AI generates a dosage change proposal card (e.g. Metformin 1000mg -> 500mg due to eGFR 28) linked to lab points, staged in pending state.","title":"propose_dosage_change","annotations":{"readOnlyHint":true},"inputSchema":{"type":"object","properties":{"medName":{"type":"string","description":"Medication name"},"currentDose":{"type":"string","description":"Current dose"},"proposedDose":{"type":"string","description":"Proposed new dose"},"reason":{"type":"string","description":"Clinical rationale"},"linkedLabId":{"type":"string","description":"Linked lab point ID"},"doctorName":{"type":"string","description":"Prescribing doctor name"}},"required":["medName","proposedDose","reason"]},"hasHandler":true,"hasExecute":true,"__source":"spec","executable":true,"handlerField":"execute"},{"name":"approve_dosage_change","kind":"act","impl":"imperative","description":"Human Approval Gate: Patient or authorized Caregiver approves a pending dosage change proposal.","title":"approve_dosage_change","annotations":{"readOnlyHint":true},"inputSchema":{"type":"object","properties":{"proposalId":{"type":"string","description":"Proposal identifier"},"action":{"type":"string","enum":["approve","reject"],"description":"Approval decision"},"approvedBy":{"type":"string","description":"Approver name"},"role":{"type":"string","description":"Approver role (patient, caregiver)"},"onBehalfOf":{"type":"string","description":"Patient name if acting on behalf"}},"required":["proposalId"]},"hasHandler":true,"hasExecute":true,"__source":"spec","executable":true,"handlerField":"execute"},{"name":"sync_pillmap_from_proposal","kind":"act","impl":"imperative","description":"Synchronizes PillMap canvas with an approved dosage proposal, triggering animated diffs (fades old dose, pulses new dose) and continuous LabStory intervention bands.","title":"sync_pillmap_from_proposal","annotations":{"readOnlyHint":true},"inputSchema":{"type":"object","properties":{"proposalId":{"type":"string","description":"ID of the approved proposal"}},"required":["proposalId"]},"hasHandler":true,"hasExecute":true,"__source":"spec","executable":true,"handlerField":"execute"},{"name":"report_danger_sign","kind":"act","impl":"imperative","description":"Reports acute danger signs (e.g. bilateral pedal edema, breathlessness, chest pain), calculates triage priority, and delivers immediate first-aid instructions.","title":"report_danger_sign","annotations":{"readOnlyHint":true},"inputSchema":{"type":"object","properties":{"symptomTags":{"type":"array","items":{"type":"string"},"description":"Array of symptom tags"},"freeText":{"type":"string","description":"Patient description of symptoms"},"severityRating":{"type":"string","enum":["mild","moderate","severe","critical"],"description":"Self-rated severity"},"vitalSigns":{"type":"object","description":"Optional vital signs (BP, HR, weight)"},"photoBlob":{"type":"string","description":"Photo attachment (e.g. swollen ankles)"}},"required":["symptomTags"]},"hasHandler":true,"hasExecute":true,"__source":"spec","executable":true,"handlerField":"execute"},{"name":"notify_doctor","kind":"transact","impl":"imperative","description":"Dispatches high-priority push/inbox alert to doctor triage portal with full patient dossier context (danger photo, recent eGFR, active pillbox).","title":"notify_doctor","annotations":{"readOnlyHint":true},"inputSchema":{"type":"object","properties":{"priority":{"type":"string","enum":["URGENT","EMERGENCY","ROUTINE"],"description":"Alert priority"},"alertPayload":{"type":"object","description":"Patient symptoms, recent labs, active meds snapshot"}},"required":["priority"]},"hasHandler":true,"hasExecute":true,"__source":"spec","executable":true,"handlerField":"execute"},{"name":"doctor_add_medication","kind":"act","impl":"imperative","description":"Doctor orders new medication proposal in response to danger sign, staged in pending state.","title":"doctor_add_medication","annotations":{"readOnlyHint":true},"inputSchema":{"type":"object","properties":{"medName":{"type":"string","description":"Medication name"},"dose":{"type":"string","description":"Dosage"},"slot":{"type":"string","description":"Timing slot"},"reason":{"type":"string","description":"Reason for addition"}},"required":["medName","dose","reason"]},"hasHandler":true,"hasExecute":true,"__source":"spec","executable":true,"handlerField":"execute"},{"name":"doctor_remove_medication","kind":"act","impl":"imperative","description":"Doctor issues urgent stop order proposal (e.g. stopping NSAID Ibuprofen due to pedal edema & AKI risk), staged for patient approval.","title":"doctor_remove_medication","annotations":{"readOnlyHint":true},"inputSchema":{"type":"object","properties":{"medName":{"type":"string","description":"Medication to discontinue"},"reason":{"type":"string","description":"Clinical rationale for removal"},"patientId":{"type":"string","description":"Patient ID"}},"required":["medName","reason"]},"hasHandler":true,"hasExecute":true,"__source":"spec","executable":true,"handlerField":"execute"},{"name":"doctor_change_dose","kind":"act","impl":"imperative","description":"Doctor titrates or reduces medication dosage in response to safety alert, staged for patient approval.","title":"doctor_change_dose","annotations":{"readOnlyHint":true},"inputSchema":{"type":"object","properties":{"medName":{"type":"string","description":"Medication name"},"newDose":{"type":"string","description":"New proposed dose"},"reason":{"type":"string","description":"Clinical reason"}},"required":["medName","newDose","reason"]},"hasHandler":true,"hasExecute":true,"__source":"spec","executable":true,"handlerField":"execute"},{"name":"approve_pillmap_change","kind":"act","impl":"imperative","description":"Human Approval Gate: Patient/Caregiver approves a doctor remote pillbox action, updating PillMap canvas and dissolving conflict arcs.","title":"approve_pillmap_change","annotations":{"readOnlyHint":true},"inputSchema":{"type":"object","properties":{"actionId":{"type":"string","description":"Proposal or Action ID"},"action":{"type":"string","enum":["approve","reject"],"description":"Decision"},"approvedBy":{"type":"string","description":"Approver name"}},"required":["actionId"]},"hasHandler":true,"hasExecute":true,"__source":"spec","executable":true,"handlerField":"execute"},{"name":"schedule_followup","kind":"transact","impl":"imperative","description":"Schedules clinic or telehealth follow-up visit and configures 24h & 2h reminder alerts for patient and caregiver.","title":"schedule_followup","annotations":{"readOnlyHint":true},"inputSchema":{"type":"object","properties":{"date":{"type":"string","description":"Target date or offset (e.g. \"+3d\", \"2026-09-01\")"},"appointmentType":{"type":"string","enum":["in_person_clinic","telehealth_video"],"description":"Type of appointment"},"reason":{"type":"string","description":"Clinical reason"},"providerName":{"type":"string","description":"Doctor or clinic name"}},"required":["date","reason"]},"hasHandler":true,"hasExecute":true,"__source":"spec","executable":true,"handlerField":"execute"},{"name":"schedule_lab","kind":"act","impl":"imperative","description":"Schedules remote HomeLab cadence (e.g. Creatinine & Potassium in 4 weeks) and generates due card with overdue nudges.","title":"schedule_lab","annotations":{"readOnlyHint":true},"inputSchema":{"type":"object","properties":{"cadence":{"type":"string","description":"Cadence (e.g. 2_weeks, 4_weeks, 3_months)"},"testPanel":{"type":"string","description":"Lab test panel name"},"targetDate":{"type":"string","description":"Target date (ISO)"}},"required":["testPanel"]},"hasHandler":true,"hasExecute":true,"__source":"spec","executable":true,"handlerField":"execute"},{"name":"sync_to_calendar","kind":"act","impl":"imperative","description":"Generates RFC 5545 iCalendar (.ics) payload and Web Calendar intents for multi-user sync (patient and caregiver).","title":"sync_to_calendar","annotations":{"readOnlyHint":true},"inputSchema":{"type":"object","properties":{"eventId":{"type":"string","description":"Calendar event ID"},"recipients":{"type":"array","items":{"type":"string"},"description":"Recipients (e.g. [\"patient\", \"caregiver\"])"}},"required":["eventId"]},"hasHandler":true,"hasExecute":true,"__source":"spec","executable":true,"handlerField":"execute"},{"name":"link_patient","kind":"act","impl":"imperative","description":"Links family caregiver account with distinct scoped permission and separate vault storage isolation.","title":"link_patient","annotations":{"readOnlyHint":true},"inputSchema":{"type":"object","properties":{"patientId":{"type":"string","description":"Target patient ID"},"relationship":{"type":"string","enum":["mother","father","son","daughter","children","husband","wife","partner","brother","sister","guardian","advocate","friend","other","parent","child","spouse","sibling"],"description":"Relationship"},"authToken":{"type":"string","description":"Patient-generated authorization consent token"},"caregiverName":{"type":"string","description":"Caregiver display name e.g. Raj (son)"},"permissionLevel":{"type":"string","enum":["view_only","manage","full"],"description":"Permission tier"}},"required":["patientId","relationship"]},"hasHandler":true,"hasExecute":true,"__source":"spec","executable":true,"handlerField":"execute"},{"name":"grant_caregiver_access","kind":"act","impl":"imperative","description":"Configures scoped permission levels for linked caregiver (View Only, Manage, Full).","title":"grant_caregiver_access","annotations":{"readOnlyHint":true},"inputSchema":{"type":"object","properties":{"caregiverId":{"type":"string","description":"Caregiver user ID"},"permissionLevel":{"type":"string","enum":["view_only","manage","full"],"description":"Permission scope"},"patientId":{"type":"string","description":"Patient ID"}},"required":["caregiverId","permissionLevel"]},"hasHandler":true,"hasExecute":true,"__source":"spec","executable":true,"handlerField":"execute"},{"name":"revoke_caregiver_access","kind":"act","impl":"imperative","description":"Immediately revokes caregiver proxy access to patient profile.","title":"revoke_caregiver_access","annotations":{"readOnlyHint":true},"inputSchema":{"type":"object","properties":{"caregiverId":{"type":"string","description":"Caregiver user ID"},"patientId":{"type":"string","description":"Patient ID"}},"required":["caregiverId"]},"hasHandler":true,"hasExecute":true,"__source":"spec","executable":true,"handlerField":"execute"},{"name":"switch_profile","kind":"act","impl":"imperative","description":"Switches active Healthbook context between Self and linked family members with persistent proxy banner.","title":"switch_profile","annotations":{"readOnlyHint":true},"inputSchema":{"type":"object","properties":{"targetPatientId":{"type":"string","description":"Patient profile ID to switch to (or \"self\")"}},"required":["targetPatientId"]},"hasHandler":true,"hasExecute":true,"__source":"spec","executable":true,"handlerField":"execute"},{"name":"act_on_behalf","kind":"act","impl":"imperative","description":"Executes clinical approval or document upload on behalf of linked family member with immutable audit signature.","title":"act_on_behalf","annotations":{"readOnlyHint":true},"inputSchema":{"type":"object","properties":{"actionName":{"type":"string","description":"Action being performed (e.g. approve_dosage_change, upload_lab_image)"},"actionPayload":{"type":"object","description":"Parameters for the underlying action"},"patientId":{"type":"string","description":"Target patient ID"}},"required":["actionName","actionPayload"]},"hasHandler":true,"hasExecute":true,"__source":"spec","executable":true,"handlerField":"execute"},{"name":"grant_doctor_access","kind":"act","impl":"imperative","description":"Generates time-bound, scoped access token for external specialist (e.g. 7-day token for Dr. Chen).","title":"grant_doctor_access","annotations":{"readOnlyHint":true},"inputSchema":{"type":"object","properties":{"doctorEmail":{"type":"string","description":"Clinician email address"},"durationDays":{"type":"number","description":"Duration in days (e.g. 7, 14)"},"scope":{"type":"string","enum":["full_dossier","snapshot_only","labs_and_meds"],"description":"Access scope"},"patientId":{"type":"string","description":"Patient ID"}},"required":["doctorEmail"]},"hasHandler":true,"hasExecute":true,"__source":"spec","executable":true,"handlerField":"execute"},{"name":"revoke_access","kind":"act","impl":"imperative","description":"Immediately invalidates an active doctor access grant token.","title":"revoke_access","annotations":{"readOnlyHint":true},"inputSchema":{"type":"object","properties":{"grantId":{"type":"string","description":"Grant identifier to revoke"}},"required":["grantId"]},"hasHandler":true,"hasExecute":true,"__source":"spec","executable":true,"handlerField":"execute"},{"name":"view_timeline","kind":"act","impl":"imperative","description":"Queries longitudinal timeline items and returns exact document source bounding boxes `[pageIndex, x, y, width, height]` for split-screen zoom highlights.","title":"view_timeline","annotations":{"readOnlyHint":true},"inputSchema":{"type":"object","properties":{"itemId":{"type":"string","description":"Timeline entity or fact ID"},"category":{"type":"string","description":"Optional category filter"}},"required":["itemId"]},"hasHandler":true,"hasExecute":true,"__source":"spec","executable":true,"handlerField":"execute"},{"name":"create_account","kind":"act","impl":"imperative","description":"Prepares a new Healthbook account (name, email, role). Does NOT accept password — human must type password securely in the browser password field. AI should call this to prefill onboarding, then instruct human: \"Please type your password in the browser to finish creating your account. Password is never shared with AI.\"","title":"create_account","annotations":{"readOnlyHint":true},"inputSchema":{"type":"object","properties":{"name":{"type":"string","description":"Display name (optional, defaults to Anonymous, max 64 chars)"},"email":{"type":"string","description":"Email address for the new account (required)"},"role":{"type":"string","enum":["patient","doctor"],"description":"Account role: patient (default) or doctor"}},"required":["email"],"additionalProperties":false},"hasHandler":true,"hasExecute":true,"__source":"spec","executable":true,"handlerField":"execute"},{"name":"sign_in","kind":"act","impl":"imperative","description":"Initiates sign-in for an existing account by email. Does NOT accept password — human must type password securely in the browser. AI should call this to prefill sign-in, then instruct human: \"Please type your password in the browser to sign in. Password is never shared with AI.\"","title":"sign_in","annotations":{"readOnlyHint":true},"inputSchema":{"type":"object","properties":{"email":{"type":"string","description":"Email address of the existing account (required)"}},"required":["email"],"additionalProperties":false},"hasHandler":true,"hasExecute":true,"__source":"spec","executable":true,"handlerField":"execute"},{"name":"link_doctor","kind":"act","impl":"imperative","description":"Links a doctor to a patient profile with scoped permission (patient authorizes doctor).","title":"link_doctor","annotations":{"readOnlyHint":true},"inputSchema":{"type":"object","properties":{"patientId":{"type":"string","description":"Patient ID to link doctor to"},"doctorEmail":{"type":"string","description":"Doctor email"},"doctorName":{"type":"string","description":"Doctor display name"},"doctorId":{"type":"string","description":"Doctor user ID (if known, else email is used)"},"specialty":{"type":"string","description":"Doctor specialty"},"permissionLevel":{"type":"string","enum":["view_only","manage","full"],"description":"Doctor permission level"},"scope":{"type":"string","enum":["full_dossier","snapshot_only","labs_and_meds"],"description":"Data scope"},"authToken":{"type":"string","description":"Patient authorization token (optional, invalid_token fails)"}},"required":["patientId","doctorEmail"]},"hasHandler":true,"hasExecute":true,"__source":"spec","executable":true,"handlerField":"execute"},{"name":"revoke_doctor_link","kind":"act","impl":"imperative","description":"Revokes a doctor-patient link immediately.","title":"revoke_doctor_link","annotations":{"readOnlyHint":true},"inputSchema":{"type":"object","properties":{"linkId":{"type":"string","description":"DoctorPatientLink id"},"patientId":{"type":"string","description":"Patient ID (optional, for scoping)"},"doctorId":{"type":"string","description":"Doctor user ID (optional alternative to linkId)"}},"required":["linkId"]},"hasHandler":true,"hasExecute":true,"__source":"spec","executable":true,"handlerField":"execute"},{"name":"list_doctor_patients","kind":"answer","impl":"imperative","description":"Lists all patients linked to a doctor (doctor dashboard).","title":"list_doctor_patients","annotations":{"readOnlyHint":true},"inputSchema":{"type":"object","properties":{"doctorId":{"type":"string","description":"Doctor user ID (defaults to activeProfile)"},"patientId":{"type":"string","description":"Unused alias"}},"required":[]},"hasHandler":true,"hasExecute":true,"__source":"spec","executable":true,"handlerField":"execute"},{"name":"list_patient_doctors","kind":"answer","impl":"imperative","description":"Lists all doctors linked to a patient.","title":"list_patient_doctors","annotations":{"readOnlyHint":true},"inputSchema":{"type":"object","properties":{"patientId":{"type":"string","description":"Patient ID (defaults to activeProfile)"}},"required":[]},"hasHandler":true,"hasExecute":true,"__source":"spec","executable":true,"handlerField":"execute"},{"name":"view_patient_as_doctor","kind":"act","impl":"imperative","description":"Doctor view of patient record — returns patient demographics, meds, labs, conditions, allergies if doctor has active link.","title":"view_patient_as_doctor","annotations":{"readOnlyHint":true},"inputSchema":{"type":"object","properties":{"patientId":{"type":"string","description":"Patient ID to view"},"doctorId":{"type":"string","description":"Doctor user ID (defaults to activeProfile)"},"sections":{"type":"string","description":"Comma separated sections: meds,labs,conditions,allergies,all"}},"required":["patientId"]},"hasHandler":true,"hasExecute":true,"__source":"spec","executable":true,"handlerField":"execute"}],"category":"Health & Education","apiSurface":"spec","toolCount":47}}