get_topic_info
Inspect a single ROS 2 topic to return its effective mode and live publisher QoS reliability and durability, helping diagnose latched topics and QoS mismatches. Read-only.
Instructions
ROS 2 graph only; on a DDS-only setup use list_endpoints. Return info for a single ROS 2 topic. topic must be a fully qualified name, e.g. /cmd_vel. Returns a TopicInfo with mode_effective (live or mock) and, in live mode, the publishers' qos_reliability (reliable / best_effort / mixed) and qos_durability (volatile / transient_local / mixed; transient_local marks a latched topic such as /tf_static). Raises an MCP error if the topic name is malformed, the topic is unknown to the active graph, or no ros2 CLI is available. Read-only; no side effects.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| topic | Yes | Fully qualified ROS2 topic name starting with `/`, e.g. `/cmd_vel` or `/camera/image_raw`. Each `/`-separated segment must start with a letter or underscore and contain only letters, digits, and underscores; everything else (whitespace, quotes, shell metacharacters, `//`, trailing `/`) is rejected before reaching the `ros2` CLI. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | Fully qualified topic name, e.g. `/cmd_vel`. | |
| qos_profile | No | Effective DDS QoS profile for this topic when resolvable. `None` from the ROS2 CLI adapter or when the DDS module is inactive. The DDS module populates this on a best-effort basis (picks one representative endpoint if reader/writer QoS differ). | |
| message_type | Yes | ROS2 message type, e.g. `geometry_msgs/msg/Twist`. | |
| reader_count | No | DDS reader-endpoint count when the active backend can resolve endpoint-level info (Cyclone / Fast DDS). `None` from the ROS2 CLI adapter or when the DDS module is inactive. | |
| writer_count | No | DDS writer-endpoint count when the active backend can resolve endpoint-level info. `None` from the ROS2 CLI adapter or when the DDS module is inactive. | |
| mode_effective | Yes | Runtime mode the adapter served this response in: `live` (real ROS2 introspection) or `mock` (deterministic fixtures). Lets a caller tell a real graph from a demo one without calling `health_check`. | |
| qos_durability | No | Durability announced by the topic's publishers: `volatile`, `transient_local` (late subscribers receive the last samples; typical of latched topics such as `/tf_static`), or `mixed` when publishers disagree. `null` when unknown, with the same rules as `qos_reliability`. | |
| publisher_count | Yes | Publishers known to the graph. | |
| qos_reliability | No | Reliability announced by the topic's publishers: `reliable`, `best_effort`, or `mixed` when publishers disagree. `null` when unknown: the topic has no publisher, or the value was not read (`list_topics` does not read QoS; `get_topic_info` does). | |
| subscriber_count | Yes | Subscribers known to the graph. |