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);
    }

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