Add entity lifecycle status MCP tools (apps + components)#23
Open
bburda wants to merge 1 commit into
Open
Conversation
Expose ros2_medkit_status_get/set for apps and components (start, restart, force-restart, shutdown, force-shutdown), with sovd_* back-compat aliases. Wraps the gateway 0.6.0 lifecycle API; rejects other entity types and unknown actions.
There was a problem hiding this comment.
Pull request overview
This PR adds first-class MCP tool support for the ros2_medkit gateway (v0.6.0) entity lifecycle status API, allowing clients to query readiness state and trigger lifecycle transitions for apps and components (with sovd_* aliases preserved for backward compatibility).
Changes:
- Added lifecycle argument models (
LifecycleEntityType,LifecycleAction,StatusGetArgs,StatusSetArgs) to validate entity-type and action inputs. - Added two new MCP tools (
ros2_medkit_status_get,ros2_medkit_status_set) plussovd_status_get/sovd_status_setaliases, wiring dispatch through to the client. - Implemented lifecycle API support in
SovdClient(get_status,set_status) and added corresponding unit tests and README documentation.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
src/ros2_medkit_mcp/client.py |
Adds lifecycle endpoint routing, validation, and get_status/set_status client methods backed by generated lifecycle API functions. |
src/ros2_medkit_mcp/models.py |
Introduces Pydantic argument models/enums for lifecycle status tools with strict validation (apps/components + allowed actions). |
src/ros2_medkit_mcp/mcp_app.py |
Registers the new MCP tools, adds aliases, and dispatches tool calls to the new client lifecycle methods. |
tests/test_new_tools.py |
Adds integration-style client tests for lifecycle GET/PUT behavior and input rejection cases. |
tests/test_mcp_app.py |
Adds unit tests for tool alias resolution and Pydantic validation of lifecycle argument models. |
README.md |
Documents the new lifecycle tools and their arguments/return behavior. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add
ros2_medkit_status_getandros2_medkit_status_setMCP tools (withsovd_status_get/sovd_status_setback-compat aliases), wrapping the gateway 0.6.0 entity lifecycle API.status_getreads the readiness status;status_settriggers a transition (start / restart / force-restart / shutdown / force-shutdown). Restricted to apps and components; other entity types and unknown actions are rejected with a clear error.Issue
Type
Testing
In a worktree branched from
origin/main(post-0.6.0-migration):run_tests.py- 184 passed (168 baseline + 16 new lifecycle/tool/arg-model tests)ruff check src/ tests/- cleanruff format --check src/ tests/- cleanmypy src/- cleanChecklist
poetry run ruff check src/ tests/)poetry run ruff format --check src/ tests/)poetry run mypy src/)poetry run python run_tests.py)