Skip to main content
Glama
ttpears

GitLab MCP Server

by ttpears

My Events

list_my_events
Read-onlyIdempotent

List your GitLab activity feed including pushes, merge requests, comments, and approvals. Filter by action type, target, and date range.

Instructions

List the authenticated user's GitLab activity feed — pushes, MRs, comments, approvals, issue actions. Primary tool for "what did I just do". Requires user authentication.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
actionNoFilter by action type
target_typeNoFilter by target resource type
beforeNoOnly events before this date (YYYY-MM-DD)
afterNoOnly events after this date (YYYY-MM-DD)
sortNoSort order (default desc — newest first)desc
pageNoPage number (1-based)
per_pageNoResults per page
scopeNoSet to "all" to include events from any project you have access to, not just your own authored events
userCredentialsNoYour GitLab credentials (optional — falls back to the configured env token if not provided)

Implementation Reference

  • Handler function for the list_my_events tool. Validates auth, extracts params, and delegates to client.listMyEvents().
      handler: async (input, client, userConfig) => {
        const credentials = input.userCredentials ? validateUserConfig(input.userCredentials) : userConfig;
        if (!credentials) {
          throw new Error('list_my_events requires user authentication — the feed is scoped to the caller.');
        }
        const { userCredentials, ...params } = input;
        return client.listMyEvents(params, credentials);
      },
    };
  • src/tools.ts:1860-1883 (registration)
    Tool object definition registering 'list_my_events' with schema (EventCommonFields + scope), requiring user auth.
    const listMyEventsTool: Tool = {
      name: 'list_my_events',
      title: 'My Events',
      description:
        'List the authenticated user\'s GitLab activity feed — pushes, MRs, comments, approvals, issue actions. Primary tool for "what did I just do". Requires user authentication.',
      requiresAuth: true,
      requiresWrite: false,
      annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true },
      inputSchema: withUserAuth(z.object({
        ...EventCommonFields,
        scope: z
          .enum(['all'])
          .optional()
          .describe('Set to "all" to include events from any project you have access to, not just your own authored events'),
      })),
      handler: async (input, client, userConfig) => {
        const credentials = input.userCredentials ? validateUserConfig(input.userCredentials) : userConfig;
        if (!credentials) {
          throw new Error('list_my_events requires user authentication — the feed is scoped to the caller.');
        }
        const { userCredentials, ...params } = input;
        return client.listMyEvents(params, credentials);
      },
    };
  • Input schema fields shared among event listing tools (action, target_type, before, after, sort, page, per_page).
    const EventCommonFields = {
      action: EventActionEnum,
      target_type: EventTargetTypeEnum,
      before: z.string().optional().describe('Only events before this date (YYYY-MM-DD)'),
      after: z.string().optional().describe('Only events after this date (YYYY-MM-DD)'),
      sort: z.enum(['asc', 'desc']).default('desc').describe('Sort order (default desc — newest first)'),
      page: z.number().int().min(1).default(1).describe('Page number (1-based)'),
      per_page: z.number().int().min(1).max(100).default(20).describe('Results per page'),
    };
  • Zod enum schemas for action and target_type event filter fields.
    const EventActionEnum = z
      .enum([
        'approved',
        'closed',
        'commented',
        'created',
        'destroyed',
        'expired',
        'joined',
        'left',
        'merged',
        'pushed',
        'reopened',
        'updated',
      ])
      .optional()
      .describe('Filter by action type');
    
    const EventTargetTypeEnum = z
      .enum(['issue', 'milestone', 'merge_request', 'note', 'project', 'snippet', 'user'])
      .optional()
      .describe('Filter by target resource type');
  • Client method that calls GitLab REST API GET /events to fetch the authenticated user's events.
    async listMyEvents(
      params: {
        action?: string;
        target_type?: string;
        before?: string;
        after?: string;
        scope?: 'all';
        sort?: 'asc' | 'desc';
        page?: number;
        per_page?: number;
      },
      userConfig?: UserConfig
    ): Promise<any> {
      return this.restRequest('GET', '/events', {
        query: {
          action: params.action,
          target_type: params.target_type,
          before: params.before,
          after: params.after,
          scope: params.scope,
          sort: params.sort,
          page: params.page ?? 1,
          per_page: Math.min(params.per_page ?? 20, this.config.maxPageSize),
        },
        userConfig,
      });
    }
Behavior4/5

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

Annotations already declare readOnlyHint=true, destructiveHint=false, idempotentHint=true, indicating safe, read-only, idempotent behavior. The description adds that authentication is required, which is a key behavioral trait not covered by annotations. No details on pagination or rate limits, but the essential safety profile is clear.

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 two sentences long, front-loaded with the core action and resource. Every piece of information (activity types, primary use case, auth requirement) earns its place. There is no fluff or redundancy.

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 9 parameters and no output schema, the description covers the tool's purpose, typical use case, and a critical constraint (auth). It does not explain the output format, but the agent can infer from parameter options. For a list tool with good schema coverage, this is reasonably complete.

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 does not add extra parameter-specific meaning beyond what the schema already provides. It mentions event types (pushes, MRs, etc.) which align with enum options, but this is already in the schema. No additional semantics are provided.

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 clearly states verb 'List', resource 'authenticated user's GitLab activity feed', and provides examples (pushes, MRs, etc.). It distinguishes itself from sibling tools by labeling it 'Primary tool for what did I just do', making the purpose unambiguous.

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?

Description positions the tool as the primary choice for checking user's own recent activity and notes authentication requirement. However, it does not explicitly mention when not to use it nor compare to similar sibling tools like list_user_events, so guidance is clear but not exhaustive.

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