Skip to content

Add entity lifecycle status MCP tools (apps + components)#23

Open
bburda wants to merge 1 commit into
mainfrom
feat/lifecycle-status
Open

Add entity lifecycle status MCP tools (apps + components)#23
bburda wants to merge 1 commit into
mainfrom
feat/lifecycle-status

Conversation

@bburda

@bburda bburda commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Summary

Add ros2_medkit_status_get and ros2_medkit_status_set MCP tools (with sovd_status_get / sovd_status_set back-compat aliases), wrapping the gateway 0.6.0 entity lifecycle API. status_get reads the readiness status; status_set triggers 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

  • Bug fix
  • New feature
  • Breaking change
  • Documentation only

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/ - clean
  • ruff format --check src/ tests/ - clean
  • mypy src/ - clean

Checklist

  • Breaking changes are clearly described (none - additive feature)
  • Linting passes (poetry run ruff check src/ tests/)
  • Formatting passes (poetry run ruff format --check src/ tests/)
  • Type checking passes (poetry run mypy src/)
  • Tests pass (poetry run python run_tests.py)
  • Docs were updated if behavior or public API changed (README lifecycle tools section)

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.
Copilot AI review requested due to automatic review settings June 25, 2026 08:14

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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) plus sovd_status_get / sovd_status_set aliases, 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.

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 entity lifecycle status MCP tools (apps + components)

2 participants