uptrace_get_alert
Retrieve detailed information about a specific alert incident by its ID to analyze and respond to monitoring events in the Uptrace observability platform.
Instructions
Get details of a specific alert incident by ID.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| alert_id | Yes | ID of the alert incident to retrieve |
Implementation Reference
- src/uptrace_mcp/server.py:915-945 (handler)The handler logic for the 'uptrace_get_alert' tool, which retrieves alert details using the Uptrace client and formats the output.
elif name == "uptrace_get_alert": alert_id = arguments.get("alert_id") if not alert_id: return [TextContent(type="text", text="Error: alert_id is required")] logger.info(f"Fetching alert: {alert_id}") alert = client.get_alert(alert_id) import json lines = [ f"# Alert: {alert.name}", f"- **ID**: {alert.id}", f"- **Type**: {alert.type}", f"- **Status**: {alert.status or 'Unknown'}", f"- **Created At**: {datetime.fromtimestamp(alert.created_at/1000, tz=timezone.utc).isoformat()}", f"- **Monitor ID**: {alert.monitor_id}", "", "## Attributes", f"```json\n{json.dumps(alert.attrs, indent=2)}\n```", "", ] if alert.events: lines.append("## Events") for event in alert.events: ts = datetime.fromtimestamp( event.get("createdAt", 0) / 1000, tz=timezone.utc ).isoformat() name = event.get("name", "Unknown") lines.append(f"- **{ts}**: {name} ({event.get('status', '')})") - src/uptrace_mcp/server.py:308-320 (registration)The registration definition for 'uptrace_get_alert' within the MCP server's tools list, including its schema.
Tool( name="uptrace_get_alert", description="Get details of a specific alert incident by ID.", inputSchema={ "type": "object", "properties": { "alert_id": { "type": "string", "description": "ID of the alert incident to retrieve", }, }, "required": ["alert_id"], },