Skip to main content
Glama
XuChen-AI

ros2-inspector

by XuChen-AI

get_topic_info

Inspect a ROS 2 topic's message type, publisher and subscriber counts, and QoS settings to confirm types or diagnose publish/receive mismatches. Use verbose for endpoint QoS details.

Instructions

获取指定话题的详情:消息类型、发布者数、订阅者数,以及 QoS 配置。

何时用:确认话题类型;排查"发了没人收/收不到"类问题时看双方数量与 QoS。 参数 topic:话题全名,以 / 开头(如 /chatter),大小写敏感; verbose=True 时附带每个端点的 QoS 详情(推荐)。 返回:CLI 原始输出。失败时返回 error(常见:话题不存在)。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
topicYes
verboseNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.1

TDQS

A4.6/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 reasonably well: it discloses the return format ('raw CLI output') and the failure behavior (returns error, commonly when the topic does not exist). It is implicitly a read operation, though permission scope and any performance cost of verbose enumeration are not stated.

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 front-loaded: purpose first, then when-to-use, then parameter notes, then return/error behavior. The labeled sections make it scannable and every sentence adds information an agent needs; no filler.

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?

For a 2-parameter, no-output-schema, no-annotation tool, the definition covers purpose, invocation triggers, parameter formatting, return shape, and the common error case. Nothing required to call it correctly 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 description coverage is 0%, so the description must compensate and it does: topic is specified as the full name beginning with '/' (e.g., /chatter) and explicitly case-sensitive, and verbose is explained as attaching per-endpoint QoS detail with a recommendation to enable it. Both parameters gain semantics not present anywhere in 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?

The description opens with a specific verb+resource and enumerates exactly what is retrieved: message type, publisher count, subscriber count, and QoS. This is clearly distinguishable from siblings like list_topics (enumeration), sample_topic (data sampling), and get_topic_rate (rate measurement). An agent can select it without opening the schema.

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?

The '何时用' section gives concrete when-to-use triggers: confirming a topic's datatype and diagnosing 'published but nobody receives it' scenarios via the publisher/subscriber counts and QoS. It does not name alternatives (e.g., list_topics or sample_topic) or state when not to use it, but the usage context is clear and actionable.

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