rootly-mcp-server 2.1.3__py3-none-any.whl → 2.2.0__py3-none-any.whl

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.
@@ -1,10 +1,13 @@
1
- """On-Call Health API client for burnout risk analysis."""
1
+ """On-Call Health API client for workload health risk analysis."""
2
2
 
3
3
  import os
4
4
  from typing import Any
5
5
 
6
6
  import httpx
7
7
 
8
+ # External API field mapping (On-Call Health API response field)
9
+ _OCH_RISK_SCORE_FIELD = "burnout_score"
10
+
8
11
 
9
12
  class OnCallHealthClient:
10
13
  def __init__(self, api_key: str | None = None, base_url: str | None = None):
@@ -55,7 +58,7 @@ class OnCallHealthClient:
55
58
  "rootly_user_id": member.get("rootly_user_id"),
56
59
  "och_score": member.get("och_score", 0),
57
60
  "risk_level": member.get("risk_level", "unknown"),
58
- "burnout_score": member.get("burnout_score", 0),
61
+ "health_risk_score": member.get(_OCH_RISK_SCORE_FIELD, 0),
59
62
  "incident_count": member.get("incident_count", 0),
60
63
  }
61
64
 
@@ -381,11 +381,21 @@ class AuthenticatedHTTPXClient:
381
381
  return transformed
382
382
 
383
383
  async def request(self, method: str, url: str, **kwargs):
384
- """Override request to transform parameters."""
384
+ """Override request to transform parameters and ensure correct headers."""
385
385
  # Transform query parameters
386
386
  if "params" in kwargs:
387
387
  kwargs["params"] = self._transform_params(kwargs["params"])
388
388
 
389
+ # Ensure Content-Type and Accept headers are always set correctly for Rootly API
390
+ # This is critical because FastMCP may pass headers from the MCP client request
391
+ # (e.g., Content-Type: application/json from SSE) which would override our defaults
392
+ if "headers" in kwargs:
393
+ headers = dict(kwargs["headers"]) if kwargs["headers"] else {}
394
+ # Always use JSON-API content type for Rootly API
395
+ headers["Content-Type"] = "application/vnd.api+json"
396
+ headers["Accept"] = "application/vnd.api+json"
397
+ kwargs["headers"] = headers
398
+
389
399
  # Call the underlying client's request method and let it handle everything
390
400
  return await self.client.request(method, url, **kwargs)
391
401
 
@@ -3158,7 +3168,7 @@ Updated: {attributes.get("updated_at", "N/A")}"""
3158
3168
  }
3159
3169
 
3160
3170
  @mcp.tool()
3161
- async def check_oncall_burnout_risk(
3171
+ async def check_oncall_health_risk(
3162
3172
  start_date: Annotated[
3163
3173
  str,
3164
3174
  Field(description="Start date for the on-call period (ISO 8601, e.g., '2026-02-09')"),
@@ -3182,11 +3192,11 @@ Updated: {attributes.get("updated_at", "N/A")}"""
3182
3192
  Field(description="Include recommended replacement responders (default: true)"),
3183
3193
  ] = True,
3184
3194
  ) -> dict:
3185
- """Check if any at-risk responders (based on On-Call Health burnout analysis) are scheduled for on-call.
3195
+ """Check if any at-risk responders (based on On-Call Health analysis) are scheduled for on-call.
3186
3196
 
3187
- Integrates with On-Call Health (oncallhealth.ai) to identify responders at risk of burnout
3188
- and checks if they are scheduled during the specified period. Optionally recommends
3189
- safe replacement responders.
3197
+ Integrates with On-Call Health (oncallhealth.ai) to identify responders with elevated
3198
+ workload health risk and checks if they are scheduled during the specified period.
3199
+ Optionally recommends safe replacement responders.
3190
3200
 
3191
3201
  Requires ONCALLHEALTH_API_KEY environment variable.
3192
3202
  """
@@ -3229,7 +3239,7 @@ Updated: {attributes.get("updated_at", "N/A")}"""
3229
3239
  "total_at_risk": 0,
3230
3240
  "at_risk_scheduled": 0,
3231
3241
  "action_required": False,
3232
- "message": "No users above burnout threshold.",
3242
+ "message": "No users above health risk threshold.",
3233
3243
  },
3234
3244
  }
3235
3245
 
@@ -3340,7 +3350,7 @@ Updated: {attributes.get("updated_at", "N/A")}"""
3340
3350
  "user_id": int(rootly_id),
3341
3351
  "och_score": user["och_score"],
3342
3352
  "risk_level": user["risk_level"],
3343
- "burnout_score": user["burnout_score"],
3353
+ "health_risk_score": user["health_risk_score"],
3344
3354
  "total_hours": round(total_hours, 1),
3345
3355
  "shifts": user_shifts,
3346
3356
  }
@@ -3441,7 +3451,7 @@ Updated: {attributes.get("updated_at", "N/A")}"""
3441
3451
 
3442
3452
  error_type, error_message = MCPError.categorize_error(e)
