> For the complete documentation index, see [llms.txt](https://docs.console.zenlayer.com/test/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.console.zenlayer.com/test/compute/mcpg/web-search/jina.md).

# Jina

将网络信息输入LLMs是接地的重要步骤，但可能具有挑战性。最简单的方法是抓取网页并提供原始HTML。然而，抓取可能很复杂，并经常被阻止，原始HTML中充斥着像标记和脚本等多余元素。Reader API通过从URL中提取核心内容并将其转换为干净、适合LLM的文本来解决这些问题，确保您的代理和RAG系统获得高质量的输入。

## MCP 工具

### Search（网络搜索）

LLMs有一个知识截止点，这意味着它们无法访问最新的世界知识。这会导致诸如错误信息、过时的回应、幻觉和其他事实性问题。对于GenAI应用来说，基础是绝对必要的。Reader允许你用来自网络的最新信息来为你的LLM提供基础。只需在你的查询前加上 ，Reader就会搜索网络并返回前五个结果及其URL和内容，每个都是干净且适合LLM使用的文本。这样，你可以始终保持你的LLM更新，提高其准确性，并减少幻觉。 来自于

#### 参数

**Body 参数**

* `q` (string, 必需): 搜索查询字符串
* `num` (number, 可选): 返回的最大结果数。仅在需要更多结果时设置此项
* `page` (number, 可选): 分页结果偏移量（跳过给定数量的结果）

**Header 参数**

* `Authorization` (string, 可选): API授权 | 示例值：`Bearer {{YOUR_API_KEY}}`
* `X-Respond-With` (string, 可选): 设置为 "no-content" 以从响应中排除页面内容
* `X-Site` (string, 可选): 限制搜索到特定域名（例如 "jina.ai"）
* `X-No-Cache` (string, 可选): 设置为 "true" 以绕过缓存并获取实时数据
* `X-With-Links-Summary` (string, 可选): "all" 用于收集所有链接，"true" 用于在响应末尾收集唯一链接
* `X-With-Images-Summary` (string, 可选): "all" 用于收集所有图像，"true" 用于在响应末尾收集唯一图像
* `X-Retain-Images` (string, 可选): 设置为 "none" 以从响应中移除所有图像
* `X-With-Generated-Alt` (string, 可选): 设置为 "true" 以为没有alt标签的图像生成标题
* `X-Return-Format` (string, 可选): 响应格式 — "markdown"、"html"、"text"、"screenshot" 或 "pageshot"
* `X-Timeout` (string, 可选): 最大等待秒数（例如 "10"）
* `X-Locale` (string, 可选): 浏览器区域设置（例如 "en-US"、"zh-CN"）

### MCP Cline 配置

此服务器需要通过您的 MCP 客户端进行配置。以下是不同环境下的示例：

需要替换你的租户ID和API Key（必需）

```
{
  "mcpServers": {
    "jina": {
      "type": "streamable_http",
      "url": "https://mcp.ecn.ai/{CID}/jina/mcp",
      "headers": {
        "Authorization": "Bearer 你的API Key"
      }
    }
  }
}
```

## API 接口

### Search（网络搜索）

#### 请求信息

* **Method**: GET
* **Endpoint**: `/jina/search/{query}`

#### 请求参数

**Body 参数**

* `q` (string, 必需): 搜索查询字符串
* `num` (number, 可选): 返回的最大结果数。仅在需要更多结果时设置此项
* `page` (number, 可选): 分页结果偏移量（跳过给定数量的结果）

**Header 参数**

* `Authorization` (string, 可选): API授权 | 示例值：`Bearer {{YOUR_API_KEY}}`
* `X-Respond-With` (string, 可选): 设置为 "no-content" 以从响应中排除页面内容
* `X-Site` (string, 可选): 限制搜索到特定域名（例如 "jina.ai"）
* `X-No-Cache` (string, 可选): 设置为 "true" 以绕过缓存并获取实时数据
* `X-With-Links-Summary` (string, 可选): "all" 用于收集所有链接，"true" 用于在响应末尾收集唯一链接
* `X-With-Images-Summary` (string, 可选): "all" 用于收集所有图像，"true" 用于在响应末尾收集唯一图像
* `X-Retain-Images` (string, 可选): 设置为 "none" 以从响应中移除所有图像
* `X-With-Generated-Alt` (string, 可选): 设置为 "true" 以为没有alt标签的图像生成标题
* `X-Return-Format` (string, 可选): 响应格式 — "markdown"、"html"、"text"、"screenshot" 或 "pageshot"
* `X-Timeout` (string, 可选): 最大等待秒数（例如 "10"）
* `X-Locale` (string, 可选): 浏览器区域设置（例如 "en-US"、"zh-CN"）

#### 返回响应

* **200 成功**
  * Content-Type：`application/json`

#### 请求示例

```
curl --location 'https://api.ecn.ai/jina/search' \
--header 'Authorization: Bearer {{YOUR_API_KEY}}' \
--header 'Content-Type: application/json' \
--data '
{
  "q": "什么是agent sandbox"
}
'
```

#### 响应示例

```json
{}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.console.zenlayer.com/test/compute/mcpg/web-search/jina.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
