waroom_update_incident_labels
Add or update labels on incidents in Waroom MCP to categorize and organize incident data for better tracking and analysis.
Instructions
インシデントにラベルを付与または更新します。
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| incident_uuid | Yes | 対象インシデントのUUID | |
| label_uuids | Yes | 付与するラベルのUUID配列 |
Implementation Reference
- src/tools/labels.ts:141-162 (handler)The handler function that executes the tool logic: calls WaroomClient.updateIncidentLabels with provided parameters and returns the JSON response or an error message in MCP format.async (params) => { try { const response = await waroomClient.updateIncidentLabels( params.incident_uuid, params.label_uuids ); return { content: [{ type: 'text', text: JSON.stringify(response, null, 2) }] }; } catch (error) { return { content: [{ type: 'text', text: `インシデントラベルの更新に失敗しました: ${error}` }] }; } } );
- src/tools/labels.ts:137-140 (schema)Zod schema defining the input parameters for the tool: incident_uuid (UUID string) and label_uuids (array of UUID strings).{ incident_uuid: z.string().uuid().describe('対象インシデントのUUID'), label_uuids: z.array(z.string().uuid()).describe('付与するラベルのUUID配列'), },
- src/tools/labels.ts:134-162 (registration)Registers the 'waroom_update_incident_labels' tool on the MCP server, specifying name, description, input schema, and handler function.server.tool( 'waroom_update_incident_labels', 'インシデントにラベルを付与または更新します。', { incident_uuid: z.string().uuid().describe('対象インシデントのUUID'), label_uuids: z.array(z.string().uuid()).describe('付与するラベルのUUID配列'), }, async (params) => { try { const response = await waroomClient.updateIncidentLabels( params.incident_uuid, params.label_uuids ); return { content: [{ type: 'text', text: JSON.stringify(response, null, 2) }] }; } catch (error) { return { content: [{ type: 'text', text: `インシデントラベルの更新に失敗しました: ${error}` }] }; } } );
- src/WaroomClient.ts:209-218 (helper)The WaroomClient helper method that performs the actual API PATCH request to update labels on an incident.async updateIncidentLabels(incidentUuid: string, labelUuids: string[]) { try { const response = await this.axiosInstance.patch(`${this.baseUrl}/incidents/${incidentUuid}/labels`, { label_uuids: labelUuids }); return response.data; } catch (error) { throw new Error(`Failed to update incident labels: ${error}`); } }