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
| Name | Required | Description | Default |
|---|---|---|---|
| page | No | Page number for pagination (1-based, default: 1) | |
| pageSize | No | Number of results per page (default: 25, max: 100) |
Implementation Reference
- src/clients/ndc-client.ts:18-25 (handler)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", - src/index.ts:150-158 (handler)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); }