Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3387,7 +3387,8 @@ async function getPipelineJobOutput(
async function createPipeline(
projectId: string,
ref: string,
variables?: Array<{ key: string; value: string }>
variables?: Array<{ key: string; value: string }>,
inputs?: Record<string, string>
): Promise<GitLabPipeline> {
projectId = decodeURIComponent(projectId); // Decode project ID
const url = new URL(
Expand All @@ -3398,6 +3399,9 @@ async function createPipeline(
if (variables && variables.length > 0) {
body.variables = variables;
}
if (inputs && Object.keys(inputs).length > 0) {
body.inputs = inputs;
}

const response = await fetch(url.toString(), {
method: "POST",
Expand Down Expand Up @@ -4940,8 +4944,8 @@ server.setRequestHandler(CallToolRequestSchema, async request => {
}

case "create_pipeline": {
const { project_id, ref, variables } = CreatePipelineSchema.parse(request.params.arguments);
const pipeline = await createPipeline(project_id, ref, variables);
const { project_id, ref, variables, inputs } = CreatePipelineSchema.parse(request.params.arguments);
const pipeline = await createPipeline(project_id, ref, variables, inputs);
return {
content: [
{
Expand Down
4 changes: 4 additions & 0 deletions schemas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,10 @@ export const CreatePipelineSchema = z.object({
)
.optional()
.describe("An array of variables to use for the pipeline"),
inputs: z
.record(z.string())
.optional()
.describe("Input values for spec-based pipelines (key-value pairs)"),
});

// Schema for retrying a pipeline
Expand Down