Skip to main content
Glama
LianXia233

router-ssh-mcp

by LianXia233

service_logs

Read-onlyIdempotent

Retrieve recent service logs from OpenWrt or systemd routers by specifying the service name and optional line count, returning the tail output.

Instructions

读取服务日志尾部内容(OpenWrt 走 logread,systemd 走 journalctl)。

参数: name: 服务名 lines: 返回行数,1 <= lines <= ROUTER_MCP_MAX_LOG_LINES(默认 500)

返回结构: {"ok": true, "data": {"name", "requested_lines", "returned_lines", "source", "command", "truncated", "lines": [...] }}

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYes
linesNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.2.0

TDQS

A4.2/5.0
Behavior4/5

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

注释已声明 readOnlyHint=true、idempotentHint=true、destructiveHint=false,安全概况清楚。描述在此基础上补充了执行细节(具体命令 logread/journalctl)和返回结构,包括 'truncated' 字段暗示可能截断,增强了行为透明度。没有与注释矛盾,且为只读工具提供了有用的上下文。

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?

描述简洁且结构清晰:首句概括功能,随后分列参数,最后给出返回结构。无冗余信息,关键约束前置,便于快速理解。

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?

对于简单的只读工具,描述涵盖了调用所需的核心信息:参数意义、返回结构、实现方式。虽有输出模式的定义在描述中而非独立 schema,但足够指导调用。未提及错误情况(如服务不存在)或平台差异的细节,略微不完整,但基于工具复杂度此描述已基本充足。

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?

Schema 覆盖率为 0%,描述完全承担参数解释:为 name 提供含义(服务名),为 lines 提供范围约束和上限说明(1 <= lines <= ROUTER_MCP_MAX_LOG_LINES,默认500)。这远超 Schema 中仅有类型和默认值的信息,有效补偿了 schema 的空白。不过默认值措辞存在一定模糊性(可能指上限默认值而非 lines 默认值),小有扣分。

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?

描述明确说'读取服务日志尾部内容',具体动词+资源,并指出底层实现(OpenWrt logread / systemd journalctl),与兄弟工具(service_status 查看状态、service_start 控制服务)明显区分。这比简单的'查看日志'更为具体,界定了范围。

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?

描述暗示这是获取服务日志的专用工具,但没有明确说明何时使用它而非兄弟工具(如 run_shell 直接执行命令,或 service_status 查看状态)。没有提供使用场景的排除条件或替代说明,因此仅靠隐含语境,未给出明确指引。

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