Skip to main content
Glama

Search ICD-10 Codes

search_codes
Read-onlyIdempotent

Search 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

TableJSON Schema
NameRequiredDescriptionDefault
queryYesSearch query to match against ICD-10 code descriptions
limitNoMaximum results (1-100, default: 20)
offsetNoPagination offset (default: 0)

Implementation Reference

  • 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);
      }
    }
  • 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);
        }
      }
    );
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations indicate read-only, idempotent, non-destructive behavior. The description adds valuable behavioral context by disclosing return values ('matching codes with descriptions and billable status') which compensates for the missing output schema, and specifies the 2025 version of the directory being searched.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Three sentences are perfectly weighted: first establishes core action, second discloses return structure (critical given no output schema), third provides usage context. No redundancy or wasted words. Information is front-loaded with the essential operation.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the simple search interface (3 params, 100% schema coverage) and strong annotations, the description is appropriately complete. It compensates for the missing output schema by describing return values, covers the specific version (ICD-10-CM 2025), and provides adequate context for an agent to invoke the tool correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 100% schema description coverage, the baseline is 3. The description mentions 'by description text' which aligns with the query parameter but does not add additional semantic context, examples, or usage notes beyond what the schema already provides for the three parameters.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description uses specific verb 'Search' with clear resource 'ICD-10-CM 2025 code directory' and scope 'by description text'. It distinguishes from siblings like search_icd11_codes and get_code by specifying the ICD-10-CM 2025 version and text-based search approach.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description states it is 'Useful for finding specific diagnosis codes by keyword', providing implied usage context. However, it lacks explicit when-to-use guidance or named alternatives (e.g., does not mention to use get_code when the exact code is known).

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/fcggamou/autoicd-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server