generated from ThalesGroup/template-project
-
Notifications
You must be signed in to change notification settings - Fork 16
Open
Open
Improve OpenSearchOps MCP endpoints for cluster debugging (new routes + better route descriptions)#1237
Feature
Copy link
Description
Summary
OpenSearchOps currently covers basic OpenSearch diagnostics, but it is missing several read-only endpoints that are important for advanced cluster debugging (tasks, recovery, node info, thread pools, cluster settings/state/stats).
Since these routes are exposed via MCP, the OpenAPI route descriptions should also be improved so agents can better understand:
- when to use each endpoint
- differences between similar endpoints (e.g.
pending_tasksvstasks) - which endpoints may return large payloads
Requested Changes
1) Add new read-only endpoints
Add the following routes to OpenSearchOps:
GET /os/cluster/settingsGET /os/cluster/stateGET /os/cluster/statsGET /os/nodes/infoGET /os/nodes/hot_threadsGET /os/tasksGET /os/tasks/{task_id}GET /os/cat/nodesGET /os/cat/allocationGET /os/cat/thread_poolGET /os/recoveryGET /os/index/{index}/recovery
2) Improve MCP/OpenAPI route descriptions
Add detailed description= metadata to OpenSearchOps routes, with:
- debugging use cases
- endpoint selection guidance
- payload-size warnings for heavy endpoints
- explanation of wrapper behavior (especially
/os/allocation/explain)
3) Fix /os/indices bytes parameter handling
Ensure the bytes query parameter is actually passed through (instead of being hardcoded to mb).
4) Add a small helper for query params (optional but recommended)
Introduce a helper (e.g. _build_query_params) to:
- remove
Nonequery params - serialize booleans as
true/falsefor OpenSearch
Constraints
- Keep endpoints read-only
- Keep existing auth/authorization checks (
READ/OPENSEARCH) - Preserve current OpenSearch
TransportErrorhandling pattern - Keep
OpenSearchtag so routes remain exported via MCP
Acceptance Criteria
- New routes are available under the
OpenSearchtag - OpenAPI descriptions are detailed enough for MCP agent usage
/os/indices?bytes=gbreturns values ingb(not alwaysmb)- No write/mutation OpenSearch routes are added
opensearch_controller.pypasses Python syntax validation
Reactions are currently unavailable