Skip to main content
Glama
ttpears

GitLab MCP Server

by ttpears

Update Broadcast Message

update_broadcast_message
Idempotent

Update an existing GitLab broadcast message by modifying its text, schedule, colors, audience, or other properties. Requires administrator access.

Instructions

Update an existing GitLab broadcast message. Requires administrator privileges.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesBroadcast message ID
messageNoMessage 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

  • Shared field definitions for broadcast messages used by create/update input schemas
    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"'),
    };
  • Tool definition for update_broadcast_message: handler extracts the id and body from input, validates auth, and delegates to client.updateBroadcastMessage
    const updateBroadcastMessageTool: Tool = {
      name: 'update_broadcast_message',
      title: 'Update Broadcast Message',
      description: 'Update an existing GitLab broadcast message. Requires administrator privileges.',
      requiresAuth: true,
      requiresWrite: true,
      annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: true },
      inputSchema: withUserAuth(z.object({
        id: z.number().int().describe('Broadcast message ID'),
        message: BroadcastMessageFields.message.optional(),
        starts_at: BroadcastMessageFields.starts_at,
        ends_at: BroadcastMessageFields.ends_at,
        color: BroadcastMessageFields.color,
        font: BroadcastMessageFields.font,
        target_access_levels: BroadcastMessageFields.target_access_levels,
        target_path: BroadcastMessageFields.target_path,
        broadcast_type: BroadcastMessageFields.broadcast_type,
        dismissable: BroadcastMessageFields.dismissable,
        theme: BroadcastMessageFields.theme,
      })),
      handler: async (input, client, userConfig) => {
        const credentials = input.userCredentials ? validateUserConfig(input.userCredentials) : userConfig;
        if (!credentials) {
          throw new Error('User authentication is required for updating broadcast messages.');
        }
        const { id, userCredentials, ...body } = input;
        return client.updateBroadcastMessage(id, body, credentials);
      },
    };
  • src/tools.ts:2307-2317 (registration)
    updateBroadcastMessageTool is registered in writeTools[] array
    export const writeTools: Tool[] = [
      createIssueTool,
      createMergeRequestTool,
      createNoteTool,
      deleteNoteTool,
      updateNoteTool,
      managePipelineTool,
      createBroadcastMessageTool,
      updateBroadcastMessageTool,
      deleteBroadcastMessageTool,
    ];
  • Client method that executes the actual REST API PUT request to /broadcast_messages/{id} to update the broadcast message
    async updateBroadcastMessage(id: number, 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('PUT', `/broadcast_messages/${id}`, { body: input, userConfig, requiresWrite: true });
    }
Behavior4/5

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

Annotations indicate idempotentHint=true, readOnlyHint=false, destructiveHint=false. The description aligns with these and adds the important behavioral requirement of administrator privileges, which is not captured in annotations. No contradictions. The description provides useful auth context beyond annotations.

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?

The description is a single short sentence that is front-loaded with the core purpose. It is concise with no redundant information. Every word adds value.

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

Completeness4/5

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

Given the tool is a simple update with 12 well-documented parameters and annotations covering idempotency, the description provides sufficient context. It includes a key auth requirement. No output schema, but that's acceptable. Could mention idempotency, but not necessary.

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 coverage is 100% with each parameter already described in the input schema. The description does not add additional meaning or context beyond what the schema provides. Baseline score of 3 is appropriate.

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?

The description clearly states the action (update) and resource (existing GitLab broadcast message). It distinguishes from sibling tools like create_broadcast_message, delete_broadcast_message, get_broadcast_message, and list_broadcast_messages. The mention of admin privileges adds specificity.

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

Usage Guidelines4/5

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

The description implies usage when an existing broadcast message needs modification, and the sibling tools provide context for alternatives. However, it does not explicitly state when to use or not use this tool versus others, nor does it provide exclusions. The context is clear enough.

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