Skip to main content
Glama
RowanErasmus

DailyMed MCP Server

by RowanErasmus

get_all_ndcs

Retrieve all NDC codes from the FDA DailyMed database with paginated results for comprehensive drug identification and reference.

Instructions

Get all available NDC codes in the DailyMed database with pagination support

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pageNoPage number for pagination (1-based, default: 1)
pageSizeNoNumber of results per page (default: 25, max: 100)

Implementation Reference

  • The core handler function that performs the API request to fetch all NDCs.
    async getAllNDCs(page: number = 1, pageSize: number = 25): Promise<PaginatedNDCResponse> {
      validatePaginationParams(page, pageSize, 100);
    
      try {
        const response = await this.client.get("/ndcs.json", {
          params: {
            page,
            pagesize: Math.min(pageSize, 100), // API max is 100
  • src/tools.ts:123-135 (registration)
    Registration of the 'get_all_ndcs' tool definition.
    {
      name: "get_all_ndcs",
      description: "Get all available NDC codes in the DailyMed database with pagination support",
      inputSchema: {
        type: "object",
        properties: {
          page: {
            type: "number",
            description: "Page number for pagination (1-based, default: 1)",
            minimum: 1,
          },
          pageSize: {
            type: "number",
  • Tool execution logic in the MCP server request handler.
    case "get_all_ndcs":
      const allNDCs = await this.client.getAllNDCs(
        args.page as number,
        args.pageSize as number,
      );
      return {
        content: [
          {
            type: "text",
  • Wrapper method in the DailyMed client delegating the call to the NDC client.
    async getAllNDCs(page?: number, pageSize?: number) {
      return this.ndcClient.getAllNDCs(page, pageSize);
    }
Behavior3/5

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

With no annotations provided, the description carries the full burden. It discloses pagination behavior ('with pagination support'), which is valuable beyond the input schema. However, it lacks details on rate limits, authentication needs, error conditions, or what the output looks like (e.g., format, total count). It adds some context but is incomplete for a list operation.

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 a single, efficient sentence that front-loads the core purpose and includes key behavioral detail (pagination). Every word earns its place, with no redundancy or fluff. It's appropriately sized for a simple list tool.

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

Completeness3/5

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

Given the tool's low complexity (list operation with 2 optional params) and 100% schema coverage, the description is adequate but has gaps. No output schema exists, so the description should ideally hint at return format (e.g., list of NDC strings). It covers pagination but misses other contextual details like ordering or total result availability, making it minimally viable.

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 description coverage is 100%, so the schema fully documents both parameters (page, pageSize). The description adds no parameter-specific semantics beyond implying pagination exists. Baseline 3 is appropriate when the schema does the heavy lifting, though the description doesn't compensate for any gaps (none exist).

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 specific action ('Get all available NDC codes'), identifies the resource ('DailyMed database'), and distinguishes from siblings by specifying 'all available NDC codes' rather than drug-specific NDCs (like get_drug_ndcs) or other list types. It's precise and avoids tautology.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention when to prefer this over search tools (e.g., search_drugs_by_pharmacologic_class) or other 'get_all_' siblings, nor does it specify prerequisites or exclusions. Usage is implied but not explicit.

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/RowanErasmus/dailymed-mcp-server'

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