ema_info
Access European Medicines Agency drug approvals, safety reviews, orphan designations, supply shortages, and regulatory documents for pharmaceutical intelligence.
Instructions
Unified tool for EMA (European Medicines Agency) drug information lookup. Provides access to EU drug approvals, EPARs, orphan designations, supply shortages, and regulatory information through EMA's public JSON API.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| method | Yes | The operation to perform: search_medicines (search EU approved drugs), get_medicine_by_name (get specific medicine), get_orphan_designations (EU orphan drugs), get_supply_shortages (medicine shortages), get_referrals (EU safety reviews), get_post_auth_procedures (label updates), get_dhpcs (safety communications), get_psusas (periodic safety reports), get_pips (paediatric plans), get_herbal_medicines (herbal assessments), get_article58_medicines (non-EU use), search_epar_documents (EPAR docs), search_all_documents (all EMA docs), search_non_epar_documents (non-EPAR docs) | |
| active_substance | No | For search_medicines, get_supply_shortages: Active substance name (e.g., "semaglutide", "adalimumab") | |
| therapeutic_area | No | For search_medicines, get_orphan_designations: Therapeutic area or disease (e.g., "diabetes", "cancer", "multiple sclerosis") | |
| status | No | For search_medicines: Medicine status filter. For get_supply_shortages: "ongoing" or "resolved" | |
| orphan | No | For search_medicines: Filter for orphan medicines only | |
| prime | No | For search_medicines: Filter for PRIME (priority) medicines only | |
| biosimilar | No | For search_medicines: Filter for biosimilar medicines only | |
| conditional_approval | No | For search_medicines: Filter for conditionally approved medicines | |
| limit | No | Maximum number of results to return (default: 100 for medicines, 50 for other methods) | |
| name | No | For get_medicine_by_name: Medicine trade name to search (e.g., "Ozempic", "Wegovy", "Humira") | |
| year | No | For get_orphan_designations, get_referrals: Filter by year (e.g., 2024, 2023) | |
| safety | No | For get_referrals: Filter for safety-related referrals (true=Yes, false=No) | |
| medicine_name | No | For get_supply_shortages, get_post_auth_procedures: Medicine name to filter |
Implementation Reference
- src/index.js:129-330 (handler)Main handler for the 'ema_info' tool. Uses CallToolRequestSchema to handle tool calls, validates the tool name, extracts the method parameter, and dispatches to the appropriate helper function via a switch statement. Returns JSON-formatted results or error responses.
server.setRequestHandler(CallToolRequestSchema, async (request) => { const { name, arguments: args } = request.params; if (name !== 'ema_info') { throw new Error(`Unknown tool: ${name}`); } try { const { method, ...params } = args; switch (method) { case 'search_medicines': { const results = await searchMedicines(params); return { content: [ { type: 'text', text: JSON.stringify(results, null, 2) } ] }; } case 'get_medicine_by_name': { const { name } = params; if (!name) { throw new Error('name parameter is required for get_medicine_by_name'); } const results = await getMedicineByName(name); return { content: [ { type: 'text', text: JSON.stringify(results, null, 2) } ] }; } case 'get_orphan_designations': { const results = await getOrphanDesignations(params); return { content: [ { type: 'text', text: JSON.stringify(results, null, 2) } ] }; } case 'get_supply_shortages': { const results = await getSupplyShortages(params); return { content: [ { type: 'text', text: JSON.stringify(results, null, 2) } ] }; } case 'get_referrals': { const results = await getReferrals(params); return { content: [ { type: 'text', text: JSON.stringify(results, null, 2) } ] }; } case 'get_post_auth_procedures': { const results = await getPostAuthProcedures(params); return { content: [ { type: 'text', text: JSON.stringify(results, null, 2) } ] }; } case 'get_dhpcs': { const results = await getDhpcs(params); return { content: [ { type: 'text', text: JSON.stringify(results, null, 2) } ] }; } case 'get_psusas': { const results = await getPsusas(params); return { content: [ { type: 'text', text: JSON.stringify(results, null, 2) } ] }; } case 'get_pips': { const results = await getPips(params); return { content: [ { type: 'text', text: JSON.stringify(results, null, 2) } ] }; } case 'get_herbal_medicines': { const results = await getHerbalMedicines(params); return { content: [ { type: 'text', text: JSON.stringify(results, null, 2) } ] }; } case 'get_article58_medicines': { const results = await getArticle58Medicines(params); return { content: [ { type: 'text', text: JSON.stringify(results, null, 2) } ] }; } case 'search_epar_documents': { const results = await searchEparDocuments(params); return { content: [ { type: 'text', text: JSON.stringify(results, null, 2) } ] }; } case 'search_all_documents': { const results = await searchAllDocuments(params); return { content: [ { type: 'text', text: JSON.stringify(results, null, 2) } ] }; } case 'search_non_epar_documents': { const results = await searchNonEparDocuments(params); return { content: [ { type: 'text', text: JSON.stringify(results, null, 2) } ] }; } default: throw new Error(`Unknown method: ${method}`); } } catch (error) { return { content: [ { type: 'text', text: JSON.stringify({ error: error.message, source: 'EMA MCP Server' }, null, 2) } ], isError: true }; } }); - src/index.js:45-122 (schema)Input schema definition for the 'ema_info' tool. Defines the 'method' parameter as required with 15 possible enum values (search_medicines, get_medicine_by_name, etc.), plus numerous optional filter parameters like active_substance, therapeutic_area, status, limit, etc.
inputSchema: { type: 'object', properties: { method: { type: 'string', enum: ['search_medicines', 'get_medicine_by_name', 'get_orphan_designations', 'get_supply_shortages', 'get_referrals', 'get_post_auth_procedures', 'get_dhpcs', 'get_psusas', 'get_pips', 'get_herbal_medicines', 'get_article58_medicines', 'search_epar_documents', 'search_all_documents', 'search_non_epar_documents'], description: 'The operation to perform: search_medicines (search EU approved drugs), get_medicine_by_name (get specific medicine), get_orphan_designations (EU orphan drugs), get_supply_shortages (medicine shortages), get_referrals (EU safety reviews), get_post_auth_procedures (label updates), get_dhpcs (safety communications), get_psusas (periodic safety reports), get_pips (paediatric plans), get_herbal_medicines (herbal assessments), get_article58_medicines (non-EU use), search_epar_documents (EPAR docs), search_all_documents (all EMA docs), search_non_epar_documents (non-EPAR docs)', examples: ['search_medicines', 'get_dhpcs', 'search_epar_documents'] }, // Parameters for search_medicines active_substance: { type: 'string', description: 'For search_medicines, get_supply_shortages: Active substance name (e.g., "semaglutide", "adalimumab")', examples: ['semaglutide', 'adalimumab', 'pembrolizumab'] }, therapeutic_area: { type: 'string', description: 'For search_medicines, get_orphan_designations: Therapeutic area or disease (e.g., "diabetes", "cancer", "multiple sclerosis")', examples: ['diabetes', 'cancer', 'multiple sclerosis', 'obesity'] }, status: { type: 'string', description: 'For search_medicines: Medicine status filter. For get_supply_shortages: "ongoing" or "resolved"', examples: ['Authorised', 'Withdrawn', 'Refused', 'ongoing', 'resolved'] }, orphan: { type: 'boolean', description: 'For search_medicines: Filter for orphan medicines only', examples: [true, false] }, prime: { type: 'boolean', description: 'For search_medicines: Filter for PRIME (priority) medicines only', examples: [true, false] }, biosimilar: { type: 'boolean', description: 'For search_medicines: Filter for biosimilar medicines only', examples: [true, false] }, conditional_approval: { type: 'boolean', description: 'For search_medicines: Filter for conditionally approved medicines', examples: [true, false] }, limit: { type: 'integer', description: 'Maximum number of results to return (default: 100 for medicines, 50 for other methods)', examples: [10, 50, 100] }, // Parameter for get_medicine_by_name name: { type: 'string', description: 'For get_medicine_by_name: Medicine trade name to search (e.g., "Ozempic", "Wegovy", "Humira")', examples: ['Ozempic', 'Wegovy', 'Humira', 'Keytruda'] }, // Parameters for get_orphan_designations year: { type: 'integer', description: 'For get_orphan_designations, get_referrals: Filter by year (e.g., 2024, 2023)', examples: [2024, 2023, 2022] }, // Parameters for get_referrals safety: { type: 'boolean', description: 'For get_referrals: Filter for safety-related referrals (true=Yes, false=No)', examples: [true, false] }, // Parameters for get_supply_shortages and get_post_auth_procedures medicine_name: { type: 'string', description: 'For get_supply_shortages, get_post_auth_procedures: Medicine name to filter', examples: ['Ozempic', 'Keytruda', 'Insulin lispro'] } }, required: ['method'], additionalProperties: false } - src/index.js:39-126 (registration)Tool registration using ListToolsRequestSchema. Registers 'ema_info' as a unified tool for EMA (European Medicines Agency) drug information lookup with comprehensive description of capabilities.
server.setRequestHandler(ListToolsRequestSchema, async () => { return { tools: [ { name: 'ema_info', description: 'Unified tool for EMA (European Medicines Agency) drug information lookup. Provides access to EU drug approvals, EPARs, orphan designations, supply shortages, and regulatory information through EMA\'s public JSON API.', inputSchema: { type: 'object', properties: { method: { type: 'string', enum: ['search_medicines', 'get_medicine_by_name', 'get_orphan_designations', 'get_supply_shortages', 'get_referrals', 'get_post_auth_procedures', 'get_dhpcs', 'get_psusas', 'get_pips', 'get_herbal_medicines', 'get_article58_medicines', 'search_epar_documents', 'search_all_documents', 'search_non_epar_documents'], description: 'The operation to perform: search_medicines (search EU approved drugs), get_medicine_by_name (get specific medicine), get_orphan_designations (EU orphan drugs), get_supply_shortages (medicine shortages), get_referrals (EU safety reviews), get_post_auth_procedures (label updates), get_dhpcs (safety communications), get_psusas (periodic safety reports), get_pips (paediatric plans), get_herbal_medicines (herbal assessments), get_article58_medicines (non-EU use), search_epar_documents (EPAR docs), search_all_documents (all EMA docs), search_non_epar_documents (non-EPAR docs)', examples: ['search_medicines', 'get_dhpcs', 'search_epar_documents'] }, // Parameters for search_medicines active_substance: { type: 'string', description: 'For search_medicines, get_supply_shortages: Active substance name (e.g., "semaglutide", "adalimumab")', examples: ['semaglutide', 'adalimumab', 'pembrolizumab'] }, therapeutic_area: { type: 'string', description: 'For search_medicines, get_orphan_designations: Therapeutic area or disease (e.g., "diabetes", "cancer", "multiple sclerosis")', examples: ['diabetes', 'cancer', 'multiple sclerosis', 'obesity'] }, status: { type: 'string', description: 'For search_medicines: Medicine status filter. For get_supply_shortages: "ongoing" or "resolved"', examples: ['Authorised', 'Withdrawn', 'Refused', 'ongoing', 'resolved'] }, orphan: { type: 'boolean', description: 'For search_medicines: Filter for orphan medicines only', examples: [true, false] }, prime: { type: 'boolean', description: 'For search_medicines: Filter for PRIME (priority) medicines only', examples: [true, false] }, biosimilar: { type: 'boolean', description: 'For search_medicines: Filter for biosimilar medicines only', examples: [true, false] }, conditional_approval: { type: 'boolean', description: 'For search_medicines: Filter for conditionally approved medicines', examples: [true, false] }, limit: { type: 'integer', description: 'Maximum number of results to return (default: 100 for medicines, 50 for other methods)', examples: [10, 50, 100] }, // Parameter for get_medicine_by_name name: { type: 'string', description: 'For get_medicine_by_name: Medicine trade name to search (e.g., "Ozempic", "Wegovy", "Humira")', examples: ['Ozempic', 'Wegovy', 'Humira', 'Keytruda'] }, // Parameters for get_orphan_designations year: { type: 'integer', description: 'For get_orphan_designations, get_referrals: Filter by year (e.g., 2024, 2023)', examples: [2024, 2023, 2022] }, // Parameters for get_referrals safety: { type: 'boolean', description: 'For get_referrals: Filter for safety-related referrals (true=Yes, false=No)', examples: [true, false] }, // Parameters for get_supply_shortages and get_post_auth_procedures medicine_name: { type: 'string', description: 'For get_supply_shortages, get_post_auth_procedures: Medicine name to filter', examples: ['Ozempic', 'Keytruda', 'Insulin lispro'] } }, required: ['method'], additionalProperties: false } } ] }; }); - src/ema-api.js:125-190 (helper)Example helper function (searchMedicines) that implements the core logic for searching medicines in the EMA database. Makes HTTP requests to EMA's JSON API, applies filters, and returns structured results.
async function searchMedicines(params = {}) { // Validate input parameters if (params.limit && (typeof params.limit !== 'number' || params.limit < 1 || params.limit > 10000)) { throw new Error('limit must be a number between 1 and 10000'); } if (params.status && !['Authorised', 'Withdrawn', 'Refused', 'Suspended'].includes(params.status)) { throw new Error('status must be one of: Authorised, Withdrawn, Refused, Suspended'); } const url = generateEmaUrl('medicines-output-medicines_json-report_en.json'); const allMedicines = await makeEmaRequest(url); let results = allMedicines; // Filter by active substance if (params.active_substance) { const searchTerm = params.active_substance.toLowerCase(); results = results.filter(m => m.active_substance && m.active_substance.toLowerCase().includes(searchTerm) ); } // Filter by therapeutic area if (params.therapeutic_area) { const searchTerm = params.therapeutic_area.toLowerCase(); results = results.filter(m => (m.therapeutic_area_mesh && m.therapeutic_area_mesh.toLowerCase().includes(searchTerm)) || (m.therapeutic_indication && m.therapeutic_indication.toLowerCase().includes(searchTerm)) ); } // Filter by medicine status if (params.status) { results = results.filter(m => m.medicine_status === params.status); } // Filter by regulatory flags if (params.orphan === true) { results = results.filter(m => m.orphan_medicine === 'Yes'); } if (params.prime === true) { results = results.filter(m => m.prime_priority_medicine === 'Yes'); } if (params.biosimilar === true) { results = results.filter(m => m.biosimilar === 'Yes'); } if (params.conditional_approval === true) { results = results.filter(m => m.conditional_approval === 'Yes'); } // Apply limit const limit = params.limit || 100; results = results.slice(0, limit); return { total_count: results.length, results: results, source: 'EMA Medicines Database', source_url: url, last_updated: new Date().toISOString() }; }