Skip to main content
Glama
mayjack0312
by mayjack0312

eda_sys_web_socket_close

Closes an active WebSocket connection in the EDA window. Specify the connection ID and optional code/reason to terminate it.

Instructions

sys_WebSocket.close(id: string, code?: number, reason?: string, extensionUuid?: string) -> void 关闭 WebSocket 连接 remarks: 注意:本接口需要使用者启用扩展的外部交互权限,如若未启用将始终 throw Error

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
argsNo按官方签名顺序排列的JSON参数数组
windowIdNo目标EDA窗口ID;省略时使用当前活动窗口

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv2.0.0

TDQS

A3.5/5.0
Behavior3/5

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

There are no annotations, so the description carries the burden. It usefully discloses an important auth failure mode (`未启用将始终 throw Error`) and the void return, but it does not explain what happens to the connection state, whether closing is reversible, or how invalid or missing ids are handled.

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?

Three compact lines: the canonical signature, a one-line Chinese purpose statement, and a critical permission caveat. No filler or repeated schema content.

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

Completeness3/5

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

For a simple close operation with no output schema, the description covers the core call and the main prerequisite. However, with no annotations and no explicit lifecycle context or failure semantics beyond the permission error, an agent cannot fully predict behavior in edge cases.

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

Parameters3/5

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

Schema description coverage is 100%, setting the baseline at 3. The signature adds the names, types, and optionality of the arguments inside the opaque `args` array, which the schema alone does not enumerate, but it gives no semantic meaning for `code`, `reason`, or `extensionUuid` beyond their names.

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 gives the exact API signature `sys_WebSocket.close(id, code?, reason?, extensionUuid?)` and states in Chinese that it closes a WebSocket connection (`关闭 WebSocket 连接`). The action is a specific verb plus resource, and it is unambiguous against the closely related sibling tools `eda_sys_web_socket_register` and `eda_sys_web_socket_send`.

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

Usage Guidelines2/5

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

No guidance is given about when to choose this tool over the sibling register/send tools or about the WebSocket lifecycle. The permission warning is a prerequisite, not usage direction, so an agent is left to infer from the name that this is the counterpart to `eda_sys_web_socket_register` and `eda_sys_web_socket_send`.

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

Deploy Server

Other Tools