Skip to main content
Glama
lsaavedr

MCP Duty Pharma

by lsaavedr

MCP Duty Pharma

MCP Duty Pharma helps you locate pharmacies legally required to stay open during nights, weekends, and holidays. Whether it's an emergency or just a late-night need, this tool ensures you always know where to go.

📋 System Requirements

  • Python 3.10+

Related MCP server: Hong Kong Health Data MCP Server

📦 Dependencies

Install all required dependencies:

# Using uv
uv sync

Required Packages

  • fastmcp: Framework for building Model Context Protocol servers

  • geoPy: Python library for accessing and geocoding/reverse geocoding locations.

  • httpx: HTTP client for Python, which provides a simple and intuitive API for making HTTP requests.

All dependencies are specified in pyproject.toml.

📑 Table of Contents

🛠️ MCP Tools

This MCP server provides the following tools to Large Language Models (LLMs):

get_nearby_duty_pharmacies

  • Get ten closest pharmacies on duty today, sorted by distance to the given address.

📦 Installation

You can install this MCP server in either Claude Desktop or elsewhere. To use this server, add the following configuration to the settings file:

  • in json format

{
  "MCP Duty Pharma": {
    "command": "uv",
    "args": ["tool", "run", "mcp_duty_pharma"]
  }
}
  • in yaml format

mcpServers:
  - name: MCP Duty Pharma
    command: uv
    args:
      - tool
      - run
      - mcp_duty_pharma

🔒 Safety Features

  • Rate Limiting: Each geocoding call is rate-limited (e.g., 1-second delay) to avoid excessive requests that violate usage limits.

  • Error Handling: Catches geopy exceptions (timeouts, service errors) and returns safe [] results instead of crashing.

📚 Development Documentation

If you’d like to extend or modify this server:

  • Check duty-pharma.py for how each tool is implemented and how duty-pharma is integrated.

  • Look at geopy’s official docs for advanced usage like bounding boxes, language settings, or advanced data extraction.

  • Look at regional government APIs for more data sources.

Available Tools

1 tool
get_nearby_duty_pharmaciesB

Get ten closest pharmacies on duty today, sorted by distance to the given address.

ParametersJSON Schema
NameRequiredDescriptionDefault
addressYes

TDQS

B3.1/5.0
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. While it mentions the tool returns 'ten closest pharmacies' and sorts by distance, it fails to describe critical behaviors such as response format, error handling, data freshness, rate limits, or authentication requirements. For a location-based query tool with zero annotation coverage, this leaves significant gaps.

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, well-structured sentence that efficiently conveys the core functionality: action, resource, quantity, constraints, and sorting. Every word earns its place with no redundancy or fluff, making it easy to parse and front-loaded with essential information.

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 moderate complexity (location-based query with filtering), lack of annotations, and no output schema, the description is minimally complete. It covers the basic purpose and parameter intent but omits details on output structure, error cases, and operational constraints. It meets the bare minimum for understanding what the tool does but not how it behaves fully.

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 input schema has 0% description coverage, so the description must compensate. It adds meaning by explaining that the 'address' parameter is used to calculate distance and filter results, which goes beyond the schema's bare 'Address' title. However, it doesn't specify address format requirements, validation rules, or handling of ambiguous inputs, leaving some semantic gaps.

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 tool's purpose: 'Get ten closest pharmacies on duty today, sorted by distance to the given address.' It specifies the verb ('Get'), resource ('pharmacies'), and key constraints ('ten closest', 'on duty today', 'sorted by distance'). However, with no sibling tools mentioned, it cannot demonstrate differentiation from alternatives.

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 explicit guidance on when to use this tool versus alternatives. It implies usage for finding nearby duty pharmacies but offers no information about prerequisites, limitations, or scenarios where other tools might be more appropriate. With no siblings listed, this is a missed opportunity for basic context.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

  1. 1 tool updatev1.0.0
    • First observedget_nearby_duty_pharmacies

TDQS

B3.2/5.0

Scored across 1 tool

Disambiguation5/5

With only one tool, there is no possibility of ambiguity or overlap between tools. The tool's purpose is clearly defined and distinct by default.

Naming Consistency5/5

A single tool inherently has perfect naming consistency, as there are no other tools to compare against. The tool name follows a clear verb_noun pattern (get_nearby_duty_pharmacies).

Tool Count2/5

One tool is too few for a server with a domain like pharmacy duty information, as it lacks essential operations such as filtering by time, getting pharmacy details, or updating duty status. This severely limits agent functionality.

Completeness2/5

The tool surface is severely incomplete for the domain; it only provides a list of nearby duty pharmacies without supporting operations like checking specific pharmacy hours, verifying duty status, or managing pharmacy data, leading to significant gaps in agent workflows.

Maintenance

ActivityInactive
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers