medical-codes-mcp-server
medcode_search_codesFind US medical codes whose official descriptions match a described concept, via full-text search over the bundled index. Every search term must appear — matched first as a token prefix, then as a substring so inflected and compound forms are also found (a "neuropathy" search surfaces "mononeuropathy"/"polyneuropathy" siblings too, not only a standalone "neuropathy" token). Filter by system (ICD10CM/ICD10PCS/HCPCS/RXNORM), billableOnly to exclude headers/categories, and chapter. Use when you have a clinical description and need the code — the reverse of medcode_get_code. Results echo the resolved system per row for chaining, rank exact prefix matches ahead of substring-only matches with a deterministic tie-break, and disclose truncation with a nextCursor: pass it back as cursor to page through the full ranked set.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Max codes per page. Defaults to the server's MEDCODE_MAX_RESULTS (50), ceiling 200. | |
| query | Yes | Clinical description to match, e.g. "type 2 diabetes with neuropathy". Must not be blank or whitespace-only. | |
| cursor | No | Opaque continuation token from a previous response's `nextCursor`, to fetch the next page of the same ranked result set. Omit for the first page. | |
| system | No | Restrict results to one system. Omit to search all bundled systems. | |
| chapter | No | Restrict to a chapter/range bucket (the value from a code's `chapter` field). Case-insensitive: surrounding whitespace is trimmed and the value is upper-cased to match how chapters are stored, and `appliedFilters.chapter` echoes the upper-cased value that actually ran. A blank or whitespace-only value carries no filtering intent and is treated as omitted, which the response discloses as `appliedFilters.chapter: null`. | |
| billableOnly | No | When true, return only billable leaf codes (exclude headers/categories). |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cap | No | The page size that was applied. | |
| codes | No | Matching codes, ranked by full-text relevance. | |
| error | No | Present when the call failed. Absent on success. | |
| shown | No | Number of codes returned on this page. | |
| notice | No | Guidance when nothing matched — echoes the query and suggests how to broaden. | |
| truncated | No | True when more matches exist beyond this page. | |
| nextCursor | No | Opaque token to pass back as `cursor` for the next page. Present only when more matches exist beyond this page. | |
| appliedFilters | No | Filters the server applied to the search. | |
| effectiveQuery | No | The query as the server parsed it for matching. |