Skip to main content
Glama
XuChen-AI

ros2-inspector

by XuChen-AI

get_topic_rate

Measure a ROS 2 topic's average publish frequency over a set duration to diagnose slow or stalled data updates. Returns average_rate_hz and raw output for troubleshooting.

Instructions

限时统计话题发布频率:观察 duration_s 秒后返回平均频率。

何时用:排查"数据不更新/更新太慢"类问题——先看频率是否正常。 参数 topic:话题全名(/ 开头);duration_s:1~15 秒,默认 5。 返回:average_rate_hz(平均频率,未统计到时为 None)、raw_tail(原始输出尾部)。 note 字段会说明未统计到频率的原因。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
topicYes
duration_sNo

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 disclose meaningful behavior: the observation window, the None fallback for average_rate_hz when nothing was measured, the raw_tail output, and a note field explaining why a rate was missed. It omits whether it registers a subscriber/load on the system or any permission requirements.

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?

Compact and labeled: purpose, when-to-use, parameters, return values, and failure note. Every sentence adds information and the purpose is front-loaded.

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 simple two-parameter observation tool with no annotations and no output schema, the description covers inputs, the return fields, and the failure mode, leaving nothing an agent needs in order to call it 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 and it does: topic is documented as the full name starting with '/', and duration_s is bounded to 1~15 seconds with a stated default of 5. Both parameters gain meaning that the bare schema lacks.

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: observe a topic for duration_s seconds and return its average publish frequency. It is clearly distinct from siblings like list_topics, get_topic_info, or sample_topic, which enumerate or inspect rather than measure rate over a window.

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 '何时用' line gives an explicit diagnostic scenario: troubleshooting 'data not updating / updating too slowly'. It provides clear context for invocation but names no sibling alternatives or explicit when-not-to-use conditions.

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