Skip to main content
Glama
acchuang

Jina AI Remote MCP Server

by acchuang

search_web

Search the web for current information, news, articles, and websites to answer questions about recent events or find specific resources.

Instructions

Search the entire web for current information, news, articles, and websites. Use this when you need up-to-date information, want to find specific websites, research topics, or get the latest news. Ideal for answering questions about recent events, finding resources, or discovering relevant content.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesSearch terms or keywords to find relevant web content (e.g., 'climate change news 2024', 'best pizza recipe'). Can be a single query string or an array of queries for parallel search.
numNoMaximum number of search results to return, between 1-100
tbsNoTime-based search parameter, e.g., 'qdr:h' for past hour, can be qdr:h, qdr:d, qdr:w, qdr:m, qdr:y
locationNoLocation for search results, e.g., 'London', 'New York', 'Tokyo'
glNoCountry code, e.g., 'dz' for Algeria
hlNoLanguage code, e.g., 'zh-cn' for Simplified Chinese

Implementation Reference

  • The core handler function for the 'search_web' tool. It authenticates using bearer token, performs a POST request to Jina's web search API (https://svip.jina.ai/), handles API errors, parses the JSON response, and returns the search results formatted as YAML.
    async ({ query, num = 30 }: { query: string; num?: number }) => {
    	try {
    		const props = getProps();
    
    		const tokenError = checkBearerToken(props.bearerToken);
    		if (tokenError) {
    			return tokenError;
    		}
    
    		const response = await fetch('https://svip.jina.ai/', {
    			method: 'POST',
    			headers: {
    				'Accept': 'application/json',
    				'Content-Type': 'application/json',
    				'Authorization': `Bearer ${props.bearerToken}`,
    			},
    			body: JSON.stringify({
    				q: query,
    				num
    			}),
    		});
    
    		if (!response.ok) {
    			return handleApiError(response, "Web search");
    		}
    
    		const data = await response.json() as any;
    
    
    		return {
    			content: [
    				{
    					type: "text" as const,
    					text: yamlStringify(data.results),
    				},
    			],
    		};
    	} catch (error) {
    		return {
    			content: [
    				{
    					type: "text" as const,
    					text: `Error: ${error instanceof Error ? error.message : String(error)}`,
    				},
    			],
    			isError: true,
    		};
    	}
    },
  • Input schema using Zod for validating the 'query' (required string) and 'num' (optional number, default 30) parameters of the search_web tool.
    {
    	query: z.string().describe("Search terms or keywords to find relevant web content (e.g., 'climate change news 2024', 'best pizza recipe')"),
    	num: z.number().optional().describe("Maximum number of search results to return, between 1-100 (default: 30)")
    },
  • Registers the 'search_web' tool on the MCP server by calling server.tool with the tool name, description, Zod input schema, and the handler function.
    server.tool(
    	"search_web",
    	"Search the entire web for current information, news, articles, and websites. Use this when you need up-to-date information, want to find specific websites, research topics, or get the latest news. Ideal for answering questions about recent events, finding resources, or discovering relevant content. Returns structured search results with URLs, titles, and content snippets.",
    	{
    		query: z.string().describe("Search terms or keywords to find relevant web content (e.g., 'climate change news 2024', 'best pizza recipe')"),
    		num: z.number().optional().describe("Maximum number of search results to return, between 1-100 (default: 30)")
    	},
    	async ({ query, num = 30 }: { query: string; num?: number }) => {
    		try {
    			const props = getProps();
    
    			const tokenError = checkBearerToken(props.bearerToken);
    			if (tokenError) {
    				return tokenError;
    			}
    
    			const response = await fetch('https://svip.jina.ai/', {
    				method: 'POST',
    				headers: {
    					'Accept': 'application/json',
    					'Content-Type': 'application/json',
    					'Authorization': `Bearer ${props.bearerToken}`,
    				},
    				body: JSON.stringify({
    					q: query,
    					num
    				}),
    			});
    
    			if (!response.ok) {
    				return handleApiError(response, "Web search");
    			}
    
    			const data = await response.json() as any;
    
    
    			return {
    				content: [
    					{
    						type: "text" as const,
    						text: yamlStringify(data.results),
    					},
    				],
    			};
    		} catch (error) {
    			return {
    				content: [
    					{
    						type: "text" as const,
    						text: `Error: ${error instanceof Error ? error.message : String(error)}`,
    					},
    				],
    				isError: true,
    			};
    		}
    	},
    );
  • src/index.ts:19-22 (registration)
    During MCP agent initialization, calls registerJinaTools which registers the search_web tool (among others) on the server.
    async init() {
    	// Register all Jina AI tools
    	registerJinaTools(this.server, () => this.props);
    }

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed5 schema fields changedv1.0.0
    • addedInput schema / properties / num / default
      Added value: +30
    • changedInput schema / properties / num / description
      Previous value: -"Maximum number of search results to return, between 1-100 (default: 30)"New value: +"Maximum number of search results to return, between 1-100"
    • addedInput schema / properties / query / anyOf
      Added value: +[
      +  {
      +    "type": "string"
      +  },
      +  {
      +    "items": {
      +      "type": "string"
      +    },
      +    "type": "array"
      +  }
      +]
    • changedInput schema / properties / query / description
      Previous value: -"Search terms or keywords to find relevant web content (e.g., 'climate change news 2024', 'best pizza recipe')"New value: +"Search terms or keywords to find relevant web content (e.g., 'climate change news 2024', 'best pizza recipe'). Can be a single query string or an array of queries for parallel search."
    • removedInput schema / properties / query / type
      Removed value: -"string"
  2. First observed

TDQS

A4/5.0
Behavior3/5

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

No annotations are provided, so the description carries the full burden. It mentions the tool searches for 'current information' and is 'ideal for answering questions about recent events,' which implies up-to-date results, but lacks details on rate limits, authentication needs, result format, or pagination. The description adds some behavioral context but doesn't fully compensate for the absence of annotations.

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 and front-loaded, starting with the core purpose. It uses two sentences efficiently, with the second sentence providing usage guidelines without redundancy. Every sentence adds value, though it could be slightly more structured for clarity.

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?

Given the tool's complexity (6 parameters, no annotations, no output schema), the description is moderately complete. It covers purpose and usage well but lacks details on behavioral traits like result format, error handling, or limitations. Without annotations or output schema, more context on what to expect from results would improve completeness.

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 6 parameters thoroughly. The description doesn't add any parameter-specific information beyond what's in the schema, such as examples or usage tips. With high schema coverage, the baseline is 3, as the description doesn't enhance parameter understanding.

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

Purpose5/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 with specific verbs ('search the entire web') and resources ('current information, news, articles, websites'). It distinguishes from siblings by specifying web search versus academic (arxiv/ssrn), image search, or URL operations, making the scope explicit.

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

Usage Guidelines5/5

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

The description provides explicit guidance on when to use this tool ('when you need up-to-date information, want to find specific websites, research topics, or get the latest news') and includes ideal use cases ('answering questions about recent events, finding resources, or discovering relevant content'). It implicitly distinguishes from siblings by focusing on general web content versus specialized sources.

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