Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ classifiers = [
]

dependencies = [
# Floor bumped to 0.1.3 because mcp-server depends on the strict error
# taxonomy (DevhelmValidationError / DevhelmApiError / DevhelmTransportError)
# and `extra='forbid'` response validation introduced in that release.
"devhelm>=0.2.0",
# Floor bumped to 0.2.1 for `StatusPages.reorder_layout` and the
# `Incidents.delete` removal (which the `reorder_status_page_layout`
# tool below depends on, and which the parity check requires).
"devhelm>=0.2.1",
"fastmcp>=2.0.0",
]

Expand Down Expand Up @@ -64,4 +64,4 @@ dev = [
"pytest>=8.0",
"ruff>=0.8",
"twine>=5.0",
]
]
24 changes: 24 additions & 0 deletions src/devhelm_mcp/tools/status_pages.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
CreateStatusPageIncidentUpdateRequest,
CreateStatusPageRequest,
ReorderComponentsRequest,
ReorderPageLayoutRequest,
UpdateStatusPageComponentGroupRequest,
UpdateStatusPageComponentRequest,
UpdateStatusPageIncidentRequest,
Expand Down Expand Up @@ -85,6 +86,29 @@ def delete_status_page(api_token: str, page_id: str) -> str:
except DevhelmError as e:
return format_error(e)

@mcp.tool()
def reorder_status_page_layout(
api_token: str, page_id: str, body: ReorderPageLayoutRequest
) -> str:
"""Batch-reorder a status page's full layout.

Required: sections — top-level layout in their new order, where each
entry is either {kind:"component", componentId} or
{kind:"group", groupId}. Use ``groupOrders`` (optional) to also
reorder components within specific groups; only include groups whose
internal order changed. The full top-level set must be provided —
partial reorders are rejected by the API.

Use this for "drag-and-drop" layout edits that touch both groups and
ungrouped components. To reorder components within a single group
only, prefer ``reorder_status_page_components``.
"""
try:
_sp(api_token).reorder_layout(page_id, as_payload(body))
return "Status page layout reordered successfully."
except DevhelmError as e:
return format_error(e)

# ── Components ────────────────────────────────────────────────────────

@mcp.tool()
Expand Down
2 changes: 2 additions & 0 deletions tests/test_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@
"create_status_page",
"update_status_page",
"delete_status_page",
"reorder_status_page_layout",
"list_status_page_components",
"create_status_page_component",
"update_status_page_component",
Expand Down Expand Up @@ -157,6 +158,7 @@ def test_tool_count(self, registered_tools: RegisteredTools) -> None:
"create_status_page",
"update_status_page",
"delete_status_page",
"reorder_status_page_layout",
]

STATUS_PAGE_COMPONENT_TOOLS = [
Expand Down
10 changes: 5 additions & 5 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading