search_arxiv
Search academic papers and preprints on arXiv to find research papers, scientific studies, and technical literature across fields like AI, physics, and mathematics.
Instructions
Search academic papers and preprints on arXiv repository. Perfect for finding research papers, scientific studies, technical papers, and academic literature. Use this when researching scientific topics, looking for papers by specific authors, or finding the latest research in fields like AI, physics, mathematics, computer science, etc.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | Academic search terms, author names, or research topics (e.g., 'transformer neural networks', 'Einstein relativity', 'machine learning optimization'). Can be a single query string or an array of queries for parallel search. | |
| num | No | Maximum number of academic papers to return, between 1-100 | |
| tbs | No | Time-based search parameter, e.g., 'qdr:h' for past hour, can be qdr:h, qdr:d, qdr:w, qdr:m, qdr:y |
Implementation Reference
- src/tools/jina-tools.ts:298-315 (handler)Handler function that orchestrates the search_arxiv tool: checks bearer token, calls executeArxivSearch helper, formats results using formatSingleSearchResultToContentItems, and handles errors.async ({ query, num, tbs }: SearchArxivArgs) => { try { const props = getProps(); const tokenError = checkBearerToken(props.bearerToken); if (tokenError) { return tokenError; } const searchResult = await executeArxivSearch({ query, num, tbs }, props.bearerToken); return { content: formatSingleSearchResultToContentItems(searchResult), }; } catch (error) { return createErrorResponse(`Error: ${error instanceof Error ? error.message : String(error)}`); } },
- src/tools/jina-tools.ts:290-316 (registration)Registers the search_arxiv tool with McpServer, including description, Zod input schema, and inline handler function.server.tool( "search_arxiv", "Search academic papers and preprints on arXiv repository. Perfect for finding research papers, scientific studies, technical papers, and academic literature. Use this when researching scientific topics, looking for papers by specific authors, or finding the latest research in fields like AI, physics, mathematics, computer science, etc. 💡 Tip: Use `parallel_search_arxiv` if you need to run multiple arXiv searches simultaneously.", { query: z.string().describe("Academic search terms, author names, or research topics (e.g., 'transformer neural networks', 'Einstein relativity', 'machine learning optimization')"), num: z.number().default(30).describe("Maximum number of academic papers to return, between 1-100"), tbs: z.string().optional().describe("Time-based search parameter, e.g., 'qdr:h' for past hour, can be qdr:h, qdr:d, qdr:w, qdr:m, qdr:y") }, async ({ query, num, tbs }: SearchArxivArgs) => { try { const props = getProps(); const tokenError = checkBearerToken(props.bearerToken); if (tokenError) { return tokenError; } const searchResult = await executeArxivSearch({ query, num, tbs }, props.bearerToken); return { content: formatSingleSearchResultToContentItems(searchResult), }; } catch (error) { return createErrorResponse(`Error: ${error instanceof Error ? error.message : String(error)}`); } }, );
- src/utils/search.ts:91-120 (helper)Core helper function that makes the HTTP request to Jina's search API (svip.jina.ai) specifically for arXiv domain, handling response and errors.export async function executeArxivSearch( searchArgs: SearchArxivArgs, bearerToken: string ): Promise<SearchResultOrError> { try { const response = await fetch('https://svip.jina.ai/', { method: 'POST', headers: { 'Accept': 'application/json', 'Content-Type': 'application/json', 'Authorization': `Bearer ${bearerToken}`, }, body: JSON.stringify({ q: searchArgs.query, domain: 'arxiv', num: searchArgs.num || 30, ...(searchArgs.tbs && { tbs: searchArgs.tbs }) }), }); if (!response.ok) { return { error: `arXiv search failed for query "${searchArgs.query}": ${response.statusText}` }; } const data = await response.json() as any; return { query: searchArgs.query, results: data.results || [] }; } catch (error) { return { error: `arXiv search failed for query "${searchArgs.query}": ${error instanceof Error ? error.message : String(error)}` }; } }
- src/utils/search.ts:16-20 (schema)TypeScript interface defining the input arguments for search_arxiv tool.export interface SearchArxivArgs { query: string; num?: number; tbs?: string; }
- src/index.ts:20-22 (registration)Top-level initialization that calls registerJinaTools to register all tools, including search_arxiv.// Register all Jina AI tools registerJinaTools(this.server, () => this.props); }