ros2_topic_echo
Capture and return messages from a ROS2 topic by specifying its name, type, count, and timeout. Enables remote inspection of ROS2 communications without a local ROS2 installation.
Instructions
Capture and return messages from a ROS2 topic.
Args:
topic: Topic name to listen to (e.g. '/robot/cmd_vel')
topic_type: Message type (e.g. 'geometry_msgs/msg/Twist')
count: Number of messages to capture (default 1)
timeout_sec: Maximum time to wait in seconds
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"topic": "<topic>",
"topic_type": "<topic_type>"
},
"name": "ros2_topic_echo"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| count | No | ||
| topic | Yes | ||
| topic_type | Yes | ||
| timeout_sec | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |