waroom_create_incident_metrics
Generate incident metrics to track response activities and update key performance indicators like TTD, TTA, TTI, TTF, and TTR for specified incidents on the Waroom MCP server.
Instructions
インシデントメトリクスを作成します。レスポンス活動を記録し、TTD/TTA/TTI/TTF/TTRを更新します。
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| activity_action | Yes | 活動アクション(status: detected/investigating/fixing/resolved/close/triggered, severity: critical/high/low/info/unknown, root_cause: unspecified/code_bug/configuration_error/deployment_failure/infrastructure_failure/operational_failure/third_party_outage/other) | |
| incident_uuid | Yes | 対象インシデントのUUID | |
| triggered_at | Yes | 実行時刻(ISO 8601形式、例: 2023-01-01T12:00:00Z) |
Implementation Reference
- src/tools/incidents.ts:169-189 (handler)MCP tool handler: extracts params, calls waroomClient.createIncidentMetrics, returns JSON response or error message.async (params) => { try { const response = await waroomClient.createIncidentMetrics( params.incident_uuid, params.activity_action, params.triggered_at ); return { content: [{ type: 'text', text: JSON.stringify(response, null, 2) }] }; } catch (error) { return { content: [{ type: 'text', text: `インシデントメトリクスの作成に失敗しました: ${error}` }] }; }
- src/tools/incidents.ts:164-168 (schema)Zod input schema validating incident_uuid (UUID), activity_action (enum), triggered_at (ISO 8601 datetime).{ incident_uuid: z.string().uuid().describe('対象インシデントのUUID'), activity_action: z.enum(['detected', 'investigating', 'fixing', 'resolved', 'close', 'triggered', 'critical', 'high', 'low', 'info', 'unknown', 'unspecified', 'code_bug', 'configuration_error', 'deployment_failure', 'infrastructure_failure', 'operational_failure', 'third_party_outage', 'other']).describe('活動アクション(status: detected/investigating/fixing/resolved/close/triggered, severity: critical/high/low/info/unknown, root_cause: unspecified/code_bug/configuration_error/deployment_failure/infrastructure_failure/operational_failure/third_party_outage/other)'), triggered_at: z.string().regex(/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d{3})?([+-]\d{2}:\d{2}|Z)$/).describe('実行時刻(ISO 8601形式、例: 2023-01-01T12:00:00Z)'), },
- src/tools/incidents.ts:161-191 (registration)Registers the waroom_create_incident_metrics tool on the MCP server with description, input schema, and handler function.server.tool( 'waroom_create_incident_metrics', 'インシデントメトリクスを作成します。レスポンス活動を記録し、TTD/TTA/TTI/TTF/TTRを更新します。', { incident_uuid: z.string().uuid().describe('対象インシデントのUUID'), activity_action: z.enum(['detected', 'investigating', 'fixing', 'resolved', 'close', 'triggered', 'critical', 'high', 'low', 'info', 'unknown', 'unspecified', 'code_bug', 'configuration_error', 'deployment_failure', 'infrastructure_failure', 'operational_failure', 'third_party_outage', 'other']).describe('活動アクション(status: detected/investigating/fixing/resolved/close/triggered, severity: critical/high/low/info/unknown, root_cause: unspecified/code_bug/configuration_error/deployment_failure/infrastructure_failure/operational_failure/third_party_outage/other)'), triggered_at: z.string().regex(/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d{3})?([+-]\d{2}:\d{2}|Z)$/).describe('実行時刻(ISO 8601形式、例: 2023-01-01T12:00:00Z)'), }, async (params) => { try { const response = await waroomClient.createIncidentMetrics( params.incident_uuid, params.activity_action, params.triggered_at ); return { content: [{ type: 'text', text: JSON.stringify(response, null, 2) }] }; } catch (error) { return { content: [{ type: 'text', text: `インシデントメトリクスの作成に失敗しました: ${error}` }] }; } } );
- src/WaroomClient.ts:149-159 (helper)WaroomClient helper method that makes POST API request to /incidents/{uuid}/metrics to record the activity and update metrics.async createIncidentMetrics(incidentUuid: string, activityAction: string, triggeredAt: string) { try { const response = await this.axiosInstance.post(`${this.baseUrl}/incidents/${incidentUuid}/metrics`, { activity_action: activityAction, triggered_at: triggeredAt }); return response.data; } catch (error) { throw new Error(`Failed to create incident metrics: ${error}`); } }
- src/main.ts:26-26 (registration)Top-level call to createIncidentsTools which registers multiple incident-related tools including waroom_create_incident_metrics.createIncidentsTools(server, waroomClient);