# Look up a ZIP’s county and state

Use this when a plan or directory task needs the county/state for a ZIP. One valid county resolves automatically; ask when several match. purpose=residential is for home plan availability; purpose=search is for a doctor, hospital, facility or pharmacy search area. Revalidate after ZIP changes and never overwrite home with an office ZIP. This does not verify residence, eligibility or plan availability, and does not save an address. 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

`get_medicare_zip_counties`

## Input schema

```json
{
  "type": "object",
  "properties": {
    "zip": {
      "type": "string",
      "pattern": "^[0-9]{5}$",
      "description": "Required ZIP for this task; reuse it if already supplied."
    },
    "county": {
      "type": "string",
      "minLength": 1,
      "maxLength": 100,
      "description": "County selected by the person or previously confirmed for this ZIP. Omit if unknown; use the current choices rather than guessing."
    },
    "state": {
      "type": "string",
      "enum": [
        "AL",
        "AK",
        "AZ",
        "AR",
        "CA",
        "CO",
        "CT",
        "DE",
        "DC",
        "FL",
        "GA",
        "HI",
        "ID",
        "IL",
        "IN",
        "IA",
        "KS",
        "KY",
        "LA",
        "ME",
        "MD",
        "MA",
        "MI",
        "MN",
        "MS",
        "MO",
        "MT",
        "NE",
        "NV",
        "NH",
        "NJ",
        "NM",
        "NY",
        "NC",
        "ND",
        "OH",
        "OK",
        "OR",
        "PA",
        "RI",
        "SC",
        "SD",
        "TN",
        "TX",
        "UT",
        "VT",
        "VA",
        "WA",
        "WV",
        "WI",
        "WY",
        "PR",
        "VI",
        "GU",
        "AS",
        "MP"
      ],
      "description": "Selected two-letter state code, derived internally from the county choice or supplied state name. Needed to distinguish same-name counties across states."
    },
    "purpose": {
      "type": "string",
      "enum": [
        "residential",
        "search"
      ],
      "default": "residential",
      "description": "Residential for home/plan availability; search for a doctor, hospital, facility or pharmacy search area. Keep these contexts separate."
    }
  },
  "required": [
    "zip"
  ],
  "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.

```json
{
  "jsonrpc": "2.0",
  "id": 3,
  "method": "tools/call",
  "params": {
    "name": "get_medicare_zip_counties",
    "arguments": {
      "zip": "60614"
    }
  }
}
```

## Connection

POST JSON-RPC to https://tools.thepocketprotector.com/mcp with method `tools/call`, name `get_medicare_zip_counties`, 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

```json
{
  "title": "Look up a ZIP’s county and state",
  "readOnlyHint": true,
  "openWorldHint": true,
  "destructiveHint": false
}
```

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