Skip to main content
Glama
ttpears

GitLab MCP Server

by ttpears

Create Broadcast Message

create_broadcast_message

Create broadcast messages on GitLab to communicate important updates to users. Requires administrator access.

Instructions

Create a GitLab broadcast message. Requires administrator privileges on the GitLab instance.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
messageYesMessage text to display
starts_atNoISO 8601 timestamp when the message starts
ends_atNoISO 8601 timestamp when the message ends
colorNoBackground color in hex format, e.g. "#E75E40"
fontNoForeground (font) color in hex format
target_access_levelsNoAccess levels to target: 10=Guest, 20=Reporter, 30=Developer, 40=Maintainer, 50=Owner
target_pathNoPath glob for pages where the message should appear
broadcast_typeNoBroadcast type: "banner" or "notification"
dismissableNoWhether users can dismiss the broadcast message
themeNoTheme name (GitLab 16.9+), e.g. "indigo", "red"
userCredentialsNoYour GitLab credentials (optional — falls back to the configured env token if not provided)

Implementation Reference

  • The Tool object for 'create_broadcast_message' containing the handler function that validates credentials, strips userCredentials from input, and delegates to client.createBroadcastMessage() via the GitLab REST API.
    const createBroadcastMessageTool: Tool = {
      name: 'create_broadcast_message',
      title: 'Create Broadcast Message',
      description: 'Create a GitLab broadcast message. Requires administrator privileges on the GitLab instance.',
      requiresAuth: true,
      requiresWrite: true,
      annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: false },
      inputSchema: withUserAuth(z.object(BroadcastMessageFields)),
      handler: async (input, client, userConfig) => {
        const credentials = input.userCredentials ? validateUserConfig(input.userCredentials) : userConfig;
        if (!credentials) {
          throw new Error('User authentication is required for creating broadcast messages.');
        }
        const { userCredentials, ...body } = input;
        return client.createBroadcastMessage(body, credentials);
      },
    };
  • BroadcastMessageFields schema defining all input fields: message (required), starts_at, ends_at, color, font, target_access_levels, target_path, broadcast_type, dismissable, and theme.
    const BroadcastMessageFields = {
      message: z.string().min(1).describe('Message text to display'),
      starts_at: z.string().datetime().optional().describe('ISO 8601 timestamp when the message starts'),
      ends_at: z.string().datetime().optional().describe('ISO 8601 timestamp when the message ends'),
      color: z.string().optional().describe('Background color in hex format, e.g. "#E75E40"'),
      font: z.string().optional().describe('Foreground (font) color in hex format'),
      target_access_levels: z.array(z.number().int()).optional().describe('Access levels to target: 10=Guest, 20=Reporter, 30=Developer, 40=Maintainer, 50=Owner'),
      target_path: z.string().optional().describe('Path glob for pages where the message should appear'),
      broadcast_type: z.enum(['banner', 'notification']).optional().describe('Broadcast type: "banner" or "notification"'),
      dismissable: z.boolean().optional().describe('Whether users can dismiss the broadcast message'),
      theme: z.string().optional().describe('Theme name (GitLab 16.9+), e.g. "indigo", "red"'),
    };
  • src/tools.ts:2307-2317 (registration)
    The writeTools array that registers 'create_broadcast_message' (via createBroadcastMessageTool) along with other write tools, making it available to the MCP server.
    export const writeTools: Tool[] = [
      createIssueTool,
      createMergeRequestTool,
      createNoteTool,
      deleteNoteTool,
      updateNoteTool,
      managePipelineTool,
      createBroadcastMessageTool,
      updateBroadcastMessageTool,
      deleteBroadcastMessageTool,
    ];
  • GitLabGraphQLClient.createBroadcastMessage() method that takes the input fields and makes a POST request to the GitLab REST API endpoint /api/v4/broadcast_messages.
    async createBroadcastMessage(input: {
      message: string;
      starts_at?: string;
      ends_at?: string;
      color?: string;
      font?: string;
      target_access_levels?: number[];
      target_path?: string;
      broadcast_type?: 'banner' | 'notification';
      dismissable?: boolean;
      theme?: string;
    }, userConfig?: UserConfig): Promise<any> {
      return this.restRequest('POST', '/broadcast_messages', { body: input, userConfig, requiresWrite: true });
    }
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Description adds the admin privilege requirement beyond annotations (readOnlyHint=false, destructiveHint=false, idempotentHint=false), but fails to describe what happens upon creation, such as return value or side effects.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two sentences with no fluff: first states core action, second adds a critical prerequisite. Front-loaded and efficient.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With 11 parameters and no output schema, the description should explain the return value or error behavior. It only states purpose and privilege, leaving significant gaps.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so baseline is 3. The description adds no additional meaning to parameters beyond what the schema already provides.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Description uses specific verb 'Create' and resource 'broadcast message', immediately distinguishing it from siblings like delete_broadcast_message, get_broadcast_message, list_broadcast_messages, and update_broadcast_message.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Only mentions admin privilege requirement, but does not provide guidance on when to use this tool versus alternatives, nor any scenarios where it should not be used.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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/ttpears/gitlab-mcp'

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