Skip to content

feat: add topic parameter to list_projects and list_group_projects#418

Open
paolomainardi wants to merge 1 commit intozereight:mainfrom
paolomainardi:feat/add-topic-filter-to-list-projects
Open

feat: add topic parameter to list_projects and list_group_projects#418
paolomainardi wants to merge 1 commit intozereight:mainfrom
paolomainardi:feat/add-topic-filter-to-list-projects

Conversation

@paolomainardi
Copy link
Copy Markdown

@paolomainardi paolomainardi commented Apr 14, 2026

🤖 This was written by an AI agent on behalf of @paolomainardi.

Summary

  • Adds optional topic parameter to ListProjectsSchema and ListGroupProjectsSchema in schemas.ts
  • Adds the corresponding handler line in listGroupProjects() in index.ts (listProjects() already uses a generic loop that passes all schema fields through)
  • The GitLab REST API supports topic on both GET /projects and GET /groups/:id/projects — this change simply exposes the existing API capability through the MCP tools

Motivation

We tag internal documentation repositories with topics (e.g. mkdocs) on GitLab and need AI agents to discover them via list_projects(topic: "mkdocs"). Currently the only workaround is execute_graphql, which is heavier and harder to guide agents toward safely.

Closes #417

Changes

schemas.ts — 2 lines added:

// In ListProjectsSchema
topic: z.string().optional().describe("Filter by topic (projects tagged with this topic)"),

// In ListGroupProjectsSchema
topic: z.string().optional().describe("Filter by topic (projects tagged with this topic)"),

index.ts — 1 line added in listGroupProjects():

if (options.topic) url.searchParams.append("topic", options.topic);

Testing

  • npm run build passes (TypeScript compiles cleanly)
  • No runtime behavior changes for existing callers — topic is optional and defaults to undefined

Add optional `topic` filter to ListProjectsSchema and
ListGroupProjectsSchema, allowing callers to discover projects
by GitLab topic tag (e.g. `list_projects(topic: "mkdocs")`).

The GitLab REST API already supports this parameter on both
`GET /projects` and `GET /groups/:id/projects` — this change
simply exposes it through the MCP tool schemas.

Closes zereight#417

Signed-off-by: Paolo Mainardi <paolomainardi@gmail.com>
Assisted-by: opencode/claude-opus-4.6
@paolomainardi paolomainardi force-pushed the feat/add-topic-filter-to-list-projects branch from 42f207d to 736c4a0 Compare April 14, 2026 13:39
@zereight zereight requested a review from Copilot April 14, 2026 23:34
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Exposes GitLab’s existing topic filter on project listing endpoints by adding an optional topic parameter to the MCP tool schemas and wiring it into the group-projects listing URL builder.

Changes:

  • Add optional topic to ListProjectsSchema and ListGroupProjectsSchema.
  • Append topic as a query parameter in listGroupProjects() when provided.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
schemas.ts Adds topic to the Zod schemas so the MCP tool inputs accept it.
index.ts Appends topic to the GET /groups/:id/projects query string when present.

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.

feat: add topic parameter to list_projects and list_group_projects tools

2 participants