Skip to main content
Glama

ruyi_websocket_inject

Inject a WebSocket proxy to capture send/receive messages from new WebSocket connections, recording them to window.__ruyi_ws_messages. Only captures connections created after injection.

Instructions

注入 WebSocket Proxy 以捕获后续 WebSocket 连接的消息。注入后,新创建的 WebSocket 连接的 send/receive 消息会记录到 window.__ruyi_ws_messages。⚠ 只能捕获注入后创建的 WebSocket 连接。binary 帧以 "[binary]" 标记。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pageIdxNo
Behavior4/5

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

With no annotations provided, the description carries full burden. It discloses key behavioral traits: the injection effect, the limitation to post-injection connections, the storage location (window.__ruyi_ws_messages), and the binary-frame marker. It does not explain how to stop the injection or any side effects on the page, but the disclosed information is substantial and non-contradictory.

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

Conciseness5/5

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

The description is concise and front-loaded. The first sentence states the main action, the second explains the effect, and the warning follows. Every sentence adds value without repetition, and the warning is highlighted appropriately.

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

Completeness4/5

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

The tool is relatively simple (one optional param, no output schema), and the description covers the core behavior well—what it does, what it captures, and where messages are stored. Missing elements include parameter semantics and explicit side-effect/reversal guidance, but overall the description is sufficient for basic usage.

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

Parameters2/5

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

The schema has one parameter (pageIdx) with 0% coverage in the description. The description does not mention pageIdx at all, leaving the agent to infer that it selects the page. For a tool with a single optional parameter, this is a notable gap; the description should at least indicate that pageIdx designates which page to inject into.

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 clearly states the tool's function: injecting a WebSocket proxy to capture messages from subsequent WebSocket connections. It specifies the injectable resource (WebSocket Proxy), the action (inject), and the outcome (messages recorded to window.__ruyi_ws_messages). This distinguishes it from sibling tools like ruyi_get_websocket_messages (which retrieves messages) and ruyi_capture_start (which captures network requests).

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 provides clear context on when to use the tool: before creating WebSocket connections, and explicitly warns that only connections created after injection are captured. However, it does not explicitly mention alternatives or when not to use it, though the sibling ruyi_get_websocket_messages implies a complementary retrieval step.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Facetomyself/ruyi-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server