Skip to content

Conversation

stex2005
Copy link
Contributor

@stex2005 stex2005 commented Oct 1, 2025

Overview

This PR introduces comprehensive ROS action management tools to the MCP server, enabling full control over ROS 2 actions including discovery, execution, and cancellation.

Features Added

1. Action Tools

  • get_actions() - List all available ROS actions
  • get_action_type(action) - Get the message type for a specific action
  • get_action_details(action_type) - Get complete action structure (goal, result, feedback)
  • get_action_status(action_name) - Get status of active actions (ongoing, completed, aborted)
  • inspect_all_actions() - Comprehensive action information
  • send_action_goal(action_name, action_type, goal, timeout) - Send action goals with timeout support
  • cancel_action_goal(action_name, goal_id) - Cancel running action goals

Key Features

1. Timeout Support

  • Configurable timeouts for action execution
  • Graceful handling of timeout scenarios (return action_feedback when available).
  • Partial progress tracking during long-running actions (no action_feedback progress yet.)

2. Goal ID Management

  • Automatic generation of unique goal IDs
  • Proper goal ID tracking for cancellation
  • Support for multiple concurrent actions (no get_active_actions yet).

3. Error Handling

  • Comprehensive input validation
  • Clear error messages for common issues
  • Return last action_feedback if action_result timeouts.

Test Instructions

  • Run the MCP server (stdio,http,pip)
  • Run a test node ros2 run action_tutorials_cpp fibonacci_action_server
  • Prompt What are the available actions, including type and details?
  • Prompt Start the fibonacci action, with order 5 and timeout 10 and look for progress bar (Cursor UI)
  • Prompt What's the status of the station?
  • Prompt Start the fibonacci action, with order 20 and timeout 2
  • Prompt Cancel the fibonacci action
  • Try again the Prompt Start action without launching the server
  • Report if you find errors, such as Error calling tool 'get_actions': 'str' object has no attribute 'get'

Future Enhancements

  • Send Action Goal
  • Cancel Action Goal
  • Action feedback monitoring
  • Action status monitoring
  • Tested with Fibonacci
  • Tested with Turtlesim

progress_turtlesim

Related Issues

Ready for Review ✅

- Be blocking and waiting for action_result or timeout.
- Return action_result when action is completed.
- Return the last action_feedback, if available, when timeout.
- Return timeout/success:false if no action_feedback or action_result is detected.
- Fixed bug with timeout input tools (no Optional)
@stex2005 stex2005 force-pushed the feature/sdg/ros2-actions branch from ea6e9a2 to bf2dd8b Compare October 2, 2025 17:29
@stex2005 stex2005 requested a review from mokcontoro October 2, 2025 18:41
@stex2005 stex2005 force-pushed the feature/sdg/ros2-actions branch from ee0ffc6 to 6cae439 Compare October 2, 2025 18:47
@stex2005
Copy link
Contributor Author

stex2005 commented Oct 2, 2025

Ready for Review ✅

@rjohn-v @mokcontoro

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add simple streaming tool in FastMCP during tools usage Support for ROS Actions
1 participant