waroom_get_service_labels
Retrieve labels for a specific service in the Waroom MCP server to organize and categorize incident data effectively.
Instructions
特定のサービスのラベル一覧を取得します。
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| service_name | Yes | サービス名 | |
| page | No | 取得するページ番号(1以上の整数)。デフォルト: 1 | |
| per_page | No | 1ページあたりの取得数(1-100)。デフォルト: 50 |
Implementation Reference
- src/tools/labels.ts:14-36 (handler)The MCP tool handler that executes the tool logic by calling WaroomClient.getServiceLabels and formatting the response as text content.async (params) => { try { const response = await waroomClient.getServiceLabels( params.service_name, params.page || 1, params.per_page || 50 ); return { content: [{ type: 'text', text: JSON.stringify(response, null, 2) }] }; } catch (error) { return { content: [{ type: 'text', text: `サービスラベル一覧の取得に失敗しました: ${error}` }] }; } } );
- src/tools/labels.ts:10-13 (schema)Zod schema defining the input parameters for the tool.service_name: z.string().min(1).max(100).describe('サービス名'), page: z.number().int().min(1).optional().describe('取得するページ番号(1以上の整数)。デフォルト: 1'), per_page: z.number().int().min(1).max(100).optional().describe('1ページあたりの取得数(1-100)。デフォルト: 50'), },
- src/tools/labels.ts:6-36 (registration)Registers the waroom_get_service_labels tool on the MCP server, including schema and handler.server.tool( 'waroom_get_service_labels', '特定のサービスのラベル一覧を取得します。', { service_name: z.string().min(1).max(100).describe('サービス名'), page: z.number().int().min(1).optional().describe('取得するページ番号(1以上の整数)。デフォルト: 1'), per_page: z.number().int().min(1).max(100).optional().describe('1ページあたりの取得数(1-100)。デフォルト: 50'), }, async (params) => { try { const response = await waroomClient.getServiceLabels( params.service_name, params.page || 1, params.per_page || 50 ); return { content: [{ type: 'text', text: JSON.stringify(response, null, 2) }] }; } catch (error) { return { content: [{ type: 'text', text: `サービスラベル一覧の取得に失敗しました: ${error}` }] }; } } );
- src/WaroomClient.ts:161-170 (helper)Helper method in WaroomClient that makes the API request to retrieve service labels.async getServiceLabels(serviceName: string, page = 1, perPage = 50) { try { const response = await this.axiosInstance.get(`${this.baseUrl}/services/${serviceName}/labels`, { params: { page, per_page: perPage } }); return response.data; } catch (error) { throw new Error(`Failed to get service labels: ${error}`); } }