My Events
list_my_eventsList 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
| Name | Required | Description | Default |
|---|---|---|---|
| action | No | Filter by action type | |
| target_type | No | Filter by target resource type | |
| before | No | Only events before this date (YYYY-MM-DD) | |
| after | No | Only events after this date (YYYY-MM-DD) | |
| sort | No | Sort order (default desc — newest first) | desc |
| page | No | Page number (1-based) | |
| per_page | No | Results per page | |
| scope | No | Set to "all" to include events from any project you have access to, not just your own authored events | |
| userCredentials | No | Your GitLab credentials (optional — falls back to the configured env token if not provided) |
Implementation Reference
- src/tools.ts:1875-1883 (handler)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); }, }; - src/tools.ts:1850-1858 (schema)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'), }; - src/tools.ts:1827-1848 (schema)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'); - src/gitlab-client.ts:2703-2729 (helper)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, }); }