Skip to main content
Glama
flyanima

Open Search MCP

by flyanima

search_medrxiv

Search medical preprints and clinical research on medRxiv by entering a query to find relevant studies, with options to limit results for focused research.

Instructions

Search medRxiv for medical preprints and clinical research

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
maxResultsNoMaximum number of results to return
queryYesSearch query for medical preprints

Implementation Reference

  • The core handler function that executes the 'search_medrxiv' tool. It processes the input query and maxResults, generates simulated medRxiv medical preprint search results, and returns structured output with success status, data, and metadata.
    execute: async (args: ToolInput): Promise<ToolOutput> => { try { const { query, maxResults = 20 } = args; // Simulated medRxiv search results const results = Array.from({ length: Math.min(maxResults, 10) }, (_, i) => ({ title: `Clinical Study on ${query} - Research ${i + 1}`, authors: [`Dr. Medical Researcher ${i + 1}`, `Prof. Clinical Expert ${i + 1}`], abstract: `This clinical study investigates ${query} and its implications for patient care...`, date: new Date(2024, 0, i + 1).toISOString().split('T')[0], doi: `10.1101/2024.01.${String(i + 1).padStart(2, '0')}.24300001`, url: `https://www.medrxiv.org/content/10.1101/2024.01.${String(i + 1).padStart(2, '0')}.24300001v1`, category: 'Medical Research', keywords: [query, 'clinical', 'medical', 'preprint'] })); return { success: true, data: { source: 'medRxiv', query, results, totalResults: results.length }, metadata: { searchTime: Date.now(), source: 'medRxiv Preprint Server' } }; } catch (error) { return { success: false, error: `medRxiv search failed: ${error instanceof Error ? error.message : String(error)}`, data: null }; } }
  • The tool registration block where 'search_medrxiv' is registered to the ToolRegistry, including name, description, category, source, inputSchema, and execute handler.
    registry.registerTool({ name: 'search_medrxiv', description: 'Search medRxiv for medical preprints and clinical research', category: 'academic', source: 'medRxiv', inputSchema: { type: 'object', properties: { query: { type: 'string', description: 'Search query for medical preprints' }, maxResults: { type: 'number', description: 'Maximum number of results to return', default: 20, minimum: 1, maximum: 100 } }, required: ['query'] }, execute: async (args: ToolInput): Promise<ToolOutput> => { try { const { query, maxResults = 20 } = args; // Simulated medRxiv search results const results = Array.from({ length: Math.min(maxResults, 10) }, (_, i) => ({ title: `Clinical Study on ${query} - Research ${i + 1}`, authors: [`Dr. Medical Researcher ${i + 1}`, `Prof. Clinical Expert ${i + 1}`], abstract: `This clinical study investigates ${query} and its implications for patient care...`, date: new Date(2024, 0, i + 1).toISOString().split('T')[0], doi: `10.1101/2024.01.${String(i + 1).padStart(2, '0')}.24300001`, url: `https://www.medrxiv.org/content/10.1101/2024.01.${String(i + 1).padStart(2, '0')}.24300001v1`, category: 'Medical Research', keywords: [query, 'clinical', 'medical', 'preprint'] })); return { success: true, data: { source: 'medRxiv', query, results, totalResults: results.length }, metadata: { searchTime: Date.now(), source: 'medRxiv Preprint Server' } }; } catch (error) { return { success: false, error: `medRxiv search failed: ${error instanceof Error ? error.message : String(error)}`, data: null }; } } });
  • src/index.ts:233-233 (registration)
    Top-level call in the main server initialization that invokes registerBioRxivTools, thereby registering the 'search_medrxiv' tool along with related bioRxiv tools.
    registerBioRxivTools(this.toolRegistry); // 3 tools: search_iacr, search_medrxiv, search_biorxiv
  • Validation schema mapping for 'search_medrxiv' tool, referencing the shared academicSearch Zod schema for input validation.
    'search_medrxiv': ToolSchemas.academicSearch,
  • The shared 'academicSearch' Zod schema used for validating inputs to 'search_medrxiv' and other academic search tools.
    academicSearch: z.object({ query: CommonSchemas.searchQuery, limit: CommonSchemas.resultsLimit.optional().default(10), category: CommonSchemas.category.optional(), dateFrom: CommonSchemas.dateString.optional(), dateTo: CommonSchemas.dateString.optional(), }),

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/flyanima/open-search-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server