Skip to main content
Glama
RowanErasmus

DailyMed MCP Server

by RowanErasmus

get_drug_media

Retrieve media files like images and documents for FDA-approved drugs using their unique SET ID from the DailyMed database.

Instructions

Get media links (images, documents) for a specific drug by its SET ID

Input Schema

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

Implementation Reference

  • Implementation of the `getSPLMedia` method in `SPLClient` which fetches media links for a drug from DailyMed.
    async getSPLMedia(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}/media.json`);
    
        if (
          response.data &&
          response.data.data &&
          Array.isArray(response.data.data)
        ) {
          return response.data.data.map((item: any) => ({
            url: item.url,
            type: item.type,
            name: item.name,
          }));
        } else {
          throw new Error("Unexpected response structure for SPL media");
        }
      } catch (error) {
        throw new Error(
          `Failed to fetch SPL media: ${error instanceof Error ? error.message : "Unknown error"}`,
        );
      }
    }
  • src/tools.ts:68-82 (registration)
    Tool definition for `get_drug_media` in `dailyMedTools`.
    {
      name: "get_drug_media",
      description:
        "Get media links (images, documents) for a specific drug by its SET ID",
      inputSchema: {
        type: "object",
        properties: {
          setId: {
            type: "string",
            description: "The SET ID of the drug to get media for",
          },
        },
        required: ["setId"],
      },
    },
  • Tool request handler for `get_drug_media` that invokes `this.client.getSPLMedia`.
    case "get_drug_media":
      const media = await this.client.getSPLMedia(args.setId as string);
      return {
        content: [
          {
            type: "text",
            text: JSON.stringify(media, null, 2),
          },
        ],
      };
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the tool retrieves media links but doesn't cover aspects like authentication needs, rate limits, error handling, or the format of returned links. This is a significant gap for a tool with no annotation coverage.

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 key information—action and resource—with no wasted words. It's appropriately sized for the tool's complexity and structured to convey the essential purpose immediately.

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. It doesn't explain what the media links look like, how they're returned, or any behavioral traits like side effects. For a tool with no structured data beyond the input schema, more context is needed to guide effective use.

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 value beyond the input schema, which has 100% coverage. It mentions the parameter 'SET ID' but doesn't provide additional context like format examples or constraints. Since schema coverage is high, the baseline score of 3 is appropriate, as the description doesn't compensate with extra semantic details.

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 media links') and resource ('for a specific drug by its SET ID'), specifying what types of media (images, documents) are retrieved. It distinguishes itself from siblings like 'get_drug_details' or 'get_download_links' by focusing on media links, though it doesn't explicitly contrast with them.

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?

No guidance is provided on when to use this tool versus alternatives. It doesn't mention prerequisites, such as needing a valid SET ID, or compare to similar tools like 'get_download_links' or 'get_drug_details', leaving the agent to infer usage context.

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