获取配对码
get_pairing_codeGet a pairing code that lets you connect the currently open DingTalk document page in your browser to the bridge. Use it in the page's console to authorize only that page for secure document editing tools.
Instructions
返回把「当前浏览器里已打开的钉钉文档页面」接到本 bridge 所需的配对码(一串字符串数据)。
用法:agent 在目标页面所在的浏览器上下文里执行控制台命令建连——
在该页面(通常是文档 iframe 的 contentWindow)调 await window.__docMcpWsBridge.pair(pairingCode)。
这样只有 agent 点名的那个页面会连上;其它浏览器/标签页不受影响,也不会弹任何 UI。
页面据此与 bridge 完成挑战-响应握手(配对码只用于本地计算 HMAC,明文永不上线)。
重要:本工具只返回数据,绝不返回需要执行的脚本;不要 eval 任何东西。
握手成功后 tools/list 会包含文档工具。页面刷新后由页面用 sessionStorage 里的配对码自动重连,无需再次配对。
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||