Skip to main content
Glama
mayjack0312
by mayjack0312

eda_sys_web_socket_register

Registers a WebSocket connection with optional message and connection callbacks. Enables pre-testing WebSocket connectivity before use, requiring external interaction permission.

Instructions

sys_WebSocket.register(id: string, serviceUri: string, receiveMessageCallFn?: (event: MessageEvent) => void | Promise, connectedCallFn?: () => void | Promise, protocols?: string | Array) -> void 注册 WebSocket 连接 remarks: 可以用来执行前检测 WebSocket 连接是否正常,但需要注意 不要尝试相同 ID 不同参数的连接,这会造成混乱: 如果存在指定 ID 且处于活跃状态中的 WebSocket 连接,那么其余参数的变更将不会被应用

注意:本接口需要使用者启用扩展的外部交互权限,如若未启用将始终 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.7/5.0
Behavior4/5

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

With no annotations, the description carries the behavioral burden. It discloses the permission requirement (external interaction permission) and that it will throw an Error if not enabled. It also warns about the same-ID behavior where parameter changes are ignored if a connection is already active. These are critical behavioral details for safe invocation.

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 a mix of signature and remarks. It's reasonably concise, front-loads the signature, and then gives important caveats. The length is justified by the need to convey the same-ID warning and permission requirement. No filler.

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 description covers the core action, parameters, a key use case (testing connection), the permission requirement, and the same-ID pitfall. It lacks details about callback signatures and protocol usage, but these are standard WebSocket concepts. For a registration tool without an output schema, this is sufficiently complete for an agent to invoke correctly.

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?

The input schema has 100% coverage with 'args' and 'windowId' descriptions, but the 'args' description only states it's a JSON array in signature order. The description provides the full function signature with parameter names and types, which adds some meaning beyond the schema. However, it doesn't explain the purpose of each parameter (e.g., what id represents, how callbacks are used). This is adequate but not deep.

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

Purpose4/5

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

The description clearly states the tool registers a WebSocket connection with specific parameters (id, serviceUri, callbacks, protocols). It names the resource and verb explicitly, and the signature clarifies what the tool does. However, it doesn't explicitly contrast with the sibling close/send tools, relying on the name and context.

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

Usage Guidelines3/5

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

The remarks provide usage context: it can be used to test connection health before execution, and warns against reusing the same ID with different parameters. It doesn't explicitly say 'use this instead of eda_sys_web_socket_close or send', but the purpose is clear. The guidance is helpful but not exhaustive.

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