Skip to main content
Glama

icd11_postcoordination

Read-onlyIdempotent

Retrieve available postcoordination axes for ICD-11 codes to build composite codes with severity, laterality, and anatomy modifiers.

Instructions

Get postcoordination information for an ICD-11 code.

Use this tool to:

  • Find available axes for building composite codes

  • Check required vs optional postcoordination

  • Understand code extension possibilities

Postcoordination allows adding severity, laterality, anatomy, etc.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
codeYesICD-11 code to get postcoordination info for

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
codeYes
axesYes

Implementation Reference

  • Handler function that executes the icd11_postcoordination tool logic: parses input, calls WHO API via getPostcoordination, maps response to structured output, and returns formatted text.
    async function handleICD11Postcoordination(args: Record<string, unknown>): Promise<CallToolResult> {
      try {
        const params = ICD11PostcoordinationParamsSchema.parse(args);
        const client = getWHOClient();
        const postcoord = await client.getPostcoordination(params.code);
        const scales = postcoord.postcoordinationScale ?? [];
    
        const structured: ICD11PostcoordinationOutput = {
          code: params.code,
          axes: scales.map((s) => ({
            axis_name: s.axisName,
            required: Boolean(s.requiredPostcoordination),
            allow_multiple: s.allowMultipleValues === 'true',
            value_count: s.scaleEntity ? s.scaleEntity.length : null,
          })),
        };
    
        const lines: string[] = [];
        lines.push(`# Postcoordination for ${params.code}`);
        lines.push('');
    
        if (scales.length === 0) {
          lines.push('This entity does not have postcoordination axes available.');
        } else {
          lines.push('**Available Postcoordination Axes:**');
          lines.push('');
          for (const scale of scales) {
            const required = scale.requiredPostcoordination ? '(Required)' : '(Optional)';
            const multiple =
              scale.allowMultipleValues === 'true' ? 'Multiple values allowed' : 'Single value only';
            lines.push(`### ${scale.axisName} ${required}`);
            lines.push(`- ${multiple}`);
            if (scale.scaleEntity && scale.scaleEntity.length > 0) {
              lines.push(`- ${scale.scaleEntity.length} possible values`);
            }
            lines.push('');
          }
        }
    
        return {
          content: [{ type: 'text', text: lines.join('\n') }],
          structuredContent: structured,
        };
      } catch (error) {
        if (error instanceof ApiError && error.code === 'NOT_FOUND') {
          return {
            content: [{ type: 'text', text: `No postcoordination info found for code: ${args.code}` }],
          };
        }
        return handleToolError(error);
      }
    }
  • Input schema for icd11_postcoordination: requires a 'code' string parameter.
    export const ICD11PostcoordinationParamsSchema = z.object({
      code: z.string().min(1).describe('ICD-11 code to get postcoordination info for'),
    });
  • Output schema for icd11_postcoordination: contains code and axes array (each with axis_name, required, allow_multiple, value_count).
    export const ICD11PostcoordinationOutputSchema = z.object({
      code: z.string(),
      axes: z.array(
        z.object({
          axis_name: z.string(),
          required: z.boolean(),
          allow_multiple: z.boolean(),
          value_count: z.number().int().nullable(),
        }),
      ),
    });
  • Registration of icd11_postcoordination tool with the toolRegistry.
    toolRegistry.register(icd11PostcoordinationTool, handleICD11Postcoordination);
  • WHO API client method getPostcoordination that fetches postcoordination axes from the WHO ICD-11 API endpoint.
    async getPostcoordination(code: string, language: string = 'en'): Promise<ICD11PostcoordinationResponse> {
      const cacheKey = `postcoord:${code}:${language}`;
    
      return cache.getOrSet(
        CACHE_PREFIX.ICD11,
        cacheKey,
        () => this.request<ICD11PostcoordinationResponse>(
          `/release/11/${WHO_CONFIG.releaseId}/${WHO_CONFIG.linearization}/codeinfo/${code}/postcoordination`,
          {},
          language
        ),
        DEFAULT_TTL.LOOKUP
      );
    }
Behavior4/5

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

Annotations already declare readOnlyHint=true and idempotentHint=true. Description adds valuable behavioral context about postcoordination details (severity, laterality, anatomy) beyond annotations, without contradiction.

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?

Very concise: one sentence + bullet points. Front-loaded with main purpose. No wasted words; every sentence adds value.

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?

Output schema exists (not shown), so description doesn't need to detail return values. Describes the concept of postcoordination sufficiently for an agent to understand when to use this tool. Could add more about expected output structure.

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?

Schema provides 100% coverage for the single parameter 'code' with description. Tool description adds no additional meaning beyond what the schema already states, so baseline 3 is appropriate.

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?

Description uses specific verb 'Get' with resource 'postcoordination information for an ICD-11 code', clearly distinguishing from sibling tools like icd11_lookup or icd11_search.

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?

Explicitly lists three use cases (find axes, check required vs optional, understand extensions), providing clear context. Does not mention when not to use or alternatives, but usage is well scoped.

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