Skip to main content
Glama

获取配对码

get_pairing_code
Read-only

Get 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

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.2.1

TDQS

A4.6/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Beyond the readOnlyHint annotation, the description discloses substantial behavioral details: no UI is shown, no script is returned, the pairing code is used only locally for HMAC and never sent online, and the page auto-reconnects after refresh using sessionStorage. These details are valuable and not present in the annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured and front-loaded with the tool's purpose, and every sentence adds useful context such as usage, security, and reconnection behavior. It is somewhat lengthy, but the density of practical information justifies the length.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a no-parameter tool with no output schema, the description is complete: it explains what the returned value is, how to use it, what side effects occur, how isolation works, and what happens after page refresh. An agent has enough information to invoke and apply the pairing code correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The tool has zero parameters, so the description cannot add parameter-level detail. It does, however, clarify that the output is a string used as a pairing code for a challenge-response handshake, which gives meaningful semantic context for the return value.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states a specific verb and resource: it returns a pairing code string required to connect an already-open DingTalk document page to the bridge. This clearly distinguishes it from siblings like get_bridge_status, revoke_session, call_page_tool, and list_page_tools, which serve different functions.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description gives explicit usage steps: the agent must run `window.__docMcpWsBridge.pair(pairingCode)` in the target page's console context. It also explains the isolation behavior (only the named page connects) and warns that the tool returns data only, never executable scripts. It does not explicitly name when not to use it versus alternatives, but the context is clear.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.