Skip to main content
Glama

Detect Device

detect_device

Identify a host's PLC protocol and device type by scanning candidate ports and analyzing probe fingerprints, read-only.

Instructions

设备自动识别: 给定 host 自动扫端口并判定协议 (v0.4, 全程只读)。

流程: 并发扫描候选端口 (缺省 102/502/2000/44818/5007/6000/9600/9601, 单端口连接预算 0.5s) -> 开放端口并发跑四协议 probe 指纹 (单协议 预算 timeout_ms/1000, 缺省 0.8s) -> high 候选按协议做一次最小读 验证 (deep=True 缺省; 成功升级 verified, 失败留痕保持 high; deep=False 跳过验证读)。 只读保证: 全程只发握手帧 + 最小读帧, 不写任何数据; 且识别 ≠ 可访问 —— 例如 S7 PUT/GET 被关闭时识别照样成功, 读 DB 仍可能失败。 返回 DetectResult: candidates 按置信度降序 (同级先验匹配端口优先, next_step 可直接作为 plc_read 调用), unknown_services 为开放但 四协议都不认识的端口 (可用 start_listener 钓帧分析)。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
deepNo
hostYes
portsNo
timeout_msNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
hostYes
candidatesYes
elapsed_msYes
open_portsYes
closed_countYes
scanned_portsYes
unknown_servicesYes
network_assessmentYes

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. First observedv0.4.0

TDQS

A4.1/5.0
Behavior5/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It explicitly states the read-only guarantee, that only handshake and minimal read frames are sent, that no data is written, and that recognition does not imply accessibility. It also details the deep verification behavior and default timing budgets, going well beyond what the schema or annotations could convey.

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 dense and well-structured, with a clear flow from scanning to probing to verification, followed by the read-only guarantee and return semantics. Every sentence contributes useful information, though the length is considerable and could be streamlined for faster consumption.

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?

Given the tool's complexity, the description is highly complete. It covers input semantics, defaults, operational steps, safety guarantees, output ordering, and inter-tool handoffs (e.g., 'next_step' for 'plc_read', 'unknown_services' for 'start_listener'). The presence of an output schema further reduces the need to document return values, making this definition sufficient for an agent to use the tool correctly.

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

Parameters5/5

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

Schema description coverage is 0%, so the description must compensate. It explains the 'deep' parameter's effect (verification read or skip), 'timeout_ms' as a per-protocol budget (timeout_ms/1000 seconds, default 0.8s), 'ports' with a default candidate list, and 'host' as the target. This adds meaningful semantic context and defaults beyond the raw schema types.

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's verb and resource: given a host, it scans ports and determines the protocol ('设备自动识别: 给定 host 自动扫端口并判定协议'). It also describes the output structure and downstream uses. However, it does not explicitly differentiate itself from the sibling tool 'probe_device', which appears semantically similar.

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?

The description explains the operational flow and default behaviors, but it does not specify when to use this tool versus alternatives like 'probe_device' or 'plc_read'. There is no explicit 'when to use' or 'when not to use' guidance, leaving the agent to infer the appropriate invocation context.

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

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/ymxc152/plctap'

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