Skip to main content
Glama
XuChen-AI

ros2-inspector

by XuChen-AI

sample_topic

Capture up to a specified number of messages from a ROS 2 topic within a timeout, returning raw data to verify field values and message content.

Instructions

限时采样话题内容:抓取最多 max_messages 条消息,或 timeout_s 秒到期即停。

何时用:想看某话题里数据实际长什么样、字段值是否合理。 参数 topic:话题全名(/ 开头);max_messages:150 条,默认 5; timeout_s:115 秒,默认 5。命令一定会在限时内返回,不会挂起。 返回:messages_received(实际条数)、stopped_because (message_limit / timeout / publisher_stopped)、raw(消息原文,未解析)。 采样窗口内无消息时 note 字段会说明(话题可能没有发布者)。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
topicYes
timeout_sNo
max_messagesNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.1

TDQS

A4.5/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does well: it guarantees the command always returns within the limit and '不会挂起' (never hangs), enumerates stopped_because outcomes (message_limit / timeout / publisher_stopped), and notes the no-message case via a note field. It omits auth/permission needs or rate limits, keeping it below 5.

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?

Front-loads the core action in the first sentence, then separates 何时用 / 参数 / 返回 into scannable sections. Reasonably economical, though slightly verbose in restating defaults already present in the schema.

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?

There is no output schema, yet the description documents the return shape (messages_received, stopped_because, raw unparsed payload, and the note field when empty), so an agent can interpret results correctly. Combined with full parameter documentation, nothing essential is missing.

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 coverage is 0%, so the description must compensate, and it does: topic is specified as a fully-qualified name beginning with '/', max_messages as 1–50 with default 5, timeout_s as 1–15 with default 5. All three parameters get concrete ranges and semantics absent from the schema.

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?

States a specific verb+resource ('限时采样话题内容' – sample topic content with a time bound) and an explicit scope (max_messages cap or timeout). This is clearly distinguishable from siblings like get_topic_info or get_topic_rate, which describe metadata rather than actual sampled payloads.

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

Usage Guidelines4/5

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

Explicitly gives the when-to-use context: 'when you want to see what the data in a topic actually looks like and whether field values are reasonable.' It does not name an alternative tool or state when NOT to use it, so it falls short of the 5-level routing guidance.

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