disease_surveillance
Retrieve case counts and trends for diseases using CDC surveillance data, filtered by condition, ICD-10 code, or state.
Instructions
Look up disease surveillance data including case counts and trends by condition and geography. Source: CDC National Notifiable Diseases Surveillance System (public domain).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| condition | No | Disease or condition name (e.g., "Hepatitis A", "Salmonellosis") | |
| code | No | ICD-10 code (auto-mapped to condition name) | |
| state | No | 2-letter state code to filter by geography |
Implementation Reference
- src/tools.js:195-253 (registration)Tool registration definition with name, description, schema (Zod), price, and endpoint URL.
// --- Disease Surveillance (CDC NNDSS — free, no license) --- { name: 'disease_surveillance', description: 'Look up disease surveillance data including case counts and trends by condition and geography. Source: CDC National Notifiable Diseases Surveillance System (public domain).', price: '$0.02', endpoint: '/agent/v1/surveillance/disease', schema: { condition: z.string().optional().describe('Disease or condition name (e.g., "Hepatitis A", "Salmonellosis")'), code: z.string().optional().describe('ICD-10 code (auto-mapped to condition name)'), state: z.string().optional().describe('2-letter state code to filter by geography'), }, }, // --- Data Enrichment --- { name: 'provider_search', description: 'Search the NPI provider directory. Find healthcare providers by name, specialty, or location.', price: '$0.005', endpoint: '/agent/v1/providers/search', schema: { firstName: z.string().optional(), lastName: z.string().optional(), organizationName: z.string().optional(), taxonomy: z.string().optional().describe('Provider taxonomy/specialty code'), city: z.string().optional(), state: z.string().optional().describe('2-letter state code'), limit: z.number().optional().describe('Max results (default 10, max 50)'), }, }, { name: 'provider_enrich', description: 'AI-enriched provider intelligence from NPI number. Returns practice details, specialties, affiliations, and market context.', price: '$0.05', endpoint: '/agent/v1/providers/enrich', schema: { npi: z.string().describe('10-digit NPI number'), }, }, { name: 'drug_enrich', description: 'Drug information enrichment via OpenFDA. Returns drug details, indications, interactions, and AI analysis.', price: '$0.03', endpoint: '/agent/v1/drugs/enrich', schema: { drugName: z.string().describe('Drug name (brand or generic, min 2 chars)'), searchField: z.enum(['brand_name', 'generic_name']).optional().describe('Search by brand or generic name'), }, }, { name: 'market_analysis', description: 'Healthcare specialty market analysis for a specific state. Returns provider density, competition metrics, and market opportunity data.', price: '$0.10', endpoint: '/agent/v1/market/analysis', schema: { state: z.string().describe('2-letter state code (e.g., "TX", "CA")'), specialty: z.string().describe('Medical specialty (e.g., "cardiology", "orthopedics")'), }, }, ]; - src/index.js:19-63 (handler)Generic handler that registers all tools via iteration, calling the tool's endpoint via fetch and returning the response.
for (const tool of MCP_TOOLS) { s.tool(tool.name, tool.description, tool.schema, async (params) => { const toolDef = getToolByName(tool.name); if (!toolDef) { return { content: [{ type: 'text', text: `Unknown tool: ${tool.name}` }], isError: true }; } try { const response = await fetch(`${API_BASE_URL}${toolDef.endpoint}`, { method: 'POST', headers: { 'Content-Type': 'application/json', ...(API_KEY && { 'X-API-Key': API_KEY }), 'X-Agent-ID': 'mcp-client', 'User-Agent': '@mymedi-ai/mcp-server/1.2.1', }, body: JSON.stringify(params), }); if (response.status === 402) { const paymentInfo = await response.json(); return { content: [{ type: 'text', text: JSON.stringify({ error: 'payment_required', message: `This tool costs ${toolDef.price} per call. Register at ${API_BASE_URL}/bot-marketplace/register for an API key with 10 free starter credits, or pay per call with on-chain USDC (no signup) via the x402 protocol.`, price: toolDef.price, register: `${API_BASE_URL}/bot-marketplace/register`, ...paymentInfo, }, null, 2) }], isError: true, }; } if (!response.ok) { const error = await response.json().catch(() => ({ message: response.statusText })); return { content: [{ type: 'text', text: JSON.stringify({ error: true, status: response.status, ...error }, null, 2) }], isError: true }; } const data = await response.json(); const creditsSpent = response.headers.get('X-Credits-Spent'); const creditsRemaining = response.headers.get('X-Credits-Remaining'); if (creditsSpent) { data._billing = { creditsSpent: parseInt(creditsSpent, 10), creditsRemaining: creditsRemaining ? parseInt(creditsRemaining, 10) : undefined, priceUSD: toolDef.price }; } return { content: [{ type: 'text', text: JSON.stringify(data, null, 2) }] }; } catch (err) { return { content: [{ type: 'text', text: JSON.stringify({ error: true, message: err.message, hint: 'Ensure MCP_API_BASE_URL and MCP_API_KEY environment variables are set.' }, null, 2) }], isError: true }; } }); } return s; } - src/tools.js:201-206 (schema)Zod input schema for disease_surveillance: condition (string), code (string), state (string).
schema: { condition: z.string().optional().describe('Disease or condition name (e.g., "Hepatitis A", "Salmonellosis")'), code: z.string().optional().describe('ICD-10 code (auto-mapped to condition name)'), state: z.string().optional().describe('2-letter state code to filter by geography'), }, }, - src/tools.js:255-257 (helper)Helper function to look up a tool definition by name, used by the generic handler.
export function getToolByName(name) { return MCP_TOOLS.find((t) => t.name === name); }