Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 15, 2026

The list_project_members tool needed an option to return inherited group members by calling the /members/all endpoint instead of the direct members endpoint. This change adds that capability while preserving the default behavior.

  • API behavior

    • Extend ListProjectMembersSchema with include_inheritance
    • Route listProjectMembers to /members/all when enabled
  • Test coverage

    • Add mock tests to validate direct vs inherited member endpoints
await list_project_members({
  project_id: "123",
  include_inheritance: true,
});
Original prompt

This section details on the original issue you should resolve

<issue_title>extend tool for listing all project members (including inheritance)</issue_title>
<issue_description>The tool listProjectMembers shall also be capable of returning all project members, including those which are inherited of a parent group.
Therefore a different API-endpoint needs to be called:

Currently used endpoint:
Image

Endpoint for all members including inheritance:
Image

This should be easy to solve by extending the corresponding schema, e.g.:

// Schema for listing project members
export const ListProjectMembersSchema = z.object({
  project_id: z.string().describe("Project ID or URL-encoded path"),
  query: z.string().optional().describe("Search for members by name or username"),
  user_ids: z.array(z.number()).optional().describe("Filter by user IDs"),
  skip_users: z.array(z.number()).optional().describe("User IDs to exclude"),
  include_inheritance: z.boolean().optional().describe("Include inherited members. Defaults to false."),
  per_page: z.number().optional().describe("Number of items per page (default: 20, max: 100)"),
  page: z.number().optional().describe("Page number for pagination (default: 1)"),
});

and adding a if-statement:

async function listProjectMembers(
  projectId: string,
  options: Omit<ListProjectMembersOptions, "project_id"> = {}
): Promise<GitLabProjectMember[]> {
  projectId = decodeURIComponent(projectId);
  const effectiveProjectId = getEffectiveProjectId(projectId);
  if (options.include_inheritance) {
    const url = new URL(
      `${getEffectiveApiUrl()}/projects/${encodeURIComponent(effectiveProjectId)}/members/all`
    );
  } 
  else
  {
    const url = new URL(
      `${getEffectiveApiUrl()}/projects/${encodeURIComponent(effectiveProjectId)}/members`
    );
  }

What do you think?</issue_description>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 3 commits January 15, 2026 01:54
Co-authored-by: zereight <42544600+zereight@users.noreply.github.com>
Co-authored-by: zereight <42544600+zereight@users.noreply.github.com>
Co-authored-by: zereight <42544600+zereight@users.noreply.github.com>
Copilot AI changed the title [WIP] Extend tool for listing all project members including inheritance Add include_inheritance support to list_project_members Jan 15, 2026
Copilot AI requested a review from zereight January 15, 2026 02:05
@zereight zereight marked this pull request as ready for review January 18, 2026 14:38
Copy link
Owner

@zereight zereight left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Owner

@zereight zereight left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Clean implementation with comprehensive tests. The conflict has been resolved.

@zereight zereight merged commit 2e4a0eb into main Jan 18, 2026
8 checks passed
@zereight zereight deleted the copilot/extend-list-project-members-tool branch January 18, 2026 14:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

extend tool for listing all project members (including inheritance)

2 participants