search_webofscience
Search academic papers from Web of Science database to find relevant research publications using customizable filters for authors, journals, years, and sorting options.
Instructions
Search academic papers from Web of Science database
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | Search query string | |
| maxResults | No | Maximum number of results to return | |
| year | No | Publication year filter (e.g., "2023", "2020-2023") | |
| author | No | Author name filter | |
| journal | No | Journal name filter | |
| sortBy | No | Sort results by field | |
| sortOrder | No | Sort order: ascending or descending |
Implementation Reference
- src/mcp/handleToolCall.ts:104-126 (handler)Handler logic for 'search_webofscience' tool: extracts arguments, validates API key, calls WebOfScienceSearcher.search(), formats and returns JSON response with paper results.case 'search_webofscience': { const { query, maxResults, year, author, journal, sortBy, sortOrder } = args; if (!process.env.WOS_API_KEY) { throw new Error('Web of Science API key not configured. Please set WOS_API_KEY environment variable.'); } const results = await searchers.webofscience.search(query, { maxResults, year, author, journal, sortBy, sortOrder } as any); return jsonTextResponse( `Found ${results.length} Web of Science papers.\n\n${JSON.stringify( results.map((paper: Paper) => PaperFactory.toDict(paper)), null, 2 )}` ); }
- src/mcp/schemas.ts:55-67 (schema)Zod schema definition for validating input arguments to the 'search_webofscience' tool.export const SearchWebOfScienceSchema = z .object({ query: z.string().min(1), maxResults: z.number().int().min(1).max(50).optional().default(10), year: z.string().optional(), author: z.string().optional(), journal: z.string().optional(), sortBy: z .enum(['relevance', 'date', 'citations', 'title', 'author', 'journal']) .optional(), sortOrder: SortOrderSchema.optional() }) .strip();
- src/mcp/tools.ts:101-130 (registration)MCP tool registration: defines name, description, and input schema for 'search_webofscience' in the TOOLS array.{ name: 'search_webofscience', description: 'Search academic papers from Web of Science database', inputSchema: { type: 'object', properties: { query: { type: 'string', description: 'Search query string' }, maxResults: { type: 'number', minimum: 1, maximum: 50, description: 'Maximum number of results to return' }, year: { type: 'string', description: 'Publication year filter (e.g., "2023", "2020-2023")' }, author: { type: 'string', description: 'Author name filter' }, journal: { type: 'string', description: 'Journal name filter' }, sortBy: { type: 'string', enum: ['relevance', 'date', 'citations', 'title', 'author', 'journal'], description: 'Sort results by field' }, sortOrder: { type: 'string', enum: ['asc', 'desc'], description: 'Sort order: ascending or descending' } }, required: ['query'] } },
- src/mcp/searchers.ts:43-43 (helper)Instantiation of WebOfScienceSearcher used by the tool handler, assigned to searchers.webofscience.const wosSearcher = new WebOfScienceSearcher(process.env.WOS_API_KEY, process.env.WOS_API_VERSION);
- Core search implementation in WebOfScienceSearcher class: builds query, makes API request to Web of Science, parses response into Paper objects.async search(query: string, options: WoSSearchOptions = {}): Promise<Paper[]> { if (!this.apiKey) { throw new Error('Web of Science API key is required'); } try { const searchParams = this.buildSearchQuery(query, options); const response = await this.makeApiRequest('/documents', { method: 'GET', params: searchParams }); return this.parseSearchResponse(response.data); } catch (error) { this.handleHttpError(error, 'search'); } }