Search ICD-10 Codes
search_codesSearch ICD-10-CM 2025 diagnosis codes by keyword to find matching codes with descriptions and billable status for medical coding.
Instructions
Search the ICD-10-CM 2025 code directory by description text. Returns matching codes with descriptions and billable status. Useful for finding specific diagnosis codes by keyword.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | Search query to match against ICD-10 code descriptions | |
| limit | No | Maximum results (1-100, default: 20) | |
| offset | No | Pagination offset (default: 0) |
Implementation Reference
- src/tools.ts:102-112 (handler)The handler function for 'search_codes' that calls the ICD-10 search client and formats the response.
async (args) => { try { const result = await client.icd10.search(args.query, { limit: args.limit, offset: args.offset, }); return ok(formatSearchResponse(result)); } catch (error) { return fail(error); } } - src/tools.ts:80-95 (schema)Input schema definition for the 'search_codes' tool using Zod.
inputSchema: { query: z.string().min(1).describe("Search query to match against ICD-10 code descriptions"), limit: z .number() .int() .min(1) .max(100) .default(20) .describe("Maximum results (1-100, default: 20)"), offset: z .number() .int() .min(0) .default(0) .describe("Pagination offset (default: 0)"), }, - src/tools.ts:72-113 (registration)Tool registration for 'search_codes' in the MCP server.
server.registerTool( "search_codes", { title: "Search ICD-10 Codes", description: "Search the ICD-10-CM 2025 code directory by description text. " + "Returns matching codes with descriptions and billable status. " + "Useful for finding specific diagnosis codes by keyword.", inputSchema: { query: z.string().min(1).describe("Search query to match against ICD-10 code descriptions"), limit: z .number() .int() .min(1) .max(100) .default(20) .describe("Maximum results (1-100, default: 20)"), offset: z .number() .int() .min(0) .default(0) .describe("Pagination offset (default: 0)"), }, annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true, }, }, async (args) => { try { const result = await client.icd10.search(args.query, { limit: args.limit, offset: args.offset, }); return ok(formatSearchResponse(result)); } catch (error) { return fail(error); } } );