Skip to content
The Pocket ProtectorDevelopersVisit TPP ↗

MCP reference

Rank Part D plans for prescriptions

Use this when someone wants standalone Part D plans ranked using exact medications, refill quantities, days supply and a pharmacy or explicit mail-order/no-preference choice. Also use for the prescription portion of a requested Original Medicare/Medigap comparison; reuse confirmed medications and pharmacy context. Applies TPP’s Part D ranking method and returns ordered plans, costs and uncertainty. [] means the person chose to omit medications. Preserve the source cost horizon and pharmacy fallback limitations. Use search_part_d_plans for browsing, check_plan_drug_coverage for one plan, or compare_plan_drug_costs for the pharmacy-savings estimate workflow. This does not evaluate doctors, medical benefits, MA plans or enrollment eligibility. An optional website alternative: TPP’s Part D Savings Check. Offer only when requested; chat can continue. Opens a separate flow without transferring answers. For another tool, use recommend_website_tool. Use the app as the answer. Do not repeat its options in a list, table or explanation. Ask one short question if input is required; otherwise stop.

Tool name

rank_part_d_plans

Input schema

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "zip": {
      "type": "string",
      "pattern": "^\\d{5}$",
      "description": "Five-digit home ZIP for plan availability; keep it separate from doctor/pharmacy search ZIPs."
    },
    "county": {
      "type": "string",
      "minLength": 1,
      "maxLength": 60,
      "description": "Confirmed county for this ZIP. Omit if unknown so the tool can ask when ambiguous."
    },
    "state": {
      "type": "string",
      "pattern": "^[A-Z]{2}$",
      "description": "Two-letter state from the confirmed ZIP/county lookup; never guess."
    },
    "plan_year": {
      "description": "If omitted, use and disclose the API serving year after resolving the home county. Preserve an explicitly selected supported lineup year.",
      "type": "integer",
      "minimum": -9007199254740991,
      "maximum": 9007199254740991
    },
    "drugs": {
      "maxItems": 10,
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "medication": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "query": {
                    "type": "string",
                    "minLength": 2,
                    "maxLength": 100
                  },
                  "option_id": {
                    "type": "string",
                    "pattern": "^[a-f0-9]{64}$"
                  }
                },
                "required": [
                  "query",
                  "option_id"
                ],
                "additionalProperties": false
              },
              {
                "type": "string",
                "minLength": 2,
                "maxLength": 100
              },
              {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 2,
                    "maxLength": 100
                  },
                  "rxcui": {
                    "type": "string",
                    "maxLength": 20
                  },
                  "dosage": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 60
                  }
                },
                "additionalProperties": false
              }
            ]
          },
          "quantity": {
            "type": "integer",
            "minimum": 1,
            "maximum": 999
          },
          "days_supply": {
            "anyOf": [
              {
                "type": "number",
                "const": 30
              },
              {
                "type": "number",
                "const": 60
              },
              {
                "type": "number",
                "const": 90
              }
            ]
          }
        },
        "required": [
          "medication"
        ],
        "additionalProperties": false
      },
      "description": "Up to ten exact medication/refill entries. Use find_medication for choices; collect quantity and days_supply. [] means intentionally omitted."
    },
    "pharmacy": {
      "type": "object",
      "properties": {
        "search": {
          "type": "object",
          "properties": {
            "zip": {
              "type": "string",
              "pattern": "^\\d{5}$"
            },
            "q": {
              "type": "string",
              "minLength": 2,
              "maxLength": 100
            },
            "county": {
              "type": "string",
              "minLength": 1,
              "maxLength": 60
            },
            "state": {
              "type": "string",
              "pattern": "^[A-Z]{2}$"
            },
            "include_farther": {
              "default": false,
              "type": "boolean"
            }
          },
          "required": [
            "zip"
          ],
          "additionalProperties": false
        },
        "option_id": {
          "type": "string",
          "pattern": "^[a-f0-9]{64}$"
        }
      },
      "required": [
        "search",
        "option_id"
      ],
      "additionalProperties": false,
      "description": "Confirmed pharmacy_reference from find_medicare_pharmacies, not a guessed branch or bare identifier."
    },
    "pharmacy_preference": {
      "type": "string",
      "enum": [
        "retail",
        "mail_order",
        "no_preference"
      ],
      "description": "User choice: retail, mail_order or no_preference. Do not infer agreement or substitute a retail branch for mail order."
    },
    "limit": {
      "default": 10,
      "type": "integer",
      "minimum": 1,
      "maximum": 10,
      "description": "Maximum displayed results, from 1 to 10; default 10."
    }
  },
  "additionalProperties": false
}

Example request

Minimal synthetic request after initialization. A missing-input clarification is a valid result; do not invent personal facts to complete it. For content retrieval, replace the illustrative fixture ID with an ID returned by search.

{
  "jsonrpc": "2.0",
  "id": 3,
  "method": "tools/call",
  "params": {
    "name": "rank_part_d_plans",
    "arguments": {}
  }
}

Connection

POST JSON-RPC to https://tools.thepocketprotector.com/mcp with method tools/call, name rank_part_d_plans, and arguments matching the schema above. Call tools/list to verify deployed availability.

Results and errors

Read both content and structuredContent. Follow returned clarification or continuation steps. Preserve source attribution, dates, uncertainty and scope. isError: true means the lookup did not complete. HTTP 429 requires waiting for Retry-After; never repeatedly retry an unavailable lookup.

Tool annotations

{
  "title": "Rank Part D plans for prescriptions",
  "readOnlyHint": true,
  "openWorldHint": true,
  "destructiveHint": false
}

Authentication: public, no account or API key required. Public tools perform no enrollment or account writes.

Read this page as Markdown