Skip to main content
Glama
wlmwwx

Jina AI Remote MCP Server

by wlmwwx

parallel_search_arxiv

Execute multiple arXiv searches simultaneously to gather comprehensive academic research from diverse perspectives. Provide up to 5 search queries covering different methodologies and angles.

Instructions

Run multiple arXiv searches in parallel for comprehensive research coverage and diverse academic angles. For best results, provide multiple search queries that explore different research angles and methodologies. You can use expand_query to help generate diverse queries, or create them yourself.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
searchesYesArray of arXiv search configurations to execute in parallel (maximum 5 searches for optimal performance)
timeoutNoTimeout in milliseconds for all searches

Implementation Reference

  • The main handler function for the parallel_search_arxiv tool. It validates the bearer token, deduplicates search queries, creates a wrapper for executeArxivSearch, executes parallel searches using executeParallelSearches, formats results, and handles errors.
    async ({ searches, timeout }: { searches: SearchArxivArgs[]; timeout: number }) => {
    	try {
    		const props = getProps();
    
    		const tokenError = checkBearerToken(props.bearerToken);
    		if (tokenError) {
    			return tokenError;
    		}
    
    		const uniqueSearches = searches.filter((search, index, self) =>
    			index === self.findIndex(s => s.query === search.query)
    		);
    
    		// Use the common arXiv search function
    		const arxivSearchFunction = async (searchArgs: SearchArxivArgs) => {
    			return executeArxivSearch(searchArgs, props.bearerToken);
    		};
    
    		// Execute parallel searches using utility
    		const results = await executeParallelSearches(uniqueSearches, arxivSearchFunction, { timeout });
    
    		return {
    			content: formatParallelSearchResultsToContentItems(results),
    		};
    	} catch (error) {
    		return createErrorResponse(`Error: ${error instanceof Error ? error.message : String(error)}`);
    	}
    },
  • Zod schema defining the input parameters for the parallel_search_arxiv tool: an array of up to 5 search configurations (query, num, tbs) and an optional timeout.
    	searches: z.array(z.object({
    		query: z.string().describe("Academic search terms, author names, or research topics"),
    		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")
    	})).max(5).describe("Array of arXiv search configurations to execute in parallel (maximum 5 searches for optimal performance)"),
    	timeout: z.number().default(30000).describe("Timeout in milliseconds for all searches")
    },
  • Registration of the parallel_search_arxiv tool using server.tool(), including name, description, schema, and handler function.
    server.tool(
    	"parallel_search_arxiv",
    	"Run multiple arXiv searches in parallel for comprehensive research coverage and diverse academic angles. For best results, provide multiple search queries that explore different research angles and methodologies. You can use expand_query to help generate diverse queries, or create them yourself. 💡 Use this when you need to explore multiple research directions simultaneously for efficiency.",
    	{
    		searches: z.array(z.object({
    			query: z.string().describe("Academic search terms, author names, or research topics"),
    			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")
    		})).max(5).describe("Array of arXiv search configurations to execute in parallel (maximum 5 searches for optimal performance)"),
    		timeout: z.number().default(30000).describe("Timeout in milliseconds for all searches")
    	},
    	async ({ searches, timeout }: { searches: SearchArxivArgs[]; timeout: number }) => {
    		try {
    			const props = getProps();
    
    			const tokenError = checkBearerToken(props.bearerToken);
    			if (tokenError) {
    				return tokenError;
    			}
    
    			const uniqueSearches = searches.filter((search, index, self) =>
    				index === self.findIndex(s => s.query === search.query)
    			);
    
    			// Use the common arXiv search function
    			const arxivSearchFunction = async (searchArgs: SearchArxivArgs) => {
    				return executeArxivSearch(searchArgs, props.bearerToken);
    			};
    
    			// Execute parallel searches using utility
    			const results = await executeParallelSearches(uniqueSearches, arxivSearchFunction, { timeout });
    
    			return {
    				content: formatParallelSearchResultsToContentItems(results),
    			};
    		} catch (error) {
    			return createErrorResponse(`Error: ${error instanceof Error ? error.message : String(error)}`);
    		}
    	},
    );
  • Helper function that executes a single arXiv search by making a POST request to Jina's search API with domain='arxiv'.
    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)}` };
        }
    }
  • Helper function that executes multiple search functions in parallel with timeout and error handling, used by the tool handler.
    export async function executeParallelSearches<T>(
        searches: T[],
        searchFunction: (searchArgs: T) => Promise<SearchResultOrError>,
        options: ParallelSearchOptions = {}
    ): Promise<ParallelSearchResult[]> {
        const { timeout = 30000 } = options;
    
        // Execute all searches in parallel
        const searchPromises = searches.map(async (searchArgs) => {
            try {
                return await searchFunction(searchArgs);
            } catch (error) {
                return { error: `Search failed: ${error instanceof Error ? error.message : String(error)}` };
            }
        });
    
        // Wait for all searches with timeout
        const results = await Promise.allSettled(searchPromises);
        const timeoutPromise = new Promise(resolve => setTimeout(() => resolve('timeout'), timeout));
    
        const completedResults = await Promise.race([
            Promise.all(results.map(result =>
                result.status === 'fulfilled' ? result.value : { error: 'Promise rejected' }
            )),
            timeoutPromise
        ]);
    
        if (completedResults === 'timeout') {
            throw new Error(`Parallel search timed out after ${timeout}ms`);
        }
    
        return completedResults as ParallelSearchResult[];
    }
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions 'parallel' execution and 'optimal performance' with max 5 searches, which adds useful context beyond the schema. However, it doesn't describe important behavioral aspects like error handling, rate limits, authentication needs, or what the output format looks like (especially critical since there's no output schema).

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is appropriately sized with three sentences. The first sentence states the core purpose, the second provides usage guidance, and the third offers implementation suggestions. There's no wasted text, though the structure could be slightly more front-loaded with the most critical information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a tool with 2 parameters, 100% schema coverage, but no annotations and no output schema, the description is adequate but has gaps. It covers the parallel execution concept and query diversity guidance, but doesn't address what the tool returns (critical without an output schema) or important behavioral constraints. The description compensates somewhat but not fully for the missing structured data.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents all parameters thoroughly. The description adds minimal value beyond the schema - it mentions 'multiple search queries' which aligns with the 'searches' array parameter, but doesn't provide additional semantic context about parameter usage or interactions that isn't already in the schema descriptions.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: 'Run multiple arXiv searches in parallel for comprehensive research coverage and diverse academic angles.' It specifies the verb ('run'), resource ('arXiv searches'), and scope ('in parallel'), but doesn't explicitly differentiate from its sibling 'search_arxiv' beyond the parallel execution aspect.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides clear context about when to use this tool: 'For best results, provide multiple search queries that explore different research angles and methodologies.' It also mentions an alternative tool ('expand_query') for query generation, though it doesn't explicitly contrast when to use this versus the regular 'search_arxiv' sibling tool.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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/wlmwwx/jina-mcp'

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