glm-web-search
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chineseglm-web-search
glm-web-search
使用 GLM 联网搜索 MCP 服务器进行网络搜索。
Use the GLM web search MCP server for internet searching.
执行流程(首次需要安装,后续直接步骤6调用)
Execution Process (Installation required for first use, directly call step 6 for subsequent uses)
步骤 1: 检查并安装依赖
Step 1: Check and install dependencies
1.1 检查 mcporter 是否可用
1.1 Check if mcporter is available
bash
npx -y mcporter --version如果命令返回成功,说明 mcporter 可用,跳到步骤 2。
mcporter 可以直接通过 npx 使用,无需安装。
bash
npx -y mcporter --versionIf the command returns successfully, it means mcporter is available, skip to step 2.
mcporter can be used directly via npx without installation.
步骤 2: 检查 API Key 配置
Step 2: Check API Key configuration
bash
cat ~/.openclaw/config/glm.json 2>/dev/null | python3 -c "import json,sys; d=json.load(sys.stdin); print(d.get('api_key', ''))"如果返回非空的 API Key,跳到步骤 4。
bash
cat ~/.openclaw/config/glm.json 2>/dev/null | python3 -c "import json,sys; d=json.load(sys.stdin); print(d.get('api_key', ''))"If a non-empty API Key is returned, skip to step 4.
步骤 3: 配置 API Key(如果未配置)
Step 3: Configure API Key (if not configured)
3.2 如果没有找到 Key,向用户索要
3.2 If no Key is found, request it from the user
如果用户没有智谱 API Key,可以访问 https://www.bigmodel.cn/glm-coding?ic=OOKF4KGGTW 购买。
询问用户提供智谱 API Key。
If the user does not have a Zhipu API Key, they can purchase it at https://www.bigmodel.cn/glm-coding?ic=OOKF4KGGTW.
Ask the user to provide the Zhipu API Key.
3.3 保存 API Key
3.3 Save API Key
bash
mkdir -p ~/.openclaw/config
cat > ~/.openclaw/config/glm.json << EOF
{
"api_key": "API密钥"
}
EOFbash
mkdir -p ~/.openclaw/config
cat > ~/.openclaw/config/glm.json << EOF
{
"api_key": "API密钥"
}
EOF步骤 4: 添加 MCP 服务器
Step 4: Add MCP server
使用 mcporter 添加 GLM 联网搜索 MCP 服务器:
bash
mcporter config add glm-search \
--type sse \
--url "https://open.bigmodel.cn/api/mcp/web_search_prime/sse?Authorization=your-key"注意:将 替换为实际的智谱 API Key。
your-keyUse mcporter to add the GLM web search MCP server:
bash
mcporter config add glm-search \
--type sse \
--url "https://open.bigmodel.cn/api/mcp/web_search_prime/sse?Authorization=your-key"Note: Replace with your actual Zhipu API Key.
your-key步骤 5: 测试连接
Step 5: Test the connection
bash
mcporter list确认 服务器已成功添加。
glm-searchbash
mcporter listConfirm that the server has been added successfully.
glm-search步骤 6: 使用 mcporter 调用 MCP 进行网络搜索
Step 6: Use mcporter to call MCP for web search
6.1 使用 mcporter 调用 MCP 工具
6.1 Use mcporter to call MCP tools
使用 mcporter 调用 MCP 服务:
bash
mcporter call glm-search.webSearchPrime search_query="<搜索查询>"示例:
bash
undefinedUse mcporter to call the MCP service:
bash
mcporter call glm-search.webSearchPrime search_query="<搜索查询>"Example:
bash
undefined搜索今日新闻
搜索今日新闻
mcporter call glm-search.webSearchPrime search_query="今天的热点新闻"
mcporter call glm-search.webSearchPrime search_query="今天的热点新闻"
搜索技术信息
搜索技术信息
mcporter call glm-search.webSearchPrime search_query="Python 异步编程最佳实践"
undefinedmcporter call glm-search.webSearchPrime search_query="Python 异步编程最佳实践"
undefined6.2 API 参数说明
6.2 API Parameter Description
| 参数 | 说明 | 类型 |
|---|---|---|
| search_query | 搜索查询字符串 | string (必填) |
| Parameter | Description | Type |
|---|---|---|
| search_query | Search query string | string (required) |
支持的工具
Supported Tools
重要提示:如果出现问题以官方说明为准
官方版说明 : https://docs.bigmodel.cn/cn/coding-plan/mcp/search-mcp-server
GLM 联网搜索 MCP 服务器提供以下工具:
- - 搜索网络信息,返回结果包括网页标题、网页URL、网页摘要、网站名称、网站图标等
webSearchPrime
Important note: If any problem occurs, please refer to the official description
Official documentation: https://docs.bigmodel.cn/cn/coding-plan/mcp/search-mcp-server
The GLM web search MCP server provides the following tools:
- - Search for network information, returned results include web page title, web page URL, web page summary, website name, website icon, etc.
webSearchPrime
MCP 配置
MCP Configuration
MCP 服务器名称:
glm-searchMCP 服务器类型:HTTP
MCP 服务器 URL:
https://open.bigmodel.cn/api/mcp/web_search_prime/mcp认证方式:Bearer Token(Authorization header)
MCP server name:
glm-searchMCP server type: HTTP
MCP server URL:
https://open.bigmodel.cn/api/mcp/web_search_prime/mcpAuthentication method: Bearer Token (Authorization header)