Skip to main content
Glama
RowanErasmus

DailyMed MCP Server

by RowanErasmus

get_drug_history

Retrieve version history for FDA-approved drugs using their SET ID to track label changes, updates, and regulatory modifications over time.

Instructions

Get version history for a specific drug by its SET ID

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
setIdYesThe SET ID of the drug to get history for

Implementation Reference

  • The getSPLHistory method in the SPLClient class fetches the version history of a drug from the DailyMed API using its SET ID.
    async getSPLHistory(setId: string): Promise<any[]> {
      if (!setId || typeof setId !== "string") {
        throw new Error("Valid SET ID is required");
      }
    
      try {
        const response = await this.client.get(`/spls/${setId}/history.json`);
    
        if (
          response.data &&
          response.data.data &&
          Array.isArray(response.data.data)
        ) {
          return response.data.data.map((item: any) => ({
            setId: item.setid,
            splVersion: item.spl_version,
            effectiveTime: item.effective_time,
            title: item.title,
          }));
        } else {
          throw new Error("Unexpected response structure for SPL history");
        }
      } catch (error) {
        throw new Error(
          `Failed to fetch SPL history: ${error instanceof Error ? error.message : "Unknown error"}`,
        );
      }
    }
  • src/index.ts:74-85 (registration)
    Registration of the get_drug_history tool handler in the main server switch block, which calls the SPLClient's getSPLHistory method.
    case "get_drug_history":
      const history = await this.client.getSPLHistory(
        args.setId as string,
      );
      return {
        content: [
          {
            type: "text",
            text: JSON.stringify(history, null, 2),
          },
        ],
      };
  • The schema definition for the get_drug_history tool in the dailyMedTools configuration array.
      name: "get_drug_history",
      description: "Get version history for a specific drug by its SET ID",
      inputSchema: {
        type: "object",
        properties: {
          setId: {
            type: "string",
            description: "The SET ID of the drug to get history for",
          },
        },
        required: ["setId"],
      },
    },
Behavior2/5

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

No annotations are provided, so the description carries full burden for behavioral disclosure. It states the tool retrieves 'version history' but doesn't clarify what that entails—whether it returns metadata, change logs, timestamps, or structured data. It also omits information about permissions, rate limits, or response format, leaving the agent with insufficient context for safe invocation.

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 without unnecessary words. Every part of the sentence contributes directly to understanding the tool's function, making it optimally concise and well-structured.

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

Completeness2/5

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

Given the lack of annotations and output schema, the description is incomplete for a tool that presumably returns historical data. It doesn't explain what 'version history' includes, how results are structured, or any limitations (e.g., pagination, availability). For a tool with no structured output documentation, this leaves critical gaps in understanding.

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 description adds minimal semantic value beyond the input schema, which already has 100% coverage with a clear parameter description for 'setId'. The description reinforces that 'setId' identifies 'a specific drug' but doesn't provide additional context like format examples or validation rules. This meets the baseline for high schema coverage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Get version history') and target resource ('for a specific drug by its SET ID'), making the purpose immediately understandable. However, it doesn't explicitly differentiate this tool from sibling tools like 'get_drug_details' or 'search_spls' that might also provide historical information, preventing a perfect score.

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. With many sibling tools available (e.g., 'get_drug_details', 'search_spls'), there's no indication of whether this is the primary method for accessing drug history or if other tools might serve overlapping purposes. The lack of usage context is a significant gap.

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