Skip to main content
Glama
topotal

Waroom MCP

by topotal

waroom_create_service_label

Create new labels for services in Waroom to organize and categorize incident management data with custom names and colors.

Instructions

特定のサービスに新しいラベルを作成します。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
service_nameYesサービス名
nameYesラベル名
colorYesラベルの色(6桁の16進数カラーコード、例: ff0000)

Implementation Reference

  • The MCP tool handler function that calls WaroomClient.createServiceLabel with the input parameters and returns the JSON response or an error message as text content.
    async (params) => {
      try {
        const response = await waroomClient.createServiceLabel(
          params.service_name,
          params.name,
          params.color
        );
        return {
          content: [{
            type: 'text',
            text: JSON.stringify(response, null, 2)
          }]
        };
      } catch (error) {
        return {
          content: [{
            type: 'text',
            text: `サービスラベルの作成に失敗しました: ${error}`
          }]
        };
      }
    }
  • Zod schema defining the input parameters for the tool: service_name (string), name (string), color (6-digit hex string).
    {
      service_name: z.string().min(1).max(100).describe('サービス名'),
      name: z.string().min(1).max(100).describe('ラベル名'),
      color: z.string().regex(/^[0-9a-fA-F]{6}$/).describe('ラベルの色(6桁の16進数カラーコード、例: ff0000)'),
    },
  • Direct registration of the 'waroom_create_service_label' tool to the MCP server using server.tool(), specifying name, description, input schema, and handler function.
    server.tool(
      'waroom_create_service_label',
      '特定のサービスに新しいラベルを作成します。',
      {
        service_name: z.string().min(1).max(100).describe('サービス名'),
        name: z.string().min(1).max(100).describe('ラベル名'),
        color: z.string().regex(/^[0-9a-fA-F]{6}$/).describe('ラベルの色(6桁の16進数カラーコード、例: ff0000)'),
      },
      async (params) => {
        try {
          const response = await waroomClient.createServiceLabel(
            params.service_name,
            params.name,
            params.color
          );
          return {
            content: [{
              type: 'text',
              text: JSON.stringify(response, null, 2)
            }]
          };
        } catch (error) {
          return {
            content: [{
              type: 'text',
              text: `サービスラベルの作成に失敗しました: ${error}`
            }]
          };
        }
      }
    );
  • Supporting method in WaroomClient that performs the actual HTTP POST request to the Waroom API to create a service label.
    async createServiceLabel(serviceName: string, name: string, color: string) {
      try {
        const response = await this.axiosInstance.post(`${this.baseUrl}/services/${serviceName}/labels`, {
          label: {
            name,
            color
          }
        });
        return response.data;
      } catch (error) {
        throw new Error(`Failed to create service label: ${error}`);
      }
    }
  • src/main.ts:29-29 (registration)
    Top-level call to createLabelsTools(server, waroomClient) which registers all label-related tools, including 'waroom_create_service_label'.
    createLabelsTools(server, waroomClient);

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/topotal/waroom-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server