Skip to main content
Glama

ros2_topic_publish

Publish custom messages to any ROS2 topic from a remote environment. Specify topic, type, and JSON data to send commands or updates to robotics applications without local ROS2 installation.

Instructions

Publish a message to a ROS2 topic.

    Args:
        topic: ROS2 topic name (e.g. '/robot/cmd_vel')
        topic_type: Message type string (e.g. 'geometry_msgs/msg/Twist')
        data: Message content as JSON object/dict
    

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dataYes
topicYes
topic_typeYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

B3.3/5.0
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It simply restates the publish action without explaining whether the call blocks, validates the topic type, returns confirmation, or behaves differently on errors. For a side-effecting tool, this is a notable transparency gap.

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?

The description is short, front-loaded with the purpose, and each line in the Args block adds real value. There is no filler or redundant restatement of the schema.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple three-parameter publish tool, the description covers all required inputs with examples, and the presence of an output schema reduces the need to document return values. It remains light on usage context and runtime behavior, but the essential invocation information is present.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 0% schema description coverage, the Args block provides the necessary meaning for every parameter: topic is a ROS2 topic name, topic_type is a message type string, and data is the JSON object/dict payload. The examples for topic and topic_type are concrete and useful, though data could better explain how fields map to the message type.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states a specific verb and resource, 'Publish a message to a ROS2 topic', which clearly separates this from inspection tools like ros2_get_topics or ros2_topic_echo. It does not explicitly differentiate itself from sibling publishing tools like ros2_mock_publish_sequence, so it falls just short of full distinction.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives. It does not mention that ros2_assert_topic_published is for verification or that ros2_mock_publish_sequence is for publishing sequences, so the agent must infer selection from sibling names alone.

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