Skip to main content
Glama

cid10_lookup

Read-onlyIdempotent

Retrieve Portuguese description and restriction flags for any CID-10 code. Accepts both dotted and undotted formats.

Instructions

Look up a specific CID-10 code and return its Portuguese name.

Use this tool to:

  • Resolve a code to its Brazilian description ("I21" → "Infarto agudo do miocárdio")

  • Confirm a 3-char category or 4-char subcategory exists in CID-10

  • Retrieve gender / cause-of-death restriction flags when applicable

Accepts both dotted ("A00.1") and undotted ("A001") forms; returns the canonical display.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
codeYesCID-10 code (e.g., "A00", "A00.1", "A001", "I21"). Dotted and undotted forms both accepted.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
codeYes
foundYes
hitYes

Implementation Reference

  • Main handler function for the cid10_lookup tool. Accepts a code (e.g., 'A00', 'A00.1', 'A001'), parses it with Zod, delegates to the CID10Client.lookup() method, formats the result as human-readable text and structured content, and returns it as a CallToolResult.
    async function handleCID10Lookup(args: Record<string, unknown>): Promise<CallToolResult> {
      try {
        const params = CID10LookupParamsSchema.parse(args);
        const client = getCID10Client();
        const hit = client.lookup(params.code);
    
        const structured: CID10LookupOutput = {
          code: params.code,
          found: hit !== null,
          hit,
        };
    
        if (!hit) {
          return {
            content: [
              {
                type: 'text',
                text: `# CID-10 ${params.code}\n\nCódigo não encontrado em CID-10 V2008.`,
              },
            ],
            structuredContent: structured,
          };
        }
    
        const lines: string[] = [];
        lines.push(`# CID-10 ${hit.display} — ${hit.title}`);
        lines.push('');
        lines.push(`**Nível:** ${hit.level === 'category' ? 'categoria (3 caracteres)' : 'subcategoria (4 caracteres)'}`);
        if (hit.chapter_num !== null) lines.push(`**Capítulo:** ${hit.chapter_num}`);
        if (hit.group_range) lines.push(`**Grupo:** ${hit.group_range}`);
        if (hit.classif) lines.push(`**Classificação:** ${hit.classif}`);
        if (hit.restr_sexo) lines.push(`**Restrição de sexo:** ${hit.restr_sexo}`);
        if (hit.causa_obito) lines.push(`**Causa de óbito:** ${hit.causa_obito}`);
        if (hit.refer) {
          lines.push('');
          lines.push(`**Referências:** ${hit.refer}`);
        }
        if (hit.excluidos) {
          lines.push('');
          lines.push(`**Exclusões:** ${hit.excluidos}`);
        }
    
        return {
          content: [{ type: 'text', text: lines.join('\n') }],
          structuredContent: structured,
        };
      } catch (error) {
        return handleToolError(error);
      }
    }
  • Input parameter schema for cid10_lookup. Defines a single required parameter 'code' validated by CID10CodeSchema (regex: /^[A-Z]\d{2}(\.?\d)?$/i, accepting formats like A00, A001, or A00.1).
    export const CID10LookupParamsSchema = z.object({
      code: CID10CodeSchema.describe(
        'CID-10 code (e.g., "A00", "A00.1", "A001", "I21"). Dotted and undotted forms both accepted.',
      ),
    });
  • Output schema for cid10_lookup. Contains 'code' (the input code), 'found' (boolean), and 'hit' (nullable CID10HitSchema with level, display, title, chapter info, gender/restriction flags, etc.)
    export const CID10LookupOutputSchema = z.object({
      code: z.string(),
      found: z.boolean(),
      // Populated when found=true; null otherwise.
      hit: CID10HitSchema.nullable(),
    });
  • Registration of the cid10_lookup tool via toolRegistry.register(), binding the cid10LookupTool definition and handleCID10Lookup handler.
    toolRegistry.register(cid10SearchTool, handleCID10Search);
    toolRegistry.register(cid10LookupTool, handleCID10Lookup);
    toolRegistry.register(cid10ChaptersTool, handleCID10Chapters);
    toolRegistry.register(cid10ChapterTool, handleCID10Chapter);
  • CID10Client.lookup() method: the core data access logic. Normalizes the input code (removes dots), searches subcategories first (4-char) then categories (3-char), converts matches to CID10SearchHit format, or returns null if not found.
    lookup(input: string): CID10SearchHit | null {
      const normalized = normalizeCode(input);
    
      if (normalized.length === 4) {
        const sub = subcategories().find((s) => s.code === normalized);
        if (sub) return subcategoryToHit(sub);
        return null;
      }
    
      if (normalized.length === 3) {
        const cat = categories().find((c) => c.code === normalized);
        if (cat) return categoryToHit(cat);
        return null;
      }
    
      return null;
    }
Behavior3/5

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

Annotations already declare readOnlyHint=true, destructiveHint=false, idempotentHint=true, and openWorldHint=true, which cover safety and idempotency. The description adds that it accepts both dotted and undotted forms and returns canonical display, but this is minor additional context given the annotation richness.

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?

The description is very concise, using two short paragraphs. The first states the core purpose, and the second lists bullet-point-like use cases. No filler or redundancy.

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

Completeness5/5

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

Given the tool's simplicity (single parameter lookup) and the presence of an output schema, the description sufficiently covers usage. It addresses input format variations and use cases, making it complete for the agent's needs.

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?

The input schema has 100% coverage with a detailed pattern and description for the single 'code' parameter. The description reiterates the acceptance of dotted and undotted forms, but this does not add significant new meaning beyond the schema.

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 clearly states the tool's purpose: to look up a CID-10 code and return its Portuguese name. It also distinguishes from siblings like cid10_search and cid10_chapter by specifying code resolution rather than search or chapter retrieval.

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

Usage Guidelines4/5

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

The description explicitly lists three specific use cases: resolve a code, confirm existence, and retrieve restriction flags. While it does not explicitly state when not to use it, the sibling tool names provide context for alternatives.

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/SidneyBissoli/medical-terminologies-mcp'

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