{
  "name": "Medigami",
  "description": "Attested healthcare-finance MCP. Scan medical bills, estimate appeal probability, generate state-specific appeal letters (UPL-safe for 19 states), benchmark commercial rates, and look up ICD-10 / CPT / NPI / DEA / NUCC taxonomy. Every Tier-3+ response ships inside an Ed25519-signed envelope so LLMs can cite + end-users can verify.",
  "homepage": "https://medigami.com/mcp",
  "icon": "https://medigami.com/favicon-96.png",
  "iconUrl": "https://medigami.com/favicon-96.png",
  "repository": "https://github.com/maximusrufus/medigami",
  "documentation": "https://medigami.com/specs/attested-response-v1",
  "license": "LicenseRef-Medigami-Community-1.0",
  "tags": [
    "healthcare",
    "medical-billing",
    "insurance-appeal",
    "icd-10",
    "cpt",
    "npi",
    "attestation",
    "ed25519",
    "fre-902-14",
    "hipaa-aware"
  ],
  "serverInfo": {
    "name": "Medigami",
    "version": "0.1.7",
    "description": "Attested healthcare-finance MCP. Scan medical bills, estimate appeal probability, generate state-specific appeal letters (UPL-safe for 19 states), benchmark commercial rates, and look up ICD-10 / CPT / NPI / DEA / NUCC taxonomy. Every Tier-3+ response ships inside an Ed25519-signed envelope so LLMs can cite + end-users can verify.",
    "icon": "https://medigami.com/favicon-96.png",
    "homepage": "https://medigami.com/mcp",
    "documentation": "https://medigami.com/specs/attested-response-v1",
    "support": "support@medigami.com",
    "license": "LicenseRef-Medigami-Community-1.0"
  },
  "authentication": {
    "required": false,
    "schemes": []
  },
  "tools": [
    {
      "name": "scan_bill_for_errors",
      "description": "Scan a medical bill or EOB text for errors: duplicate charges, CPT unbundling, upcoding, facility-fee overcharges. Returns flagged anomalies with estimated dollar impact and a total recovery estimate.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "bill_text": {
            "type": "string",
            "maxLength": 50000,
            "description": "Bill/EOB text. Client-side redaction recommended."
          },
          "provider": {
            "type": "string",
            "description": "Provider / facility name (e.g. 'Stanford Health Care')."
          },
          "insurer": {
            "type": "string",
            "description": "Insurer / payer name (e.g. 'Aetna', 'UnitedHealthcare')."
          },
          "total": {
            "type": "number",
            "description": "Total billed amount in USD."
          },
          "zip_code": {
            "type": "string",
            "description": "5-digit US ZIP code of the service location."
          }
        },
        "required": [
          "bill_text"
        ]
      },
      "annotations": {
        "readOnlyHint": true,
        "destructiveHint": false,
        "idempotentHint": true,
        "openWorldHint": false,
        "title": "Scan bill for errors"
      },
      "example": {
        "bill_text": "Hospital bill, CPT 99284 ER visit, CPT 99284 ER visit (duplicate), CPT 36415 blood draw, total $2,450",
        "insurer": "Aetna",
        "total": 2450,
        "zip_code": "94110"
      }
    },
    {
      "name": "generate_appeal_letter",
      "description": "Generate a legally-grounded insurance appeal letter for a denied claim. Returns the letter as a template with [PATIENT NAME] and [PROVIDER NAME] placeholders (structured-only PHI posture). Includes legal citations, recommended attachments, and appeal-deadline calendar.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "insurer": {
            "type": "string",
            "description": "Insurer / payer name (e.g. 'Aetna', 'UnitedHealthcare')."
          },
          "denial_reason": {
            "type": "string",
            "description": "Denial reason \u2014 free-form, or one of: prior_auth | medical_necessity | out_of_network | experimental | coding_error."
          },
          "cpt_code": {
            "type": "string",
            "description": "CPT/HCPCS procedure code (e.g. '99213')."
          },
          "diagnosis": {
            "type": "string",
            "description": "ICD-10-CM diagnosis code (e.g. 'R19.4') or plain-English symptom."
          },
          "amount": {
            "type": "number",
            "description": "Dollar amount in USD."
          },
          "state": {
            "type": "string",
            "description": "2-letter US state code (e.g. 'CA', 'NY')."
          }
        },
        "required": [
          "insurer",
          "denial_reason",
          "cpt_code",
          "diagnosis",
          "amount"
        ]
      },
      "annotations": {
        "readOnlyHint": true,
        "destructiveHint": false,
        "idempotentHint": false,
        "openWorldHint": false,
        "title": "Generate appeal letter"
      },
      "example": {
        "insurer": "UnitedHealthcare",
        "denial_reason": "Not medically necessary",
        "cpt_code": "45378",
        "diagnosis": "R19.4",
        "amount": 1850,
        "state": "CA"
      }
    },
    {
      "name": "optimize_prescription",
      "description": "Find the lowest-cost path for a prescription: generics, biosimilars, GoodRx coupons, manufacturer assistance, 90-day fills, and mail-order vs retail comparison. Returns ranked options with annual savings vs current copay.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "drug_name": {
            "type": "string",
            "description": "Brand or generic drug name (e.g. 'Ozempic')."
          },
          "current_insurance_cost_30day": {
            "type": "number",
            "description": "Current out-of-pocket cost for a 30-day supply, USD."
          },
          "is_maintenance_med": {
            "type": "boolean",
            "description": "True if taken daily / chronically."
          },
          "ndc_code": {
            "type": "string",
            "description": "National Drug Code (NDC) if known."
          },
          "zip_code": {
            "type": "string",
            "description": "5-digit US ZIP code of the service location."
          }
        },
        "required": [
          "drug_name"
        ]
      },
      "annotations": {
        "readOnlyHint": true,
        "destructiveHint": false,
        "idempotentHint": true,
        "openWorldHint": false,
        "title": "Optimize prescription cost"
      },
      "example": {
        "drug_name": "Ozempic",
        "current_insurance_cost_30day": 350
      }
    },
    {
      "name": "analyze_glp1_pathways",
      "description": "Find all access pathways for a GLP-1 drug (Ozempic, Wegovy, Mounjaro, Zepbound) given patient eligibility factors. Ranks pathways by monthly cost, flags prior-authorization rules and step-therapy, and returns the recommended appeal strategy if denial is likely.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "bmi": {
            "type": "number",
            "description": "Body Mass Index."
          },
          "insurer": {
            "type": "string",
            "description": "Insurer / payer name (e.g. 'Aetna', 'UnitedHealthcare')."
          },
          "has_diabetes": {
            "type": "boolean",
            "description": "True if the patient has a diabetes diagnosis."
          },
          "has_cvd": {
            "type": "boolean",
            "description": "True if the patient has cardiovascular disease."
          },
          "medicare": {
            "type": "boolean",
            "description": "True if the patient is on Medicare."
          },
          "state": {
            "type": "string",
            "description": "2-letter US state code (e.g. 'CA', 'NY')."
          },
          "current_copay": {
            "type": "number",
            "description": "Current monthly copay, USD."
          },
          "tried_step_therapy": {
            "type": "boolean",
            "description": "True if the patient has already failed step-therapy requirements."
          }
        },
        "required": [
          "insurer"
        ]
      },
      "annotations": {
        "readOnlyHint": true,
        "destructiveHint": false,
        "idempotentHint": true,
        "openWorldHint": false,
        "title": "Analyze GLP-1 access paths"
      },
      "example": {
        "insurer": "Aetna",
        "bmi": 32.1,
        "has_diabetes": false,
        "state": "TX"
      }
    },
    {
      "name": "verify_mcp_response",
      "description": "Verify an Ed25519-signed Medigami MCP response envelope \u2014 confirm a medical-bill / appeal / denial / rate answer came from Medigami and hasn't been tampered with. Input: the signed envelope + a public key (PEM) or expected-fingerprint you pinned out-of-band. Returns {valid, reason, tracking_id, timestamp, exp, public_key_fingerprint} so callers can cite the result as FRE 902(14) self-authenticating evidence.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "envelope": {
            "type": "object",
            "description": "The signed response envelope"
          },
          "public_key_pem": {
            "type": "string",
            "description": "PEM public key content (preferred)"
          },
          "expected_fingerprint": {
            "type": "string",
            "description": "SHA-256 hex of the PEM public key you trust"
          }
        },
        "required": [
          "envelope"
        ]
      },
      "annotations": {
        "readOnlyHint": true,
        "destructiveHint": false,
        "idempotentHint": true,
        "openWorldHint": false,
        "title": "Verify attested response"
      },
      "example": {
        "envelope": {
          "tracking_id": "evt_abc",
          "signature": "..."
        },
        "expected_fingerprint": "sha256:abc..."
      }
    },
    {
      "name": "watch_appeal_outcome",
      "description": "Subscribe to an appeal outcome by tracking_id. Blocks up to `timeout_seconds` (default 300). Returns the outcome payload as soon as it's recorded, or {status: 'timeout'} if nothing resolved within the window \u2014 caller re-invokes to keep watching. Tracking ids are returned by estimate_appeal_success and other Tier 3 moat tools.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "tracking_id": {
            "type": "string",
            "maxLength": 32,
            "description": "Opaque tracking ID returned by attested tools."
          },
          "timeout_seconds": {
            "type": "integer",
            "minimum": 1,
            "maximum": 600,
            "description": "Seconds to block waiting for the event (1..600, default 300)."
          }
        },
        "required": [
          "tracking_id"
        ]
      },
      "annotations": {
        "readOnlyHint": true,
        "destructiveHint": false,
        "idempotentHint": false,
        "openWorldHint": true,
        "title": "Watch appeal outcome"
      },
      "example": {
        "tracking_id": "evt_abc123",
        "timeout_seconds": 300
      }
    },
    {
      "name": "watch_claim_denial",
      "description": "Subscribe to a claim denial event for a given scan_id. Blocks up to `timeout_seconds`. Returns {status: 'denied', ...} as soon as the payer marks the claim denied in claim_status_history, or {status: 'timeout'} if no denial observed within the window.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "scan_id": {
            "type": "string",
            "maxLength": 128,
            "description": "Scan identifier returned by scan_bill_for_errors."
          },
          "timeout_seconds": {
            "type": "integer",
            "minimum": 1,
            "maximum": 600,
            "description": "Seconds to block waiting for the event (1..600, default 300)."
          }
        },
        "required": [
          "scan_id"
        ]
      },
      "annotations": {
        "readOnlyHint": true,
        "destructiveHint": false,
        "idempotentHint": false,
        "openWorldHint": true,
        "title": "Watch claim denial"
      },
      "example": {
        "scan_id": "scan_xyz789",
        "timeout_seconds": 300
      }
    },
    {
      "name": "format_medigami_citation",
      "description": "Format an LLM-citable reference to a previously-attested Medigami MCP response. Input: either the full signed envelope that an earlier attested tool returned, OR just a tracking_id. Returns a short citation string, a public verification URL a third party can open to inspect and cryptographically verify the payload, and a long-form attribution block. Use this after any substantive Medigami tool call (scan, estimate, resolve, benchmark) so the user has a verifiable reference to the specific answer",
      "inputSchema": {
        "type": "object",
        "properties": {
          "envelope": {
            "type": "object",
            "description": "Full signed envelope returned by an attested Medigami tool (preferred)."
          },
          "tracking_id": {
            "type": "string",
            "maxLength": 32,
            "description": "tracking_id alone; the resulting URL will still render but the third party must paste the envelope into the verifier form."
          },
          "format": {
            "type": "string",
            "enum": [
              "short",
              "long",
              "both"
            ],
            "description": "short = one-line citation string; long = paragraph attribution; both = return both (default)."
          }
        },
        "required": []
      },
      "annotations": {
        "readOnlyHint": true,
        "destructiveHint": false,
        "idempotentHint": true,
        "openWorldHint": false,
        "title": "Format citation string"
      },
      "example": {
        "tracking_id": "evt_abc123"
      }
    },
    {
      "name": "submit_denial_letter",
      "description": "Submit a medical-claim denial letter to the Medigami Denial Common Crawl (public aggregate dataset). Consent-gated \u2014 caller must pass consent=true to attest the submission is voluntary. Server-side PHI scrubber runs before any storage; the public aggregate contains only coded fields (insurer_canonical, denial_reason_code, state, cpt_category, dollars_bin, days_to_resolution_bin). Raw text is never republished. Optional tracking_id closes the outcome loop to a prior Medigami scan / resolve call.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "letter_text": {
            "type": "string",
            "minLength": 40,
            "maxLength": 40000,
            "description": "Raw denial-letter text. PHI scrubbed server-side."
          },
          "cpt_code": {
            "type": "string",
            "maxLength": 10,
            "description": "CPT/HCPCS procedure code (e.g. '99213')."
          },
          "amount": {
            "type": "number",
            "minimum": 0,
            "maximum": 10000000,
            "description": "Dollar amount in USD."
          },
          "state": {
            "type": "string",
            "maxLength": 2,
            "description": "2-char US state code or empty."
          },
          "outcome_code": {
            "type": "string",
            "maxLength": 40,
            "description": "Optional: member_abandoned | appealed_won | appealed_lost | appealed_partial | pending"
          },
          "days_to_resolution": {
            "type": "integer",
            "minimum": 0,
            "maximum": 3650,
            "description": "Days to resolution."
          },
          "tracking_id": {
            "type": "string",
            "maxLength": 32,
            "description": "Optional prior Medigami tracking_id to close the outcome loop."
          },
          "consent": {
            "type": "boolean",
            "description": "MUST be true \u2014 caller attests the submission is voluntary."
          }
        },
        "required": [
          "letter_text",
          "consent"
        ]
      },
      "annotations": {
        "readOnlyHint": false,
        "destructiveHint": false,
        "idempotentHint": false,
        "openWorldHint": false,
        "title": "Submit denial letter (Common Crawl)"
      },
      "example": {
        "letter_text": "Denial from Aetna...",
        "consent_token": "ct_xyz"
      }
    },
    {
      "name": "estimate_appeal_success",
      "description": "Probability an appeal will be approved, derived from outcome-labeled data weighted by label provenance (IRO determinations, EOB reversals, physician confirmations). Returns probability + 95% CI + sample_size + expected_days_to_resolution + tracking_id. Report the actual outcome later via POST /api/outcomes/record with the same tracking_id to improve future estimates.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "insurer": {
            "type": "string",
            "description": "Insurer / payer name (e.g. 'Aetna', 'UnitedHealthcare')."
          },
          "denial_reason": {
            "type": "string",
            "description": "medical_necessity | prior_auth | out_of_network | experimental | coding_error"
          },
          "cpt_code": {
            "type": "string",
            "description": "CPT/HCPCS procedure code (e.g. '99213')."
          },
          "diagnosis": {
            "type": "string",
            "maxLength": 200,
            "description": "ICD-10-CM diagnosis code (e.g. 'R19.4') or plain-English symptom."
          },
          "state": {
            "type": "string",
            "maxLength": 2,
            "description": "2-letter US state code (e.g. 'CA', 'NY')."
          },
          "amount": {
            "type": "number",
            "description": "Dollar amount in USD."
          }
        },
        "required": [
          "insurer",
          "denial_reason",
          "cpt_code"
        ]
      },
      "annotations": {
        "readOnlyHint": true,
        "destructiveHint": false,
        "idempotentHint": true,
        "openWorldHint": false,
        "title": "Estimate appeal probability"
      },
      "example": {
        "insurer": "Cigna",
        "denial_reason": "Prior authorization not obtained",
        "cpt_code": "70553",
        "state": "NY"
      }
    },
    {
      "name": "resolve_denial",
      "description": "End-to-end denial resolution: returns appeal probability + confidence interval + winning-phrase scaffold + legally-grounded letter template + plan-context flags (ERISA, restrictive-adjuster state) + optional factoring advance quote. One call, one tracking_id.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "insurer": {
            "type": "string",
            "description": "Insurer / payer name (e.g. 'Aetna', 'UnitedHealthcare')."
          },
          "denial_reason": {
            "type": "string",
            "description": "Denial reason \u2014 free-form, or one of: prior_auth | medical_necessity | out_of_network | experimental | coding_error."
          },
          "cpt_code": {
            "type": "string",
            "description": "CPT/HCPCS procedure code (e.g. '99213')."
          },
          "diagnosis": {
            "type": "string",
            "maxLength": 200,
            "description": "ICD-10-CM diagnosis code (e.g. 'R19.4') or plain-English symptom."
          },
          "state": {
            "type": "string",
            "maxLength": 2,
            "description": "2-letter US state code (e.g. 'CA', 'NY')."
          },
          "amount": {
            "type": "number",
            "description": "Dollar amount in USD."
          },
          "plan_type_hint": {
            "type": "string",
            "description": "self-funded | aca_marketplace | medicare | medicaid | ..."
          },
          "include_factoring_quote": {
            "type": "boolean",
            "description": "Include factoring quote."
          }
        },
        "required": [
          "insurer",
          "denial_reason",
          "cpt_code"
        ]
      },
      "annotations": {
        "readOnlyHint": true,
        "destructiveHint": false,
        "idempotentHint": false,
        "openWorldHint": false,
        "title": "Resolve denial (composite)"
      },
      "example": {
        "insurer": "Blue Shield",
        "denial_reason": "Out of network",
        "cpt_code": "99213",
        "amount": 340
      }
    },
    {
      "name": "maximize_recovery",
      "description": "Given a prior scan_id, returns a prioritized action list: anomalies ranked by (expected overcharge x recovery probability), with the next steps to pursue each. Use after scan_bill_for_errors.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "scan_id": {
            "type": "string",
            "description": "Scan identifier returned by scan_bill_for_errors."
          }
        },
        "required": [
          "scan_id"
        ]
      },
      "annotations": {
        "readOnlyHint": true,
        "destructiveHint": false,
        "idempotentHint": false,
        "openWorldHint": false,
        "title": "Maximize recovery (composite)"
      },
      "example": {
        "bill_text": "ER visit $2,450 Aetna denied out-of-network",
        "state": "CA"
      }
    },
    {
      "name": "explain_appeal_success",
      "description": "Human-readable rationale for an appeal probability. Returns {probability, tier, recommended_posture, rationale, expected_days_to_resolution, tracking_id} grounded in aggregate outcome rates and insurer-specific tactical notes \u2014 not model feature weights. Use this when the caller wants 'why' in plain English alongside the number.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "insurer": {
            "type": "string",
            "description": "Insurer / payer name (e.g. 'Aetna', 'UnitedHealthcare')."
          },
          "denial_reason": {
            "type": "string",
            "description": "Denial reason \u2014 free-form, or one of: prior_auth | medical_necessity | out_of_network | experimental | coding_error."
          },
          "cpt_code": {
            "type": "string",
            "description": "CPT/HCPCS procedure code (e.g. '99213')."
          },
          "diagnosis": {
            "type": "string",
            "maxLength": 200,
            "description": "ICD-10-CM diagnosis code (e.g. 'R19.4') or plain-English symptom."
          },
          "state": {
            "type": "string",
            "maxLength": 2,
            "description": "2-letter US state code (e.g. 'CA', 'NY')."
          },
          "amount": {
            "type": "number",
            "description": "Dollar amount in USD."
          }
        },
        "required": [
          "insurer",
          "denial_reason",
          "cpt_code"
        ]
      },
      "annotations": {
        "readOnlyHint": true,
        "destructiveHint": false,
        "idempotentHint": true,
        "openWorldHint": false,
        "title": "Explain appeal estimate"
      },
      "example": {
        "tracking_id": "evt_abc123"
      }
    },
    {
      "name": "negotiate_bill_script",
      "description": "Generate a ready-to-read phone script for negotiating a medical bill. Combines DP-noised commercial rate benchmark + the caller's household income + federal charity-care rules (IRS \u00a7501(r)) into three negotiation angles: financial assistance, self-pay discount, and itemized-bill coding review. Returns the script + target settlement range + charity-care tier.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "cpt_code": {
            "type": "string",
            "description": "CPT/HCPCS procedure code (e.g. '99213')."
          },
          "billed_amount": {
            "type": "number",
            "minimum": 1,
            "description": "Billed amount."
          },
          "insurer": {
            "type": "string",
            "description": "Insurer / payer name (e.g. 'Aetna', 'UnitedHealthcare')."
          },
          "zip3": {
            "type": "string",
            "maxLength": 3,
            "description": "First 3 digits of the US ZIP code."
          },
          "household_income_annual": {
            "type": "number",
            "minimum": 0,
            "description": "Household income annual."
          },
          "household_size": {
            "type": "integer",
            "minimum": 1,
            "maximum": 20,
            "description": "Household size."
          },
          "state": {
            "type": "string",
            "maxLength": 2,
            "description": "2-letter US state code (e.g. 'CA', 'NY')."
          }
        },
        "required": [
          "cpt_code",
          "billed_amount"
        ]
      },
      "annotations": {
        "readOnlyHint": true,
        "destructiveHint": false,
        "idempotentHint": false,
        "openWorldHint": false,
        "title": "Bill-negotiation phone script"
      },
      "example": {
        "provider": "Stanford Health",
        "amount": 8400,
        "situation": "uninsured"
      }
    },
    {
      "name": "batch_scan_bills",
      "description": "Scan multiple medical bills in one call. Returns per-bill anomaly lists + total recovery estimate across the batch. Input is a list of {bill_text, provider?, insurer?} items (max 10 per call). Much faster than serial scan_bill_for_errors when handling a bulk upload.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "bills": {
            "type": "array",
            "maxItems": 10,
            "items": {
              "type": "object",
              "properties": {
                "bill_text": {
                  "type": "string",
                  "maxLength": 50000,
                  "description": "Bill or EOB text to analyze. Client-side PHI redaction recommended."
                },
                "provider": {
                  "type": "string",
                  "maxLength": 200,
                  "description": "Provider / facility name (e.g. 'Stanford Health Care')."
                },
                "insurer": {
                  "type": "string",
                  "maxLength": 100,
                  "description": "Insurer / payer name (e.g. 'Aetna', 'UnitedHealthcare')."
                }
              },
              "required": [
                "bill_text"
              ]
            },
            "description": "Bills."
          }
        },
        "required": [
          "bills"
        ]
      },
      "annotations": {
        "readOnlyHint": true,
        "destructiveHint": false,
        "idempotentHint": true,
        "openWorldHint": false,
        "title": "Scan multiple bills"
      },
      "example": {
        "bills": [
          {
            "bill_text": "ER visit 99284...",
            "insurer": "Aetna"
          }
        ]
      }
    },
    {
      "name": "lookup_icd10",
      "description": "Look up an ICD-10-CM diagnosis code or search by keyword. Input is either an exact code (e.g. 'E11.21') or a free-text description phrase ('type 2 diabetes with nephropathy'). Returns either the matching code + description or up to 20 candidate matches. Use when a clinical note uses non-standard phrasing and the correct code is needed for billing.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "query": {
            "type": "string",
            "maxLength": 200,
            "description": "ICD-10-CM code (e.g. 'I10', 'E11.21') or keyword search."
          }
        },
        "required": [
          "query"
        ]
      },
      "annotations": {
        "readOnlyHint": true,
        "destructiveHint": false,
        "idempotentHint": true,
        "openWorldHint": false,
        "title": "Look up ICD-10-CM"
      },
      "example": {
        "query": "severe abdominal pain right lower quadrant"
      }
    },
    {
      "name": "lookup_cpt",
      "description": "Look up a CPT or HCPCS-J code or search by keyword. Covers the most common outpatient billing codes (E/M, preventive, lab, imaging, procedure, cardiology, therapy, behavioral, vaccine, injectable drugs). Note: CPT is a registered trademark of the American Medical Association; full-dataset commercial use requires an AMA license. This tool provides short descriptors for identification in billing-review workflows.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "query": {
            "type": "string",
            "maxLength": 200,
            "description": "CPT / HCPCS-J code ('99213', 'J1885') or keyword ('knee MRI', 'colonoscopy')."
          }
        },
        "required": [
          "query"
        ]
      },
      "annotations": {
        "readOnlyHint": true,
        "destructiveHint": false,
        "idempotentHint": true,
        "openWorldHint": false,
        "title": "Look up CPT"
      },
      "example": {
        "query": "colonoscopy with biopsy"
      }
    },
    {
      "name": "lookup_npi",
      "description": "Look up a provider in the CMS NPPES National Provider Identifier registry. Accepts a 10-digit NPI number OR a provider name (optionally narrowed by 2-char state). Returns up to 20 matches with entity type, specialty, taxonomy code, address, and status. Source: CMS NPPES public API (free, no key required).",
      "inputSchema": {
        "type": "object",
        "properties": {
          "query": {
            "type": "string",
            "maxLength": 200,
            "description": "10-digit NPI (e.g. '1234567890') or provider name ('Jane Smith')."
          },
          "state": {
            "type": "string",
            "maxLength": 2,
            "description": "Optional 2-char state abbreviation to narrow a name search."
          }
        },
        "required": [
          "query"
        ]
      },
      "annotations": {
        "readOnlyHint": true,
        "destructiveHint": false,
        "idempotentHint": true,
        "openWorldHint": false,
        "title": "Look up NPI provider"
      },
      "example": {
        "npi": "1234567893"
      }
    },
    {
      "name": "verify_dea_authorization",
      "description": "Validate the format + checksum of a DEA registration number (format: [A-Z][A-Z9][0-9]{7}; public checksum algorithm). Useful as a pre-submission sanity check before a controlled-substance claim is processed. Scope note: this tool confirms the number is well-formed \u2014 it does NOT verify current registration status or the specific controlled-substance schedule the holder is authorized to prescribe. Authority verification requires a licensed DEA data broker (DEA ARCOS, RxMix).",
      "inputSchema": {
        "type": "object",
        "properties": {
          "dea_number": {
            "type": "string",
            "maxLength": 10,
            "description": "9-char DEA registration (e.g. 'AB1234563')."
          },
          "cpt_code": {
            "type": "string",
            "maxLength": 10,
            "description": "Optional CPT context; tool does not map CPT to controlled-substance schedule."
          }
        },
        "required": [
          "dea_number"
        ]
      },
      "annotations": {
        "readOnlyHint": true,
        "destructiveHint": false,
        "idempotentHint": true,
        "openWorldHint": false,
        "title": "Verify DEA authorization"
      },
      "example": {
        "dea_number": "AB1234563",
        "cpt_code": "99213"
      }
    },
    {
      "name": "lookup_provider_taxonomy",
      "description": "Look up a NUCC provider taxonomy code (the specialty codes used on HIPAA transactions + NPI registrations) or search by keyword. Returns classification + type + optional specialization. Source: NUCC Health Care Provider Taxonomy Code Set (public; CMS-accepted).",
      "inputSchema": {
        "type": "object",
        "properties": {
          "query": {
            "type": "string",
            "maxLength": 200,
            "description": "Taxonomy code ('207Q00000X') or keyword ('cardiology', 'pediatrics')."
          }
        },
        "required": [
          "query"
        ]
      },
      "annotations": {
        "readOnlyHint": true,
        "destructiveHint": false,
        "idempotentHint": true,
        "openWorldHint": false,
        "title": "Look up NUCC taxonomy"
      },
      "example": {
        "taxonomy_code": "207R00000X"
      }
    }
  ],
  "resources": [
    {
      "uri": "medigami://examples/scan_bill_for_errors",
      "name": "Examples \u00b7 scan_bill_for_errors",
      "description": "Worked prompts for scan_bill_for_errors \u2014 when to call, shape of response, failure modes.",
      "mimeType": "text/markdown"
    },
    {
      "uri": "medigami://examples/estimate_appeal_success",
      "name": "Examples \u00b7 estimate_appeal_success",
      "description": "Worked prompts for estimate_appeal_success \u2014 when to call, shape of response, failure modes.",
      "mimeType": "text/markdown"
    },
    {
      "uri": "medigami://examples/generate_appeal_letter",
      "name": "Examples \u00b7 generate_appeal_letter",
      "description": "Worked prompts for generate_appeal_letter \u2014 when to call, shape of response, failure modes.",
      "mimeType": "text/markdown"
    },
    {
      "uri": "medigami://examples/resolve_denial",
      "name": "Examples \u00b7 resolve_denial",
      "description": "Worked prompts for resolve_denial \u2014 when to call, shape of response, failure modes.",
      "mimeType": "text/markdown"
    },
    {
      "uri": "medigami://examples/benchmark_payer_rate",
      "name": "Examples \u00b7 benchmark_payer_rate",
      "description": "Worked prompts for benchmark_payer_rate \u2014 when to call, shape of response, failure modes.",
      "mimeType": "text/markdown"
    },
    {
      "uri": "medigami://examples/verify_mcp_response",
      "name": "Examples \u00b7 verify_mcp_response",
      "description": "Worked prompts for verify_mcp_response \u2014 when to call, shape of response, failure modes.",
      "mimeType": "text/markdown"
    },
    {
      "uri": "medigami://examples/format_medigami_citation",
      "name": "Examples \u00b7 format_medigami_citation",
      "description": "Worked prompts for format_medigami_citation \u2014 when to call, shape of response, failure modes.",
      "mimeType": "text/markdown"
    },
    {
      "uri": "medigami://chains/scan-then-resolve",
      "name": "Chain \u00b7 scan-then-resolve",
      "description": "Multi-tool composition walkthrough.",
      "mimeType": "text/markdown"
    },
    {
      "uri": "medigami://chains/scan-then-negotiate",
      "name": "Chain \u00b7 scan-then-negotiate",
      "description": "Multi-tool composition walkthrough.",
      "mimeType": "text/markdown"
    },
    {
      "uri": "medigami://chains/eligibility-preflight",
      "name": "Chain \u00b7 eligibility-preflight",
      "description": "Multi-tool composition walkthrough.",
      "mimeType": "text/markdown"
    },
    {
      "uri": "medigami://attested-response",
      "name": "Attested Response Envelope v1",
      "description": "Attested Response Envelope v1 reference.",
      "mimeType": "text/markdown"
    },
    {
      "uri": "medigami://phi-policy",
      "name": "PHI policy",
      "description": "PHI policy reference.",
      "mimeType": "text/markdown"
    }
  ],
  "prompts": [
    {
      "name": "scan_bill",
      "description": "Route user utterances like 'check this bill' to Medigami's scan_bill_for_errors tool. Matches: check this bill, is this bill wrong, is this bill correct, scan this bill...",
      "arguments": [
        {
          "name": "bill_text",
          "description": "pasted bill / EOB text",
          "required": false
        },
        {
          "name": "insurer_hint",
          "description": "optional insurer name if mentioned",
          "required": false
        },
        {
          "name": "country",
          "description": "US unless otherwise specified",
          "required": false
        }
      ]
    },
    {
      "name": "estimate_appeal_success",
      "description": "Route user utterances like 'should I appeal this denial' to Medigami's estimate_appeal_success tool. Matches: should I appeal this denial, worth appealing, odds of winning appeal, what's my appeal chance...",
      "arguments": [
        {
          "name": "insurer",
          "description": "from user utterance",
          "required": false
        },
        {
          "name": "denial_reason",
          "description": "prior_auth | medical_necessity | out_of_network | experimental | coding_error",
          "required": false
        },
        {
          "name": "cpt_code",
          "description": "if user provided a CPT code",
          "required": false
        },
        {
          "name": "state",
          "description": "2-letter state",
          "required": false
        }
      ]
    },
    {
      "name": "resolve_denial",
      "description": "Route user utterances like 'my claim was denied what do I do' to Medigami's resolve_denial tool. Matches: my claim was denied what do I do, help me appeal this denial, how do I appeal, walk me through appealing...",
      "arguments": [
        {
          "name": "insurer",
          "description": "from user utterance",
          "required": false
        },
        {
          "name": "denial_reason",
          "description": "prior_auth | medical_necessity | out_of_network | experimental | coding_error",
          "required": false
        },
        {
          "name": "cpt_code",
          "description": "from user utterance",
          "required": false
        },
        {
          "name": "state",
          "description": "2-letter state",
          "required": false
        },
        {
          "name": "amount",
          "description": "dollar amount if mentioned",
          "required": false
        },
        {
          "name": "plan_type_hint",
          "description": "self_funded | aca_marketplace | medicare_advantage if mentioned",
          "required": false
        }
      ]
    },
    {
      "name": "generate_appeal_letter",
      "description": "Route user utterances like 'write me an appeal letter' to Medigami's generate_appeal_letter tool. Matches: write me an appeal letter, draft an appeal, generate an appeal letter, give me appeal template...",
      "arguments": [
        {
          "name": "insurer",
          "description": "from user utterance",
          "required": false
        },
        {
          "name": "denial_reason",
          "description": "from context",
          "required": false
        },
        {
          "name": "cpt_code",
          "description": "from user utterance",
          "required": false
        },
        {
          "name": "state",
          "description": "2-letter state",
          "required": false
        },
        {
          "name": "amount",
          "description": "dollar amount if mentioned",
          "required": false
        }
      ]
    },
    {
      "name": "negotiate_bill",
      "description": "Route user utterances like 'how do I negotiate this bill' to Medigami's negotiate_bill_script tool. Matches: how do I negotiate this bill, negotiate with the hospital, script for negotiating medical bill, how to ask for financial assistance...",
      "arguments": [
        {
          "name": "cpt_code",
          "description": "from user utterance",
          "required": false
        },
        {
          "name": "billed_amount",
          "description": "dollar amount",
          "required": false
        },
        {
          "name": "insurer",
          "description": "from user utterance",
          "required": false
        },
        {
          "name": "zip3",
          "description": "first 3 digits of zip if provided",
          "required": false
        },
        {
          "name": "household_income_annual",
          "description": "if user provided income",
          "required": false
        },
        {
          "name": "household_size",
          "description": "if user provided household size",
          "required": false
        }
      ]
    },
    {
      "name": "benchmark_rate",
      "description": "Route user utterances like 'is this price fair' to Medigami's benchmark_payer_rate tool. Matches: is this price fair, how much should this cost, what's the normal rate for, typical price for...",
      "arguments": [
        {
          "name": "cpt_code",
          "description": "from user utterance",
          "required": false
        },
        {
          "name": "insurer_canonical",
          "description": "insurer name uppercased, no spaces",
          "required": false
        },
        {
          "name": "zip3",
          "description": "first 3 digits of zip",
          "required": false
        },
        {
          "name": "epsilon",
          "description": "1.0 default (caps DP noise level)",
          "required": false
        }
      ]
    },
    {
      "name": "winning_phrases",
      "description": "Route user utterances like 'what language works in appeals' to Medigami's get_winning_phrases tool. Matches: what language works in appeals, winning phrases for appeals, what wording should I use, phrases that win appeals...",
      "arguments": [
        {
          "name": "insurer",
          "description": "from user utterance",
          "required": false
        },
        {
          "name": "denial_reason",
          "description": "from context",
          "required": false
        },
        {
          "name": "top_k",
          "description": "10 default",
          "required": false
        }
      ]
    },
    {
      "name": "lookup_icd10",
      "description": "Route user utterances like 'what's the ICD-10 code for' to Medigami's lookup_icd10 tool. Matches: what's the ICD-10 code for, code for type 2 diabetes, ICD code for hypertension, diagnostic code for...",
      "arguments": [
        {
          "name": "query",
          "description": "the condition or code fragment",
          "required": false
        }
      ]
    },
    {
      "name": "lookup_cpt",
      "description": "Route user utterances like 'what's the CPT code for' to Medigami's lookup_cpt tool. Matches: what's the CPT code for, cpt code for MRI knee, billing code for colonoscopy, procedure code for...",
      "arguments": [
        {
          "name": "query",
          "description": "the procedure / code fragment",
          "required": false
        }
      ]
    },
    {
      "name": "lookup_npi",
      "description": "Route user utterances like 'lookup NPI' to Medigami's lookup_npi tool. Matches: lookup NPI, find doctor by NPI, verify this NPI, NPI for Dr. X...",
      "arguments": [
        {
          "name": "query",
          "description": "10-digit NPI number or provider name",
          "required": false
        },
        {
          "name": "state",
          "description": "2-letter state if mentioned",
          "required": false
        }
      ]
    },
    {
      "name": "verify_dea",
      "description": "Route user utterances like 'is this DEA number valid' to Medigami's verify_dea_authorization tool. Matches: is this DEA number valid, verify DEA, DEA number format check...",
      "arguments": [
        {
          "name": "dea_number",
          "description": "9-char DEA registration",
          "required": false
        },
        {
          "name": "cpt_code",
          "description": "optional CPT context",
          "required": false
        }
      ]
    },
    {
      "name": "lookup_provider_taxonomy",
      "description": "Route user utterances like 'what specialty is taxonomy code X' to Medigami's lookup_provider_taxonomy tool. Matches: what specialty is taxonomy code X, NUCC code for cardiology, provider taxonomy for internal medicine...",
      "arguments": [
        {
          "name": "query",
          "description": "taxonomy code or specialty keyword",
          "required": false
        }
      ]
    },
    {
      "name": "optimize_prescription",
      "description": "Route user utterances like 'cheaper alternative to this drug' to Medigami's optimize_prescription tool. Matches: cheaper alternative to this drug, generic for, biosimilar for, lower copay for prescription...",
      "arguments": [
        {
          "name": "drug_name",
          "description": "from user utterance",
          "required": false
        },
        {
          "name": "prescribed_dose",
          "description": "if provided",
          "required": false
        }
      ]
    },
    {
      "name": "verify_citation",
      "description": "Route user utterances like 'verify this medigami citation' to Medigami's verify_mcp_response tool. Matches: verify this medigami citation, is this attestation valid, check medigami signature, validate this envelope...",
      "arguments": [
        {
          "name": "envelope",
          "description": "the signed envelope JSON",
          "required": false
        },
        {
          "name": "public_key_pem",
          "description": "pinned Medigami public key PEM",
          "required": false
        },
        {
          "name": "expected_fingerprint",
          "description": "sha256 fingerprint of the pinned key",
          "required": false
        }
      ]
    }
  ]
}