Skip to main content
Glama
joeblockchain

Jina AI MCP Server

read_webpage

Extract webpage content in formats optimized for LLM processing, including text, markdown, HTML, and screenshots with configurable options.

Instructions

Extract content from a webpage in a format optimized for LLMs

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlYes
formatNo
with_linksNo
with_imagesNo
with_generated_altNo
no_cacheNo

Implementation Reference

  • index.ts:37-63 (handler)
    The handler function that implements the read_webpage tool. It makes a POST request to Jina AI's reader API (https://r.jina.ai/) with the provided URL and optional parameters, handles headers for additional features, and parses the response using ReaderResponseSchema.
    async function readWebPage(params: z.infer<typeof ReadWebPageSchema>) {
      const headers: Record<string, string> = {
        'Authorization': `Bearer ${JINA_API_KEY}`,
        'Content-Type': 'application/json',
        'Accept': 'application/json'
      };
    
      if (params.with_links) headers['X-With-Links-Summary'] = 'true';
      if (params.with_images) headers['X-With-Images-Summary'] = 'true';
      if (params.with_generated_alt) headers['X-With-Generated-Alt'] = 'true';
      if (params.no_cache) headers['X-No-Cache'] = 'true';
    
      const response = await fetch('https://r.jina.ai/', {
        method: 'POST',
        headers,
        body: JSON.stringify({
          url: params.url,
          options: params.format || 'Default'
        })
      });
    
      if (!response.ok) {
        throw new Error(`Jina AI API error: ${response.statusText}`);
      }
    
      return ReaderResponseSchema.parse(await response.json());
    }
  • Zod schema defining the input parameters for the read_webpage tool: required URL and optional flags for format, links, images, alt text generation, and cache.
    export const ReadWebPageSchema = z.object({
      url: z.string(),
      format: z.enum(['Default', 'Markdown', 'HTML', 'Text', 'Screenshot', 'Pageshot']).optional(),
      with_links: z.boolean().optional(),
      with_images: z.boolean().optional(),
      with_generated_alt: z.boolean().optional(),
      no_cache: z.boolean().optional()
    });
  • index.ts:113-117 (registration)
    Registration of the read_webpage tool in the MCP server's list tools handler. Specifies the tool name, description, and converts the Zod schema to JSON schema for the protocol.
    {
      name: "read_webpage",
      description: "Extract content from a webpage in a format optimized for LLMs",
      inputSchema: zodToJsonSchema(ReadWebPageSchema)
    },
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 the output is 'optimized for LLMs', which hints at formatting, but fails to describe critical behaviors like error handling (e.g., for invalid URLs), rate limits, authentication needs, or whether it performs web scraping with respect to robots.txt. This leaves significant gaps for a tool with 6 parameters.

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 purpose without unnecessary words. It is front-loaded with the core action ('Extract content') and avoids redundancy. Every part of the sentence contributes to understanding the tool's function.

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 complexity (6 parameters, no annotations, no output schema), the description is incomplete. It doesn't address behavioral aspects like error handling or rate limits, provide parameter details, or explain the return format. For a web extraction tool with multiple options, this leaves too many unknowns for effective agent use.

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 0%, so the description must compensate, but it adds no specific information about parameters beyond the general purpose. It doesn't explain what 'format' options like 'Screenshot' entail, how 'with_links' or 'with_images' affect output, or the meaning of 'no_cache'. The baseline is 3 due to the high parameter count and lack of compensation in the description.

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 verb ('Extract content') and resource ('from a webpage'), with the specific goal of optimization 'for LLMs'. It distinguishes from siblings like 'fact_check' and 'search_web' by focusing on content extraction rather than verification or search. However, it doesn't explicitly mention how it differs from those siblings in terms of scope or output.

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 provides no guidance on when to use this tool versus alternatives like 'search_web' or 'fact_check'. It lacks context about prerequisites, such as internet access or URL validity, and doesn't specify scenarios where this extraction is preferred over other methods. Usage is implied by the purpose but not explicitly defined.

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