rootly-mcp-server 2.0.13__tar.gz → 2.0.15__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {rootly_mcp_server-2.0.13 → rootly_mcp_server-2.0.15}/PKG-INFO +125 -44
- {rootly_mcp_server-2.0.13 → rootly_mcp_server-2.0.15}/README.md +124 -43
- {rootly_mcp_server-2.0.13 → rootly_mcp_server-2.0.15}/pyproject.toml +1 -1
- rootly_mcp_server-2.0.15/scripts/setup-hooks.sh +66 -0
- rootly_mcp_server-2.0.15/src/rootly_mcp_server/server.py +2181 -0
- rootly_mcp_server-2.0.15/src/rootly_mcp_server/texttest.json +3178 -0
- {rootly_mcp_server-2.0.13 → rootly_mcp_server-2.0.15}/tests/integration/local/test_smart_tools.py +134 -1
- rootly_mcp_server-2.0.15/tests/unit/test_oncall_handoff.py +70 -0
- rootly_mcp_server-2.0.15/tests/unit/test_oncall_metrics.py +344 -0
- {rootly_mcp_server-2.0.13 → rootly_mcp_server-2.0.15}/tests/unit/test_tools.py +12 -3
- {rootly_mcp_server-2.0.13 → rootly_mcp_server-2.0.15}/uv.lock +1 -1
- rootly_mcp_server-2.0.13/src/rootly_mcp_server/server.py +0 -1072
- {rootly_mcp_server-2.0.13 → rootly_mcp_server-2.0.15}/.github/workflows/pypi-release.yml +0 -0
- {rootly_mcp_server-2.0.13 → rootly_mcp_server-2.0.15}/.github/workflows/test.yml +0 -0
- {rootly_mcp_server-2.0.13 → rootly_mcp_server-2.0.15}/.gitignore +0 -0
- {rootly_mcp_server-2.0.13 → rootly_mcp_server-2.0.15}/.semaphore/deploy.yml +0 -0
- {rootly_mcp_server-2.0.13 → rootly_mcp_server-2.0.15}/.semaphore/semaphore.yml +0 -0
- {rootly_mcp_server-2.0.13 → rootly_mcp_server-2.0.15}/.semaphore/update-task-definition.sh +0 -0
- {rootly_mcp_server-2.0.13 → rootly_mcp_server-2.0.15}/Dockerfile +0 -0
- {rootly_mcp_server-2.0.13 → rootly_mcp_server-2.0.15}/LICENSE +0 -0
- {rootly_mcp_server-2.0.13 → rootly_mcp_server-2.0.15}/rootly-mcp-server-demo.gif +0 -0
- {rootly_mcp_server-2.0.13 → rootly_mcp_server-2.0.15}/rootly_openapi.json +0 -0
- {rootly_mcp_server-2.0.13 → rootly_mcp_server-2.0.15}/src/rootly_mcp_server/__init__.py +0 -0
- {rootly_mcp_server-2.0.13 → rootly_mcp_server-2.0.15}/src/rootly_mcp_server/__main__.py +0 -0
- {rootly_mcp_server-2.0.13 → rootly_mcp_server-2.0.15}/src/rootly_mcp_server/client.py +0 -0
- {rootly_mcp_server-2.0.13 → rootly_mcp_server-2.0.15}/src/rootly_mcp_server/data/__init__.py +0 -0
- {rootly_mcp_server-2.0.13 → rootly_mcp_server-2.0.15}/src/rootly_mcp_server/smart_utils.py +0 -0
- {rootly_mcp_server-2.0.13 → rootly_mcp_server-2.0.15}/src/rootly_mcp_server/utils.py +0 -0
- {rootly_mcp_server-2.0.13 → rootly_mcp_server-2.0.15}/tests/README.md +0 -0
- {rootly_mcp_server-2.0.13 → rootly_mcp_server-2.0.15}/tests/conftest.py +0 -0
- {rootly_mcp_server-2.0.13 → rootly_mcp_server-2.0.15}/tests/integration/local/test_basic.py +0 -0
- {rootly_mcp_server-2.0.13 → rootly_mcp_server-2.0.15}/tests/integration/remote/test_essential.py +0 -0
- {rootly_mcp_server-2.0.13 → rootly_mcp_server-2.0.15}/tests/test_client.py +0 -0
- {rootly_mcp_server-2.0.13 → rootly_mcp_server-2.0.15}/tests/unit/test_authentication.py +0 -0
- {rootly_mcp_server-2.0.13 → rootly_mcp_server-2.0.15}/tests/unit/test_server.py +0 -0
- {rootly_mcp_server-2.0.13 → rootly_mcp_server-2.0.15}/tests/unit/test_smart_utils.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: rootly-mcp-server
|
|
3
|
-
Version: 2.0.
|
|
3
|
+
Version: 2.0.15
|
|
4
4
|
Summary: A Model Context Protocol server for Rootly APIs using OpenAPI spec
|
|
5
5
|
Project-URL: Homepage, https://github.com/Rootly-AI-Labs/Rootly-MCP-server
|
|
6
6
|
Project-URL: Issues, https://github.com/Rootly-AI-Labs/Rootly-MCP-server/issues
|
|
@@ -28,6 +28,10 @@ Description-Content-Type: text/markdown
|
|
|
28
28
|
|
|
29
29
|
# Rootly MCP Server
|
|
30
30
|
|
|
31
|
+
[](https://pypi.org/project/rootly-mcp-server/)
|
|
32
|
+
[](https://pypi.org/project/rootly-mcp-server/)
|
|
33
|
+
[](https://pypi.org/project/rootly-mcp-server/)
|
|
34
|
+
|
|
31
35
|
An MCP server for the [Rootly API](https://docs.rootly.com/api-reference/overview) that integrates seamlessly with MCP-compatible editors like Cursor, Windsurf, and Claude. Resolve production incidents in under a minute without leaving your IDE.
|
|
32
36
|
|
|
33
37
|
[](https://cursor.com/install-mcp?name=rootly&config=eyJjb21tYW5kIjoibnB4IC15IG1jcC1yZW1vdGUgaHR0cHM6Ly9tY3Aucm9vdGx5LmNvbS9zc2UgLS1oZWFkZXIgQXV0aG9yaXphdGlvbjoke1JPT1RMWV9BVVRIX0hFQURFUn0iLCJlbnYiOnsiUk9PVExZX0FVVEhfSEVBREVSIjoiQmVhcmVyIDxZT1VSX1JPT1RMWV9BUElfVE9LRU4%2BIn19)
|
|
@@ -59,7 +63,7 @@ Configure your MCP-compatible editor (tested with Cursor) with one of the config
|
|
|
59
63
|
"run",
|
|
60
64
|
"--from",
|
|
61
65
|
"rootly-mcp-server",
|
|
62
|
-
"rootly-mcp-server"
|
|
66
|
+
"rootly-mcp-server"
|
|
63
67
|
],
|
|
64
68
|
"env": {
|
|
65
69
|
"ROOTLY_API_TOKEN": "<YOUR_ROOTLY_API_TOKEN>"
|
|
@@ -79,7 +83,7 @@ Configure your MCP-compatible editor (tested with Cursor) with one of the config
|
|
|
79
83
|
"args": [
|
|
80
84
|
"--from",
|
|
81
85
|
"rootly-mcp-server",
|
|
82
|
-
"rootly-mcp-server"
|
|
86
|
+
"rootly-mcp-server"
|
|
83
87
|
],
|
|
84
88
|
"env": {
|
|
85
89
|
"ROOTLY_API_TOKEN": "<YOUR_ROOTLY_API_TOKEN>"
|
|
@@ -139,46 +143,60 @@ Alternatively, connect directly to our hosted MCP server:
|
|
|
139
143
|
- **Dynamic Tool Generation**: Automatically creates MCP resources from Rootly's OpenAPI (Swagger) specification
|
|
140
144
|
- **Smart Pagination**: Defaults to 10 items per request for incident endpoints to prevent context window overflow
|
|
141
145
|
- **API Filtering**: Limits exposed API endpoints for security and performance
|
|
142
|
-
- **
|
|
143
|
-
- **`find_related_incidents`**: Uses TF-IDF similarity analysis to find historically similar incidents
|
|
146
|
+
- **Intelligent Incident Analysis**: Smart tools that analyze historical incident data
|
|
147
|
+
- **`find_related_incidents`**: Uses TF-IDF similarity analysis to find historically similar incidents
|
|
144
148
|
- **`suggest_solutions`**: Mines past incident resolutions to recommend actionable solutions
|
|
145
149
|
- **MCP Resources**: Exposes incident and team data as structured resources for easy AI reference
|
|
146
150
|
- **Intelligent Pattern Recognition**: Automatically identifies services, error types, and resolution patterns
|
|
147
151
|
|
|
148
|
-
###
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
152
|
+
### Available Tools
|
|
153
|
+
|
|
154
|
+
**Alerts**
|
|
155
|
+
- `listIncidentAlerts`
|
|
156
|
+
- `listAlerts`
|
|
157
|
+
- `attachAlert`
|
|
158
|
+
- `createAlert`
|
|
159
|
+
|
|
160
|
+
**Environments**
|
|
161
|
+
- `listEnvironments`
|
|
162
|
+
- `createEnvironment`
|
|
163
|
+
|
|
164
|
+
**Functionalities**
|
|
165
|
+
- `listFunctionalities`
|
|
166
|
+
- `createFunctionality`
|
|
167
|
+
|
|
168
|
+
**Workflows**
|
|
169
|
+
- `listWorkflows`
|
|
170
|
+
- `createWorkflow`
|
|
171
|
+
|
|
172
|
+
**Incidents**
|
|
173
|
+
- `listIncidentActionItems`
|
|
174
|
+
- `createIncidentActionItem`
|
|
175
|
+
- `listIncident_Types`
|
|
176
|
+
- `createIncidentType`
|
|
177
|
+
- `search_incidents`
|
|
178
|
+
- `find_related_incidents`
|
|
179
|
+
- `suggest_solutions`
|
|
180
|
+
|
|
181
|
+
**On-Call**
|
|
182
|
+
- `get_oncall_shift_metrics`
|
|
183
|
+
- `get_oncall_handoff_summary`
|
|
184
|
+
- `get_shift_incidents`
|
|
185
|
+
|
|
186
|
+
**Services & Severities**
|
|
187
|
+
- `listServices`
|
|
188
|
+
- `createService`
|
|
189
|
+
- `listSeverities`
|
|
190
|
+
- `createSeverity`
|
|
191
|
+
|
|
192
|
+
**Teams & Users**
|
|
193
|
+
- `listTeams`
|
|
194
|
+
- `createTeam`
|
|
195
|
+
- `listUsers`
|
|
196
|
+
- `getCurrentUser`
|
|
197
|
+
|
|
198
|
+
**Meta**
|
|
199
|
+
- `list_endpoints`
|
|
182
200
|
|
|
183
201
|
### Why Path Limiting?
|
|
184
202
|
|
|
@@ -189,14 +207,14 @@ We limit exposed API paths for two key reasons:
|
|
|
189
207
|
|
|
190
208
|
To expose additional paths, modify the `allowed_paths` variable in `src/rootly_mcp_server/server.py`.
|
|
191
209
|
|
|
192
|
-
###
|
|
210
|
+
### Smart Analysis Tools
|
|
193
211
|
|
|
194
212
|
The MCP server includes intelligent tools that analyze historical incident data to provide actionable insights:
|
|
195
213
|
|
|
196
214
|
#### `find_related_incidents`
|
|
197
|
-
Finds historically similar incidents using
|
|
215
|
+
Finds historically similar incidents using text similarity analysis:
|
|
198
216
|
```
|
|
199
|
-
find_related_incidents(incident_id="12345", similarity_threshold=0.
|
|
217
|
+
find_related_incidents(incident_id="12345", similarity_threshold=0.15, max_results=5)
|
|
200
218
|
```
|
|
201
219
|
- **Input**: Incident ID, similarity threshold (0.0-1.0), max results
|
|
202
220
|
- **Output**: Similar incidents with confidence scores, matched services, and resolution times
|
|
@@ -211,7 +229,7 @@ suggest_solutions(incident_title="Payment API errors", incident_description="Use
|
|
|
211
229
|
```
|
|
212
230
|
- **Input**: Either incident ID OR title/description text
|
|
213
231
|
- **Output**: Actionable solution recommendations with confidence scores and time estimates
|
|
214
|
-
- **Use Case**: Get
|
|
232
|
+
- **Use Case**: Get intelligent suggestions based on successful past resolutions
|
|
215
233
|
|
|
216
234
|
#### How It Works
|
|
217
235
|
- **Text Similarity**: Uses TF-IDF vectorization and cosine similarity (scikit-learn)
|
|
@@ -228,6 +246,56 @@ For optimal results, ensure your Rootly incidents have descriptive:
|
|
|
228
246
|
|
|
229
247
|
Example good resolution summary: `"Restarted auth-service, cleared Redis cache, and increased connection pool from 10 to 50"`
|
|
230
248
|
|
|
249
|
+
### On-Call Shift Metrics
|
|
250
|
+
|
|
251
|
+
Get on-call shift metrics for any time period, grouped by user, team, or schedule. Includes primary/secondary role tracking, shift counts, hours, and days on-call.
|
|
252
|
+
|
|
253
|
+
```
|
|
254
|
+
get_oncall_shift_metrics(
|
|
255
|
+
start_date="2025-10-01",
|
|
256
|
+
end_date="2025-10-31",
|
|
257
|
+
group_by="user"
|
|
258
|
+
)
|
|
259
|
+
```
|
|
260
|
+
|
|
261
|
+
### On-Call Handoff Summary
|
|
262
|
+
|
|
263
|
+
Complete handoff: current/next on-call + incidents during shifts.
|
|
264
|
+
|
|
265
|
+
```python
|
|
266
|
+
# All on-call (any timezone)
|
|
267
|
+
get_oncall_handoff_summary(
|
|
268
|
+
team_ids="team-1,team-2",
|
|
269
|
+
timezone="America/Los_Angeles"
|
|
270
|
+
)
|
|
271
|
+
|
|
272
|
+
# Regional filter - only show APAC on-call during APAC business hours
|
|
273
|
+
get_oncall_handoff_summary(
|
|
274
|
+
timezone="Asia/Tokyo",
|
|
275
|
+
filter_by_region=True
|
|
276
|
+
)
|
|
277
|
+
```
|
|
278
|
+
|
|
279
|
+
Regional filtering shows only people on-call during business hours (9am-5pm) in the specified timezone.
|
|
280
|
+
|
|
281
|
+
Returns: `schedules` with `current_oncall`, `next_oncall`, and `shift_incidents`
|
|
282
|
+
|
|
283
|
+
### Shift Incidents
|
|
284
|
+
|
|
285
|
+
Incidents during a time period, with filtering by severity/status/tags.
|
|
286
|
+
|
|
287
|
+
```python
|
|
288
|
+
get_shift_incidents(
|
|
289
|
+
start_time="2025-10-20T09:00:00Z",
|
|
290
|
+
end_time="2025-10-20T17:00:00Z",
|
|
291
|
+
severity="critical", # optional
|
|
292
|
+
status="resolved", # optional
|
|
293
|
+
tags="database,api" # optional
|
|
294
|
+
)
|
|
295
|
+
```
|
|
296
|
+
|
|
297
|
+
Returns: `incidents` list + `summary` (counts, avg resolution time, grouping)
|
|
298
|
+
|
|
231
299
|
## About Rootly AI Labs
|
|
232
300
|
|
|
233
301
|
This project was developed by [Rootly AI Labs](https://labs.rootly.ai/), where we're building the future of system reliability and operational excellence. As an open-source incubator, we share ideas, experiment, and rapidly prototype solutions that benefit the entire community.
|
|
@@ -261,7 +329,20 @@ To add new dependencies during development:
|
|
|
261
329
|
uv pip install <package>
|
|
262
330
|
```
|
|
263
331
|
|
|
264
|
-
### 3.
|
|
332
|
+
### 3. Set Up Git Hooks (Recommended for Contributors)
|
|
333
|
+
|
|
334
|
+
Install pre-commit hooks to automatically run linting and tests before commits:
|
|
335
|
+
|
|
336
|
+
```bash
|
|
337
|
+
./scripts/setup-hooks.sh
|
|
338
|
+
```
|
|
339
|
+
|
|
340
|
+
This ensures code quality by running:
|
|
341
|
+
- Ruff linting
|
|
342
|
+
- Pyright type checking
|
|
343
|
+
- Unit tests
|
|
344
|
+
|
|
345
|
+
### 4. Verify Installation
|
|
265
346
|
|
|
266
347
|
The server should now be ready to use with your MCP-compatible editor.
|
|
267
348
|
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
# Rootly MCP Server
|
|
2
2
|
|
|
3
|
+
[](https://pypi.org/project/rootly-mcp-server/)
|
|
4
|
+
[](https://pypi.org/project/rootly-mcp-server/)
|
|
5
|
+
[](https://pypi.org/project/rootly-mcp-server/)
|
|
6
|
+
|
|
3
7
|
An MCP server for the [Rootly API](https://docs.rootly.com/api-reference/overview) that integrates seamlessly with MCP-compatible editors like Cursor, Windsurf, and Claude. Resolve production incidents in under a minute without leaving your IDE.
|
|
4
8
|
|
|
5
9
|
[](https://cursor.com/install-mcp?name=rootly&config=eyJjb21tYW5kIjoibnB4IC15IG1jcC1yZW1vdGUgaHR0cHM6Ly9tY3Aucm9vdGx5LmNvbS9zc2UgLS1oZWFkZXIgQXV0aG9yaXphdGlvbjoke1JPT1RMWV9BVVRIX0hFQURFUn0iLCJlbnYiOnsiUk9PVExZX0FVVEhfSEVBREVSIjoiQmVhcmVyIDxZT1VSX1JPT1RMWV9BUElfVE9LRU4%2BIn19)
|
|
@@ -31,7 +35,7 @@ Configure your MCP-compatible editor (tested with Cursor) with one of the config
|
|
|
31
35
|
"run",
|
|
32
36
|
"--from",
|
|
33
37
|
"rootly-mcp-server",
|
|
34
|
-
"rootly-mcp-server"
|
|
38
|
+
"rootly-mcp-server"
|
|
35
39
|
],
|
|
36
40
|
"env": {
|
|
37
41
|
"ROOTLY_API_TOKEN": "<YOUR_ROOTLY_API_TOKEN>"
|
|
@@ -51,7 +55,7 @@ Configure your MCP-compatible editor (tested with Cursor) with one of the config
|
|
|
51
55
|
"args": [
|
|
52
56
|
"--from",
|
|
53
57
|
"rootly-mcp-server",
|
|
54
|
-
"rootly-mcp-server"
|
|
58
|
+
"rootly-mcp-server"
|
|
55
59
|
],
|
|
56
60
|
"env": {
|
|
57
61
|
"ROOTLY_API_TOKEN": "<YOUR_ROOTLY_API_TOKEN>"
|
|
@@ -111,46 +115,60 @@ Alternatively, connect directly to our hosted MCP server:
|
|
|
111
115
|
- **Dynamic Tool Generation**: Automatically creates MCP resources from Rootly's OpenAPI (Swagger) specification
|
|
112
116
|
- **Smart Pagination**: Defaults to 10 items per request for incident endpoints to prevent context window overflow
|
|
113
117
|
- **API Filtering**: Limits exposed API endpoints for security and performance
|
|
114
|
-
- **
|
|
115
|
-
- **`find_related_incidents`**: Uses TF-IDF similarity analysis to find historically similar incidents
|
|
118
|
+
- **Intelligent Incident Analysis**: Smart tools that analyze historical incident data
|
|
119
|
+
- **`find_related_incidents`**: Uses TF-IDF similarity analysis to find historically similar incidents
|
|
116
120
|
- **`suggest_solutions`**: Mines past incident resolutions to recommend actionable solutions
|
|
117
121
|
- **MCP Resources**: Exposes incident and team data as structured resources for easy AI reference
|
|
118
122
|
- **Intelligent Pattern Recognition**: Automatically identifies services, error types, and resolution patterns
|
|
119
123
|
|
|
120
|
-
###
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
124
|
+
### Available Tools
|
|
125
|
+
|
|
126
|
+
**Alerts**
|
|
127
|
+
- `listIncidentAlerts`
|
|
128
|
+
- `listAlerts`
|
|
129
|
+
- `attachAlert`
|
|
130
|
+
- `createAlert`
|
|
131
|
+
|
|
132
|
+
**Environments**
|
|
133
|
+
- `listEnvironments`
|
|
134
|
+
- `createEnvironment`
|
|
135
|
+
|
|
136
|
+
**Functionalities**
|
|
137
|
+
- `listFunctionalities`
|
|
138
|
+
- `createFunctionality`
|
|
139
|
+
|
|
140
|
+
**Workflows**
|
|
141
|
+
- `listWorkflows`
|
|
142
|
+
- `createWorkflow`
|
|
143
|
+
|
|
144
|
+
**Incidents**
|
|
145
|
+
- `listIncidentActionItems`
|
|
146
|
+
- `createIncidentActionItem`
|
|
147
|
+
- `listIncident_Types`
|
|
148
|
+
- `createIncidentType`
|
|
149
|
+
- `search_incidents`
|
|
150
|
+
- `find_related_incidents`
|
|
151
|
+
- `suggest_solutions`
|
|
152
|
+
|
|
153
|
+
**On-Call**
|
|
154
|
+
- `get_oncall_shift_metrics`
|
|
155
|
+
- `get_oncall_handoff_summary`
|
|
156
|
+
- `get_shift_incidents`
|
|
157
|
+
|
|
158
|
+
**Services & Severities**
|
|
159
|
+
- `listServices`
|
|
160
|
+
- `createService`
|
|
161
|
+
- `listSeverities`
|
|
162
|
+
- `createSeverity`
|
|
163
|
+
|
|
164
|
+
**Teams & Users**
|
|
165
|
+
- `listTeams`
|
|
166
|
+
- `createTeam`
|
|
167
|
+
- `listUsers`
|
|
168
|
+
- `getCurrentUser`
|
|
169
|
+
|
|
170
|
+
**Meta**
|
|
171
|
+
- `list_endpoints`
|
|
154
172
|
|
|
155
173
|
### Why Path Limiting?
|
|
156
174
|
|
|
@@ -161,14 +179,14 @@ We limit exposed API paths for two key reasons:
|
|
|
161
179
|
|
|
162
180
|
To expose additional paths, modify the `allowed_paths` variable in `src/rootly_mcp_server/server.py`.
|
|
163
181
|
|
|
164
|
-
###
|
|
182
|
+
### Smart Analysis Tools
|
|
165
183
|
|
|
166
184
|
The MCP server includes intelligent tools that analyze historical incident data to provide actionable insights:
|
|
167
185
|
|
|
168
186
|
#### `find_related_incidents`
|
|
169
|
-
Finds historically similar incidents using
|
|
187
|
+
Finds historically similar incidents using text similarity analysis:
|
|
170
188
|
```
|
|
171
|
-
find_related_incidents(incident_id="12345", similarity_threshold=0.
|
|
189
|
+
find_related_incidents(incident_id="12345", similarity_threshold=0.15, max_results=5)
|
|
172
190
|
```
|
|
173
191
|
- **Input**: Incident ID, similarity threshold (0.0-1.0), max results
|
|
174
192
|
- **Output**: Similar incidents with confidence scores, matched services, and resolution times
|
|
@@ -183,7 +201,7 @@ suggest_solutions(incident_title="Payment API errors", incident_description="Use
|
|
|
183
201
|
```
|
|
184
202
|
- **Input**: Either incident ID OR title/description text
|
|
185
203
|
- **Output**: Actionable solution recommendations with confidence scores and time estimates
|
|
186
|
-
- **Use Case**: Get
|
|
204
|
+
- **Use Case**: Get intelligent suggestions based on successful past resolutions
|
|
187
205
|
|
|
188
206
|
#### How It Works
|
|
189
207
|
- **Text Similarity**: Uses TF-IDF vectorization and cosine similarity (scikit-learn)
|
|
@@ -200,6 +218,56 @@ For optimal results, ensure your Rootly incidents have descriptive:
|
|
|
200
218
|
|
|
201
219
|
Example good resolution summary: `"Restarted auth-service, cleared Redis cache, and increased connection pool from 10 to 50"`
|
|
202
220
|
|
|
221
|
+
### On-Call Shift Metrics
|
|
222
|
+
|
|
223
|
+
Get on-call shift metrics for any time period, grouped by user, team, or schedule. Includes primary/secondary role tracking, shift counts, hours, and days on-call.
|
|
224
|
+
|
|
225
|
+
```
|
|
226
|
+
get_oncall_shift_metrics(
|
|
227
|
+
start_date="2025-10-01",
|
|
228
|
+
end_date="2025-10-31",
|
|
229
|
+
group_by="user"
|
|
230
|
+
)
|
|
231
|
+
```
|
|
232
|
+
|
|
233
|
+
### On-Call Handoff Summary
|
|
234
|
+
|
|
235
|
+
Complete handoff: current/next on-call + incidents during shifts.
|
|
236
|
+
|
|
237
|
+
```python
|
|
238
|
+
# All on-call (any timezone)
|
|
239
|
+
get_oncall_handoff_summary(
|
|
240
|
+
team_ids="team-1,team-2",
|
|
241
|
+
timezone="America/Los_Angeles"
|
|
242
|
+
)
|
|
243
|
+
|
|
244
|
+
# Regional filter - only show APAC on-call during APAC business hours
|
|
245
|
+
get_oncall_handoff_summary(
|
|
246
|
+
timezone="Asia/Tokyo",
|
|
247
|
+
filter_by_region=True
|
|
248
|
+
)
|
|
249
|
+
```
|
|
250
|
+
|
|
251
|
+
Regional filtering shows only people on-call during business hours (9am-5pm) in the specified timezone.
|
|
252
|
+
|
|
253
|
+
Returns: `schedules` with `current_oncall`, `next_oncall`, and `shift_incidents`
|
|
254
|
+
|
|
255
|
+
### Shift Incidents
|
|
256
|
+
|
|
257
|
+
Incidents during a time period, with filtering by severity/status/tags.
|
|
258
|
+
|
|
259
|
+
```python
|
|
260
|
+
get_shift_incidents(
|
|
261
|
+
start_time="2025-10-20T09:00:00Z",
|
|
262
|
+
end_time="2025-10-20T17:00:00Z",
|
|
263
|
+
severity="critical", # optional
|
|
264
|
+
status="resolved", # optional
|
|
265
|
+
tags="database,api" # optional
|
|
266
|
+
)
|
|
267
|
+
```
|
|
268
|
+
|
|
269
|
+
Returns: `incidents` list + `summary` (counts, avg resolution time, grouping)
|
|
270
|
+
|
|
203
271
|
## About Rootly AI Labs
|
|
204
272
|
|
|
205
273
|
This project was developed by [Rootly AI Labs](https://labs.rootly.ai/), where we're building the future of system reliability and operational excellence. As an open-source incubator, we share ideas, experiment, and rapidly prototype solutions that benefit the entire community.
|
|
@@ -233,7 +301,20 @@ To add new dependencies during development:
|
|
|
233
301
|
uv pip install <package>
|
|
234
302
|
```
|
|
235
303
|
|
|
236
|
-
### 3.
|
|
304
|
+
### 3. Set Up Git Hooks (Recommended for Contributors)
|
|
305
|
+
|
|
306
|
+
Install pre-commit hooks to automatically run linting and tests before commits:
|
|
307
|
+
|
|
308
|
+
```bash
|
|
309
|
+
./scripts/setup-hooks.sh
|
|
310
|
+
```
|
|
311
|
+
|
|
312
|
+
This ensures code quality by running:
|
|
313
|
+
- Ruff linting
|
|
314
|
+
- Pyright type checking
|
|
315
|
+
- Unit tests
|
|
316
|
+
|
|
317
|
+
### 4. Verify Installation
|
|
237
318
|
|
|
238
319
|
The server should now be ready to use with your MCP-compatible editor.
|
|
239
320
|
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# Setup git hooks for this repository
|
|
3
|
+
# Run this script after cloning: ./scripts/setup-hooks.sh
|
|
4
|
+
|
|
5
|
+
set -e
|
|
6
|
+
|
|
7
|
+
REPO_ROOT="$(git rev-parse --show-toplevel)"
|
|
8
|
+
HOOKS_DIR="$REPO_ROOT/.git/hooks"
|
|
9
|
+
|
|
10
|
+
echo "🔧 Setting up git hooks..."
|
|
11
|
+
|
|
12
|
+
# Create pre-commit hook
|
|
13
|
+
cat > "$HOOKS_DIR/pre-commit" << 'EOF'
|
|
14
|
+
#!/bin/bash
|
|
15
|
+
# Pre-commit hook to run linting and type checking
|
|
16
|
+
# This ensures code quality before committing
|
|
17
|
+
|
|
18
|
+
set -e
|
|
19
|
+
|
|
20
|
+
echo "🔍 Running pre-commit checks..."
|
|
21
|
+
echo ""
|
|
22
|
+
|
|
23
|
+
# 1. Ruff linting
|
|
24
|
+
echo "📝 Checking code style with ruff..."
|
|
25
|
+
if ! uv run ruff check .; then
|
|
26
|
+
echo "❌ Ruff linting failed!"
|
|
27
|
+
echo "💡 Try running: uv run ruff check . --fix"
|
|
28
|
+
exit 1
|
|
29
|
+
fi
|
|
30
|
+
echo "✅ Ruff passed!"
|
|
31
|
+
echo ""
|
|
32
|
+
|
|
33
|
+
# 2. Pyright type checking
|
|
34
|
+
echo "🔍 Running type checks with pyright..."
|
|
35
|
+
if ! uv run pyright; then
|
|
36
|
+
echo "❌ Type checking failed!"
|
|
37
|
+
echo "💡 Fix type errors or add type: ignore comments"
|
|
38
|
+
exit 1
|
|
39
|
+
fi
|
|
40
|
+
echo "✅ Pyright passed!"
|
|
41
|
+
echo ""
|
|
42
|
+
|
|
43
|
+
# 3. Run unit tests (quick check)
|
|
44
|
+
echo "🧪 Running unit tests..."
|
|
45
|
+
if ! uv run pytest tests/unit/ -q --tb=line; then
|
|
46
|
+
echo "❌ Tests failed!"
|
|
47
|
+
echo "💡 Fix failing tests before committing"
|
|
48
|
+
exit 1
|
|
49
|
+
fi
|
|
50
|
+
echo "✅ Tests passed!"
|
|
51
|
+
echo ""
|
|
52
|
+
|
|
53
|
+
echo "✅ All pre-commit checks passed! Proceeding with commit..."
|
|
54
|
+
exit 0
|
|
55
|
+
EOF
|
|
56
|
+
|
|
57
|
+
chmod +x "$HOOKS_DIR/pre-commit"
|
|
58
|
+
|
|
59
|
+
echo "✅ Git hooks installed successfully!"
|
|
60
|
+
echo ""
|
|
61
|
+
echo "The following checks will run before every commit:"
|
|
62
|
+
echo " 1. Ruff linting"
|
|
63
|
+
echo " 2. Pyright type checking"
|
|
64
|
+
echo " 3. Unit tests"
|
|
65
|
+
echo ""
|
|
66
|
+
echo "To skip hooks (not recommended): git commit --no-verify"
|