From 0365935c1a28ca70f40a2dc26c15f107c6dcde06 Mon Sep 17 00:00:00 2001 From: Creator Date: Tue, 13 Jan 2026 06:08:19 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=20Claude=20Code=20=E5=B7=A5?= =?UTF-8?q?=E5=85=B7=E9=9B=86=EF=BC=8C=E5=8C=85=E5=90=AB=E5=A4=9A=E7=A7=8D?= =?UTF-8?q?=E6=B5=8F=E8=A7=88=E5=99=A8=E8=87=AA=E5=8A=A8=E5=8C=96=E5=8A=9F?= =?UTF-8?q?=E8=83=BD=E5=92=8C=E8=BE=93=E5=85=A5=E6=A8=A1=E5=BC=8F=EF=BC=8C?= =?UTF-8?q?=E4=BB=A5=E5=A2=9E=E5=BC=BA=E7=94=A8=E6=88=B7=E4=BA=A4=E4=BA=92?= =?UTF-8?q?=E4=BD=93=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Claude Code/Claude for Chrome/Tools.json | 504 +++++++++++++++++++++++ 1 file changed, 504 insertions(+) create mode 100644 Claude Code/Claude for Chrome/Tools.json diff --git a/Claude Code/Claude for Chrome/Tools.json b/Claude Code/Claude for Chrome/Tools.json new file mode 100644 index 0000000..f2407b7 --- /dev/null +++ b/Claude Code/Claude for Chrome/Tools.json @@ -0,0 +1,504 @@ +[ + { + "name": "computer", + "description": "使用鼠标和键盘与 Web 浏览器交互,并截取屏幕截图。如果您没有有效的标签页 ID,请先使用 tabs_context 获取可用标签页。\n* 每当您打算点击图标等元素时,应该查阅截图以在移动光标之前确定元素的坐标。\n* 如果您尝试点击程序或链接但即使等待后也未能加载,请尝试调整点击位置,使光标尖端在视觉上落在您想要点击的元素上。\n* 确保用光标尖端在元素中心点击任何按钮、链接、图标等。除非被要求,否则不要在边缘点击框。", + "input_schema": { + "type": "object", + "properties": { + "action": { + "type": "string", + "enum": [ + "left_click", + "right_click", + "type", + "screenshot", + "wait", + "scroll", + "key", + "left_click_drag", + "double_click", + "triple_click", + "zoom", + "scroll_to", + "hover" + ], + "description": "要执行的操作:\n* `left_click`: 在指定坐标处点击鼠标左键。\n* `right_click`: 在指定坐标处点击鼠标右键以打开上下文菜单。\n* `double_click`: 在指定坐标处双击鼠标左键。\n* `triple_click`: 在指定坐标处三击鼠标左键。\n* `type`: 输入文本字符串。\n* `screenshot`: 截取屏幕截图。\n* `wait`: 等待指定的秒数。\n* `scroll`: 在指定坐标处向上、向下、向左或向右滚动。\n* `key`: 按下特定的键盘键。\n* `left_click_drag`: 从 start_coordinate 拖动到 coordinate。\n* `zoom`: 截取特定区域的屏幕截图以进行更仔细的检查。\n* `scroll_to`: 使用 read_page 或 find 工具的元素引用 ID 将元素滚动到视图中。\n* `hover`: 将鼠标光标移动到指定坐标或元素而不点击。用于显示工具提示、下拉菜单或触发悬停状态。" + }, + "coordinate": { + "type": "array", + "items": { + "type": "number" + }, + "minItems": 2, + "maxItems": 2, + "description": "(x, y): x(距左边缘的像素)和 y(距顶边缘的像素)坐标。`left_click`、`right_click`、`double_click`、`triple_click` 和 `scroll` 需要。对于 `left_click_drag`,这是结束位置。" + }, + "text": { + "type": "string", + "description": "要输入的文本(对于 `type` 操作)或要按下的键(对于 `key` 操作)。对于 `key` 操作:提供空格分隔的键(例如,\"Backspace Backspace Delete\")。支持使用平台修饰键的键盘快捷键(在 Mac 上使用 \"cmd\",在 Windows/Linux 上使用 \"ctrl\",例如,\"cmd+a\" 或 \"ctrl+a\" 表示全选)。" + }, + "duration": { + "type": "number", + "minimum": 0, + "maximum": 30, + "description": "要等待的秒数。`wait` 需要。最多 30 秒。" + }, + "scroll_direction": { + "type": "string", + "enum": [ + "up", + "down", + "left", + "right" + ], + "description": "滚动方向。`scroll` 需要。" + }, + "scroll_amount": { + "type": "number", + "minimum": 1, + "maximum": 10, + "description": "滚动轮滚动的次数。对于 `scroll` 可选,默认为 3。" + }, + "start_coordinate": { + "type": "array", + "items": { + "type": "number" + }, + "minItems": 2, + "maxItems": 2, + "description": "(x, y): `left_click_drag` 的起始坐标。" + }, + "region": { + "type": "array", + "items": { + "type": "number" + }, + "minItems": 4, + "maxItems": 4, + "description": "(x0, y0, x1, y1): 要为 `zoom` 捕获的矩形区域。坐标定义一个从左上角 (x0, y0) 到右下角 (x1, y1) 的矩形,以距视口原点的像素为单位。`zoom` 操作需要。用于检查小的 UI 元素,如图标、按钮或文本。" + }, + "repeat": { + "type": "number", + "minimum": 1, + "maximum": 100, + "description": "重复键序列的次数。仅适用于 `key` 操作。必须是 1 到 100 之间的正整数。默认为 1。用于导航任务,如多次按下箭头键。" + }, + "ref": { + "type": "string", + "description": "来自 read_page 或 find 工具的元素引用 ID(例如,\"ref_1\"、\"ref_2\")。`scroll_to` 操作需要。可以用作点击操作的 `coordinate` 的替代方案。" + }, + "modifiers": { + "type": "string", + "description": "用于点击操作的修饰键。支持:\"ctrl\"、\"shift\"、\"alt\"、\"cmd\"(或 \"meta\")、\"win\"(或 \"windows\")。可以用 \"+\" 组合(例如,\"ctrl+shift\"、\"cmd+alt\")。可选。" + }, + "tabId": { + "type": "number", + "description": "要执行操作的标签页 ID。必须是当前组中的标签页。如果您没有有效的标签页 ID,请先使用 tabs_context。" + } + }, + "required": [ + "action", + "tabId" + ] + } + }, + { + "name": "find", + "description": "使用自然语言在页面上查找元素。可以按元素的用途(例如,\"搜索栏\"、\"登录按钮\")或文本内容(例如,\"有机芒果产品\")搜索元素。返回最多 20 个匹配元素及其引用,这些引用可与其他工具一起使用。如果存在超过 20 个匹配项,您将被通知使用更具体的查询。如果您没有有效的标签页 ID,请先使用 tabs_context 获取可用标签页。", + "input_schema": { + "type": "object", + "properties": { + "query": { + "type": "string", + "description": "要查找内容的自然语言描述(例如,\"搜索栏\"、\"添加到购物车按钮\"、\"包含有机的产品标题\")" + }, + "tabId": { + "type": "number", + "description": "要搜索的标签页 ID。必须是当前组中的标签页。如果您没有有效的标签页 ID,请先使用 tabs_context。" + } + }, + "required": [ + "query", + "tabId" + ] + } + }, + { + "name": "form_input", + "description": "使用 read_page 工具的元素引用 ID 设置表单元素中的值。如果您没有有效的标签页 ID,请先使用 tabs_context 获取可用标签页。", + "input_schema": { + "type": "object", + "properties": { + "ref": { + "type": "string", + "description": "来自 read_page 工具的元素引用 ID(例如,\"ref_1\"、\"ref_2\")" + }, + "value": { + "type": [ + "string", + "boolean", + "number" + ], + "description": "要设置的值。对于复选框使用布尔值,对于选择框使用选项值或文本,对于其他输入使用适当的字符串/数字" + }, + "tabId": { + "type": "number", + "description": "要设置表单值的标签页 ID。必须是当前组中的标签页。如果您没有有效的标签页 ID,请先使用 tabs_context。" + } + }, + "required": [ + "ref", + "value", + "tabId" + ] + } + }, + { + "name": "get_page_text", + "description": "从页面中提取原始文本内容,优先考虑文章内容。适合阅读文章、博客文章或其他文本密集的页面。返回不带 HTML 格式的纯文本。如果您没有有效的标签页 ID,请先使用 tabs_context 获取可用标签页。", + "input_schema": { + "type": "object", + "properties": { + "tabId": { + "type": "number", + "description": "要提取文本的标签页 ID。必须是当前组中的标签页。如果您没有有效的标签页 ID,请先使用 tabs_context。" + } + }, + "required": [ + "tabId" + ] + } + }, + { + "name": "gif_creator", + "description": "管理浏览器自动化会话的 GIF 录制和导出。控制何时开始/停止录制浏览器操作(点击、滚动、导航),然后导出为带有视觉叠加层(点击指示器、操作标签、进度条、水印)的动画 GIF。所有操作都限定在标签页组的范围内。开始录制时,立即截取屏幕截图以捕获初始状态作为第一帧。停止录制时,立即在之前截取屏幕截图以捕获最终状态作为最后一帧。对于导出,提供 'coordinate' 以拖放上传到页面元素,或设置 'download: true' 以下载 GIF。", + "input_schema": { + "type": "object", + "properties": { + "action": { + "type": "string", + "enum": [ + "start_recording", + "stop_recording", + "export", + "clear" + ], + "description": "要执行的操作:'start_recording'(开始捕获)、'stop_recording'(停止捕获但保留帧)、'export'(生成并导出 GIF)、'clear'(丢弃帧)" + }, + "tabId": { + "type": "number", + "description": "标签页 ID,用于标识此操作适用于哪个标签页组" + }, + "coordinate": { + "type": "array", + "items": { + "type": "number" + }, + "description": "用于拖放上传的视口坐标 [x, y]。除非 'download' 为 true,否则 'export' 操作需要。" + }, + "download": { + "type": "boolean", + "description": "如果为 true,则下载 GIF 而不是拖放上传。仅适用于 'export' 操作。" + }, + "filename": { + "type": "string", + "description": "导出的 GIF 的可选文件名(默认:'recording-[timestamp].gif')。仅适用于 'export' 操作。" + }, + "options": { + "type": "object", + "description": "用于 'export' 操作的可选 GIF 增强选项。属性:showClickIndicators(布尔值)、showDragPaths(布尔值)、showActionLabels(布尔值)、showProgressBar(布尔值)、showWatermark(布尔值)、quality(数字 1-30)。除 quality(默认:10)外,所有默认为 true。", + "properties": { + "showClickIndicators": { + "type": "boolean", + "description": "在点击位置显示橙色圆圈(默认:true)" + }, + "showDragPaths": { + "type": "boolean", + "description": "为拖动操作显示红色箭头(默认:true)" + }, + "showActionLabels": { + "type": "boolean", + "description": "显示描述操作的黑色标签(默认:true)" + }, + "showProgressBar": { + "type": "boolean", + "description": "在底部显示橙色进度条(默认:true)" + }, + "showWatermark": { + "type": "boolean", + "description": "显示 Claude 徽标水印(默认:true)" + }, + "quality": { + "type": "number", + "description": "GIF 压缩质量,1-30(越低 = 质量越好,编码越慢)。默认:10" + } + } + }, + "required": [ + "action", + "tabId" + ] + } + } +}, + { + "name": "javascript_tool", + "description": "在当前页面的上下文中执行 JavaScript 代码。代码在页面上下文中运行,可以与 DOM、window 对象和页面变量交互。返回最后一个表达式的结果或任何抛出的错误。如果您没有有效的标签页 ID,请先使用 tabs_context 获取可用标签页。", + "input_schema": { + "type": "object", + "properties": { + "action": { + "type": "string", + "description": "必须设置为 'javascript_exec'" + }, + "text": { + "type": "string", + "description": "要执行的 JavaScript 代码。代码将在页面上下文中评估。最后一个表达式的结果将自动返回。不要使用 'return' 语句 - 只需编写您想要评估的表达式(例如,'window.myData.value' 而不是 'return window.myData.value')。您可以访问和修改 DOM,调用页面函数,并与页面变量交互。" + }, + "tabId": { + "type": "number", + "description": "要执行代码的标签页 ID。必须是当前组中的标签页。如果您没有有效的标签页 ID,请先使用 tabs_context。" + } + }, + "required": [ + "action", + "text", + "tabId" + ] + }, + "cache_control": { + "type": "ephemeral" + } + }, + { + "name": "navigate", + "description": "导航到 URL,或在浏览器历史记录中前进/后退。如果您没有有效的标签页 ID,请先使用 tabs_context 获取可用标签页。", + "input_schema": { + "type": "object", + "properties": { + "url": { + "type": "string", + "description": "要导航到的 URL。可以提供带或不带协议(默认为 https://)。使用 \"forward\" 在历史记录中前进,或使用 \"back\" 后退。" + }, + "tabId": { + "type": "number", + "description": "要导航的标签页 ID。必须是当前组中的标签页。如果您没有有效的标签页 ID,请先使用 tabs_context。" + } + }, + "required": [ + "url", + "tabId" + ] + } + }, + { + "name": "read_console_messages", + "description": "从特定标签页读取浏览器控制台消息(console.log、console.error、console.warn 等)。用于调试 JavaScript 错误、查看应用程序日志或了解浏览器控制台中发生的情况。仅返回当前域的控制台消息。如果您没有有效的标签页 ID,请先使用 tabs_context 获取可用标签页。重要提示:始终提供模式来过滤消息 - 没有模式,您可能会得到太多不相关的消息。", + "input_schema": { + "type": "object", + "properties": { + "tabId": { + "type": "number", + "description": "要读取控制台消息的标签页 ID。必须是当前组中的标签页。如果您没有有效的标签页 ID,请先使用 tabs_context。" + }, + "onlyErrors": { + "type": "boolean", + "description": "如果为 true,则仅返回错误和异常消息。默认为 false(返回所有消息类型)。" + }, + "clear": { + "type": "boolean", + "description": "如果为 true,在读取后清除控制台消息以避免后续调用中的重复。默认为 false。" + }, + "pattern": { + "type": "string", + "description": "用于过滤控制台消息的正则表达式模式。只返回与此模式匹配的消息(例如,'error|warning' 查找错误和警告,'MyApp' 过滤应用程序特定的日志)。您应该始终提供模式以避免获得太多不相关的消息。" + }, + "limit": { + "type": "number", + "description": "要返回的最大消息数。默认为 100。仅在需要更多结果时增加。" + } + }, + "required": [ + "tabId" + ] + } + }, + { + "name": "read_network_requests", + "description": "从特定标签页读取 HTTP 网络请求(XHR、Fetch、文档、图像等)。用于调试 API 调用、监控网络活动或了解页面正在发出什么请求。返回当前页面发出的所有网络请求,包括跨域请求。当页面导航到不同域时,请求会自动清除。如果您没有有效的标签页 ID,请先使用 tabs_context 获取可用标签页。", + "input_schema": { + "type": "object", + "properties": { + "tabId": { + "type": "number", + "description": "要读取网络请求的标签页 ID。必须是当前组中的标签页。如果您没有有效的标签页 ID,请先使用 tabs_context。" + }, + "urlPattern": { + "type": "string", + "description": "用于过滤请求的可选 URL 模式。只返回 URL 包含此字符串的请求(例如,'/api/' 过滤 API 调用,'example.com' 按域过滤)。" + }, + "clear": { + "type": "boolean", + "description": "如果为 true,在读取后清除网络请求以避免后续调用中的重复。默认为 false。" + }, + "limit": { + "type": "number", + "description": "要返回的最大请求数。默认为 100。仅在需要更多结果时增加。" + } + }, + "required": [ + "tabId" + ] + } + }, + { + "name": "read_page", + "description": "获取页面上元素的可访问性树表示。默认情况下返回所有元素,包括不可见的元素。输出限制为 50000 个字符。如果输出超过此限制,您将收到错误提示,要求您指定较小的深度或使用 ref_id 聚焦于特定元素。可选择仅过滤交互元素。如果您没有有效的标签页 ID,请先使用 tabs_context 获取可用标签页。", + "input_schema": { + "type": "object", + "properties": { + "filter": { + "type": "string", + "enum": [ + "interactive", + "all" + ], + "description": "过滤元素:\"interactive\" 仅适用于按钮/链接/输入,\"all\" 适用于包括不可见元素在内的所有元素(默认:所有元素)" + }, + "tabId": { + "type": "number", + "description": "要读取的标签页 ID。必须是当前组中的标签页。如果您没有有效的标签页 ID,请先使用 tabs_context。" + }, + "depth": { + "type": "number", + "description": "要遍历的树的最大深度(默认:15)。如果输出太大,请使用较小的深度。" + }, + "ref_id": { + "type": "string", + "description": "要读取的父元素的引用 ID。将返回指定的元素及其所有子元素。当输出太大时,使用此选项聚焦于页面的特定部分。" + } + }, + "required": [ + "tabId" + ] + } + }, + { + "name": "resize_window", + "description": "将当前浏览器窗口调整为指定的尺寸。用于测试响应式设计或设置特定的屏幕尺寸。如果您没有有效的标签页 ID,请先使用 tabs_context 获取可用标签页。", + "input_schema": { + "type": "object", + "properties": { + "width": { + "type": "number", + "description": "目标窗口宽度(像素)" + }, + "height": { + "type": "number", + "description": "目标窗口高度(像素)" + }, + "tabId": { + "type": "number", + "description": "要获取窗口的标签页 ID。必须是当前组中的标签页。如果您没有有效的标签页 ID,请先使用 tabs_context。" + } + }, + "required": [ + "width", + "height", + "tabId" + ] + } + }, + { + "name": "tabs_context", + "description": "获取当前标签页组中所有标签页的上下文信息", + "input_schema": { + "type": "object", + "properties": {}, + "required": [] + } + }, + { + "name": "tabs_create", + "description": "在当前标签页组中创建一个新的空标签页", + "input_schema": { + "type": "object", + "properties": {}, + "required": [] + } + }, + { + "type": "custom", + "name": "turn_answer_start", + "description": "在本轮向用户发送文本响应之前立即调用此函数。每轮都需要 - 无论您是否进行了工具调用。调用后,编写您的响应。此后不再使用工具。", + "input_schema": { + "type": "object", + "properties": {}, + "required": [] + } + }, + { + "type": "custom", + "name": "update_plan", + "description": "更新计划并在继续之前向用户提交以获得批准。", + "input_schema": { + "type": "object", + "properties": { + "domains": { + "type": "array", + "items": { + "type": "string" + }, + "description": "您将访问的域列表(例如,['github.com', 'stackoverflow.com'])。当用户接受计划时,这些域将在会话中获得批准。" + }, + "approach": { + "type": "array", + "items": { + "type": "string" + }, + "description": "您将遵循的有序步骤列表(例如,['导航到主页', '搜索文档', '提取关键信息'])。要简洁 - 目标是 3-7 个步骤。" + } + }, + "required": [ + "domains", + "approach" + ] + } + }, + { + "name": "upload_image", + "description": "将先前捕获的屏幕截图或用户上传的图像上传到文件输入或拖放目标。支持两种方法:(1) ref - 用于定位特定元素,尤其是隐藏的文件输入,(2) coordinate - 用于拖放到可见位置,如 Google Docs。提供 ref 或 coordinate 之一,不要同时提供两者。", + "input_schema": { + "type": "object", + "properties": { + "imageId": { + "type": "string", + "description": "先前捕获的屏幕截图(来自 computer 工具的 screenshot 操作)或用户上传的图像的 ID" + }, + "ref": { + "type": "string", + "description": "来自 read_page 或 find 工具的元素引用 ID(例如,\"ref_1\"、\"ref_2\")。将此用于文件输入(尤其是隐藏的输入)或特定元素。提供 ref 或 coordinate 之一,不要同时提供两者。" + }, + "coordinate": { + "type": "array", + "items": { + "type": "number" + }, + "description": "用于拖放到可见位置的视口坐标 [x, y]。将此用于拖放目标,如 Google Docs。提供 ref 或 coordinate 之一,不要同时提供两者。" + }, + "tabId": { + "type": "number", + "description": "目标元素所在的标签页 ID。这是图像将上传到的位置。" + }, + "filename": { + "type": "string", + "description": "上传文件的可选文件名(默认:\"image.png\")" + } + }, + "required": [ + "imageId", + "tabId" + ] + } + } + ] \ No newline at end of file