From 616d8a039b980ce92eb1cd7cd0084b948f8ef603 Mon Sep 17 00:00:00 2001 From: Marc Mintel Date: Wed, 4 Mar 2026 10:07:41 +0100 Subject: [PATCH] feat(gitea): add branch and event filters to pipeline discovery --- packages/gitea-mcp/src/index.ts | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/packages/gitea-mcp/src/index.ts b/packages/gitea-mcp/src/index.ts index a3eaf3a..e430617 100644 --- a/packages/gitea-mcp/src/index.ts +++ b/packages/gitea-mcp/src/index.ts @@ -37,6 +37,8 @@ const LIST_PIPELINES_TOOL: Tool = { owner: { type: "string", description: "Repository owner (e.g., 'mmintel')" }, repo: { type: "string", description: "Repository name (e.g., 'at-mintel')" }, limit: { type: "number", description: "Number of runs to fetch (default: 5)" }, + branch: { type: "string", description: "Optional: Filter by branch name (e.g., 'main')" }, + event: { type: "string", description: "Optional: Filter by trigger event (e.g., 'push', 'pull_request')" }, }, required: ["owner", "repo"], }, @@ -82,12 +84,15 @@ server.setRequestHandler(ListToolsRequestSchema, async () => { server.setRequestHandler(CallToolRequestSchema, async (request) => { if (request.params.name === "gitea_list_pipelines") { - // ... (Keeping exact same implementation as before for brevity) - const { owner, repo, limit = 5 } = request.params.arguments as any; + const { owner, repo, limit = 5, branch, event } = request.params.arguments as any; try { + const apiParams: Record = { limit }; + if (branch) apiParams.branch = branch; + if (event) apiParams.event = event; + const runsResponse = await giteaClient.get(`/repos/${owner}/${repo}/actions/runs`, { - params: { limit }, + params: apiParams, }); const runs = (runsResponse.data.workflow_runs || []) as any[];