search_arxiv
Find academic papers and preprints on arXiv with targeted searches. Use for researching scientific topics, locating papers by authors, or discovering research in AI, physics, mathematics, and computer science. Specify search terms, results count, and time filters for precise results.
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. 💡 Tip: Use parallel_search_arxiv if you need to run multiple arXiv searches simultaneously.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| num | No | Maximum number of academic papers to return, between 1-100 | |
| query | Yes | Academic search terms, author names, or research topics (e.g., 'transformer neural networks', 'Einstein relativity', 'machine learning optimization') | |
| 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 |
Input Schema (JSON Schema)
Implementation Reference
- src/tools/jina-tools.ts:290-316 (registration)Full registration of the 'search_arxiv' tool using server.tool(), including description, Zod input schema, and the handler function that performs token check, calls executeArxivSearch helper, formats output, and handles errors.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/tools/jina-tools.ts:298-316 (handler)The core handler function for the search_arxiv tool. It retrieves props, checks bearer token, executes the arXiv search via helper, formats the single search result into content items, and handles errors with createErrorResponse.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:293-297 (schema)Zod schema for search_arxiv input parameters: query (required string), num (optional number default 30), tbs (optional string for time-based search).{ 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") },
- src/utils/search.ts:16-20 (schema)TypeScript interface SearchArxivArgs defining the input shape used by the handler and Zod schema.export interface SearchArxivArgs { query: string; num?: number; tbs?: string; }
- src/utils/search.ts:91-120 (helper)Core helper function executeArxivSearch that makes the API call to 'https://svip.jina.ai/' with domain: 'arxiv', handles response and errors, returns search results or error.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)}` }; } }