Skip to main content
Glama

mp_diagnoseConnection

Read the current connection status of the target (port listening, devtools online, ws reachable, automator connected) without modifying environment. Use to diagnose connectivity issues without triggering reconnection or IDE launch.

Instructions

只读探测当前连接目标的状态(port 是否监听、devtools 是否在线、ws 是否可达、automator 是否已连),不启动 IDE、不重连、不改任何项目状态。

何时用:只想拿一份不改动现状的连接快照时(如用户问“为什么连不上”但不想动环境),或在 mp_ensureConnection / mp_recoverConnection 已失败后,用本工具读细节辅助判断。 何时不用:想“把连接弄通”时不要先调本工具——直接调 mp_ensureConnection,它会自愈/自动拉起 IDE,并在返回里自带一份 diagnosis。

⚠️ 本工具是保守设计:它如实报告 “port not listening / automation not enabled” 等,但不会修复。这种红色结果不是死路、也不需要找用户确认——下一步就是调 mp_ensureConnection 让它自动拉起/重连。

返回 JSON 含各探测项的布尔/状态字段;红色项只代表“当前未就绪”,不代表无法恢复。connection 可选,传入可临时覆盖 projectPath / wsEndpoint / mode / port 等连接参数,省略则用已配置的默认值。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
connectionNo可选连接覆盖(不传则用默认会话)。可用字段:mode(launch|connect)、cliPath、projectPath、wsEndpoint、timeout、port(【自动化端口】→ cli auto --auto-port,默认 9420;不是 IDE HTTP 服务端口,别把 IDE 服务端口传进来)、account、ticket、trustProject、args、cwd、autoClose、autoLaunch、launchTimeout、connectTimeout。
Behavior5/5

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

Without annotations, the description fully discloses behavior: does not modify state, does not start IDE, does not reconnect. Explains that red results are non-fatal and provides context for interpretation.

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?

Well-structured with sections: purpose, usage guidelines, warnings, return details. Every sentence adds unique value without redundancy.

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?

Despite no output schema, the description adequately describes return as JSON with boolean/status fields. Parameter description is thorough. Slightly more detail on output structure could improve completeness.

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 only parameter 'connection' is fully described in schema, but the tool description adds valuable context: overridable fields, port meaning, and warning about IDE service port confusion.

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 it is a read-only diagnostic tool that probes connection status (port, devtools, ws, automator). It explicitly distinguishes from siblings like mp_ensureConnection, which is used to fix connections.

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

Usage Guidelines5/5

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

Provides explicit guidance on when to use (snapshot, after failures) and when not to use (when fixing is needed, direct to mp_ensureConnection). Also clarifies that red results are not dead ends and next steps.

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/Chaixueyuan/weapp-agent-mcp'

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