3443
3453
  return MCPError.tool_error(
3444
- f"Failed to check burnout risk: {error_message}",
3454
+ f"Failed to check health risk: {error_message}",
3445
3455
  error_type,
3446
3456
  details={
3447
3457
  "params": {
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: rootly-mcp-server
3
- Version: 2.1.3
3
+ Version: 2.2.0
4
4
  Summary: Secure Model Context Protocol server for Rootly APIs with AI SRE capabilities, comprehensive error handling, and input validation
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
@@ -147,11 +147,11 @@ Alternatively, connect directly to our hosted MCP server:
147
147
  - **`suggest_solutions`**: Mines past incident resolutions to recommend actionable solutions
148
148
  - **MCP Resources**: Exposes incident and team data as structured resources for easy AI reference
149
149
  - **Intelligent Pattern Recognition**: Automatically identifies services, error types, and resolution patterns
150
- - **On-Call Health Integration**: Detects burnout risk in scheduled responders
150
+ - **On-Call Health Integration**: Detects workload health risk in scheduled responders
151
151
 
152
152
  ## On-Call Health Integration
153
153
 
154
- Rootly MCP integrates with [On-Call Health](https://oncallhealth.ai) to detect burnout risk in scheduled responders.
154
+ Rootly MCP integrates with [On-Call Health](https://oncallhealth.ai) to detect workload health risk in scheduled responders.
155
155
 
156
156
  ### Setup
157
157
 
@@ -175,7 +175,7 @@ Set the `ONCALLHEALTH_API_KEY` environment variable:
175
175
  ### Usage
176
176
 
177
177
  ```
178
- check_oncall_burnout_risk(
178
+ check_oncall_health_risk(
179
179
  start_date="2026-02-09",
180
180
  end_date="2026-02-15"
181
181
  )
@@ -3,17 +3,17 @@ rootly_mcp_server/__main__.py,sha256=mt74vaOpfHnX5rTO0CFAeulatR_9K3NBNCaLAhBLxlc
3
3
  rootly_mcp_server/client.py,sha256=Qca2R9cgBxXcyobQj4RHl8gdxLB4Jphq0RIr61DAVKw,6542
4
4
  rootly_mcp_server/exceptions.py,sha256=67J_wlfOICg87eUipbkARzn_6u_Io82L-5cVnk2UPr0,4504
5
5
  rootly_mcp_server/monitoring.py,sha256=k1X7vK65FOTrCrOsLUXrFm6AJxKpXt_a0PzL6xdPuVU,11681
6
- rootly_mcp_server/och_client.py,sha256=tz_Qw8NwAmrlSjtl-V6WNVChiIofyur06YJZRfYotKE,2737
6
+ rootly_mcp_server/och_client.py,sha256=6UBP7MLkaDOGcJ78hQgSqTyrtr41XwDTqOOfUnoMJkc,2861
7
7
  rootly_mcp_server/pagination.py,sha256=2hZSO4DLUEJZbdF8oDfIt2_7X_XGBG1jIxN8VGmeJBE,2420
8
8
  rootly_mcp_server/security.py,sha256=YkMoVALZ3XaKnMu3yF5kVf3SW_jdKHllSMwVLk1OlX0,11556
9
- rootly_mcp_server/server.py,sha256=9XcQ5_yOv4ofMRjXoDg3LsPFb8qDiOHEFz9dPNfwl7o,163221
9
+ rootly_mcp_server/server.py,sha256=neVjS-7AmEPIK7U2IfQ5TdAchHPnOaLONH_0nAHDX6g,163869
10
10
  rootly_mcp_server/smart_utils.py,sha256=c7S-8H151GfmDw6dZBDdLH_cCmR1qiXkKEYSKc0WwUY,23481
11
11
  rootly_mcp_server/texttest.json,sha256=KV9m13kWugmW1VEpU80Irp50uCcLgJtV1YT-JzMogQg,154182
12
12
  rootly_mcp_server/utils.py,sha256=TWG1MaaFKrU1phRhU6FgHuZAEv91JOe_1w0L2OrPJMY,4406
13
13
  rootly_mcp_server/validators.py,sha256=z1Lvel2SpOFLo1cPdQGSrX2ySt6zqR42w0R6QV9c2Cc,4092
14
14
  rootly_mcp_server/data/__init__.py,sha256=KdWD6hiRssHXt0Ywgj3wjNHY1sx-XSPEqVHqrTArf54,143
15
- rootly_mcp_server-2.1.3.dist-info/METADATA,sha256=321Q8VyO2kJGCHbpEyf1NT73jZpB7Eb-KxbECDZcnVs,9892
16
- rootly_mcp_server-2.1.3.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
17
- rootly_mcp_server-2.1.3.dist-info/entry_points.txt,sha256=NE33b8VgigVPGBkboyo6pvN1Vz35HZtLybxMO4Q03PI,70
18
- rootly_mcp_server-2.1.3.dist-info/licenses/LICENSE,sha256=c9w9ZZGl14r54tsP40oaq5adTVX_HMNHozPIH2ymzmw,11341
19
- rootly_mcp_server-2.1.3.dist-info/RECORD,,
15
+ rootly_mcp_server-2.2.0.dist-info/METADATA,sha256=0sXGTYmYNvifnLHGoOPC7VJppxKDVWcZio-EbUVy3-0,9907
16
+ rootly_mcp_server-2.2.0.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
17
+ rootly_mcp_server-2.2.0.dist-info/entry_points.txt,sha256=NE33b8VgigVPGBkboyo6pvN1Vz35HZtLybxMO4Q03PI,70
18
+ rootly_mcp_server-2.2.0.dist-info/licenses/LICENSE,sha256=c9w9ZZGl14r54tsP40oaq5adTVX_HMNHozPIH2ymzmw,11341
19
+ rootly_mcp_server-2.2.0.dist-info/RECORD,,