Skip to main content
Glama
joeblockchain

Jina AI MCP Server

search_web

Search the web using Jina AI's API to find information, extract content, and retrieve web data in multiple formats for analysis.

Instructions

Search the web using Jina AI's search API

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYes
countNo
retain_imagesNonone
with_generated_altNo
return_formatNomarkdown

Implementation Reference

  • index.ts:65-87 (handler)
    The `searchWeb` function that executes the core logic of the 'search_web' tool by querying Jina AI's search API and parsing the response.
    async function searchWeb(params: z.infer<typeof SearchWebSchema>) {
      const headers: Record<string, string> = {
        'Authorization': `Bearer ${JINA_API_KEY}`,
        'Accept': 'application/json',
        'X-Retain-Images': params.retain_images,
        'X-With-Generated-Alt': params.with_generated_alt.toString(),
        'X-Return-Format': params.return_format
      };
    
      const queryString = encodeURIComponent(params.query);
      const url = `https://s.jina.ai/${queryString}?count=${params.count}`;
    
      const response = await fetch(url, {
        method: 'GET',
        headers,
      });
    
      if (!response.ok) {
        throw new Error(`Jina AI Search API error: ${response.statusText}`);
      }
    
      return SearchResponseSchema.parse(await response.json());
    }
  • Zod schema defining the input parameters for the 'search_web' tool.
    export const SearchWebSchema = z.object({
      query: z.string(),
      count: z.number().optional().default(5),
      retain_images: z.enum(['none', 'all']).optional().default('none'),
      with_generated_alt: z.boolean().optional().default(true),
      return_format: z.enum(['markdown', 'text', 'html']).optional().default('markdown')
    });
  • index.ts:118-122 (registration)
    Registration of the 'search_web' tool in the ListTools handler, providing name, description, and input schema.
    {
      name: "search_web",
      description: "Search the web using Jina AI's search API",
      inputSchema: zodToJsonSchema(SearchWebSchema)
    },
  • index.ts:145-149 (registration)
    Dispatch handler in the CallToolRequestSchema that parses arguments, calls searchWeb, and formats the response.
    case "search_web": {
      const args = SearchWebSchema.parse(request.params.arguments);
      const result = await searchWeb(args);
      return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
    }
  • Zod schema for parsing the output response from Jina AI's search API.
    export const SearchResponseSchema = z.object({
      code: z.number(),
      status: z.number(),
      data: z.array(z.object({
        title: z.string(),
        description: z.string().optional(),
        url: z.string(),
        content: z.string(),
        images: z.record(z.string()).optional(),
        links: z.record(z.string()).optional(),
        usage: z.object({
          tokens: z.number()
        })
      }))
    });
Behavior2/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 'using Jina AI's search API', which hints at external API usage, but fails to disclose critical traits like rate limits, authentication needs, error handling, or what the search results entail (e.g., format, sources). For a tool with 5 parameters and no annotations, this is a significant gap in transparency.

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

Conciseness5/5

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

The description is a single, efficient sentence that directly states the tool's function without unnecessary words. It's appropriately sized and front-loaded, making it easy to parse quickly. Every part of the sentence earns its place by conveying the core action and method.

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

Completeness2/5

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

Given the tool's complexity with 5 parameters, no annotations, and no output schema, the description is incomplete. It doesn't cover behavioral aspects, parameter details, or what to expect in return, leaving gaps that could hinder an agent's ability to use the tool effectively. For a search tool with multiple options, more context is needed to be fully helpful.

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?

The description adds no meaning beyond the input schema, which has 0% description coverage for its 5 parameters. It doesn't explain what parameters like 'retain_images' or 'with_generated_alt' do, their implications, or how they affect results. With low schema coverage, the description fails to compensate, but since it doesn't mislead, it meets the baseline of 3 for not adding value beyond the schema.

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

Purpose3/5

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

The description states the tool 'Search the web using Jina AI's search API', which provides a clear verb ('Search') and resource ('the web'), but it's vague about what distinguishes it from sibling tools like 'read_webpage' or 'fact_check'. It doesn't specify if this is for general web searches versus fact-checking or reading specific pages, leaving the purpose somewhat ambiguous in context.

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

Usage Guidelines2/5

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

The description offers no guidance on when to use this tool versus alternatives like 'fact_check' or 'read_webpage'. It lacks any context about use cases, exclusions, or prerequisites, such as whether it's for broad queries, real-time information, or specific domains. This absence of usage instructions makes it difficult for an agent to choose appropriately among siblings.

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

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