Skip to main content
Glama
yjiace

AlibabaCloud DevOps MCP Server

by yjiace
pipeline.tsโ€ข9.75 kB
import { z } from 'zod'; import { zodToJsonSchema } from 'zod-to-json-schema'; import * as types from '../common/types.js'; export const getPipelineTools = () => [ { name: "get_pipeline", description: "[Pipeline Management] Get details of a specific pipeline in an organization", inputSchema: zodToJsonSchema(types.GetPipelineSchema), }, { name: "list_pipelines", description: "[Pipeline Management] Get a list of pipelines in an organization with filtering options", inputSchema: zodToJsonSchema(types.ListPipelinesSchema), }, { name: "generate_pipeline_yaml", description: "[Pipeline Management] Generate only the YAML configuration for a pipeline without creating it.\n\n" + "**๐Ÿ“‹ Use Cases:**\n" + "- Preview YAML before creating pipeline\n" + "- Generate YAML for manual deployment\n" + "- Debug pipeline configuration\n\n" + "**๐Ÿ“– Recommended Workflow:**\n" + "1. ๐ŸŽฏ Parse user description for explicit parameters\n" + "2. ๐Ÿ” If missing context, prefer IDE detection (terminal + file reading) over API calls\n" + "3. ๐Ÿš€ Call this tool with collected parameters\n\n" + "**๐Ÿ’ก Parameter Collection Strategy:**\n" + "- For QUICK pipeline creation: Use IDE detection (git config, file reading)\n" + "- For PRECISE parameter selection: Consider list_repositories, list_service_connections when needed\n" + "- Balance efficiency vs. accuracy based on user intent\n\n" + "**โšก Built-in capabilities:** Handles default service connections internally, auto-extracts project name from repo URL", inputSchema: zodToJsonSchema(types.CreatePipelineFromDescriptionSchema), }, { name: "create_pipeline_from_description", description: "[Pipeline Management] Create a pipeline using structured parameters extracted from user descriptions and environment context.\n\n" + "**๐Ÿ”ง Built-in Capabilities:**\n" + "- โœ… Automatically retrieves default service connection IDs when not specified\n" + "- โœ… Handles repository and service connection logic internally\n" + "- โœ… Auto-extracts project name from repository URL (git@host:org/repo.git โ†’ repo)\n" + "- โœ… Supports both IDE detection and explicit parameter specification\n\n" + "**๐Ÿ“– Recommended Workflow:**\n" + "1. ๐ŸŽฏ PARSE user description for explicit parameters\n" + "2. ๐Ÿ” DETECT missing info from IDE environment FIRST:\n" + " - Run `git config --get remote.origin.url` โ†’ repoUrl\n" + " - Run `git branch --show-current` โ†’ branch\n" + " - Auto-extract serviceName from repoUrl\n" + " - Check project files for tech stack:\n" + " * pom.xml โ†’ buildLanguage='java', buildTool='maven'\n" + " * build.gradle โ†’ buildLanguage='java', buildTool='gradle'\n" + " * package.json + package-lock.json โ†’ buildLanguage='nodejs', buildTool='npm'\n" + " * package.json + yarn.lock โ†’ buildLanguage='nodejs', buildTool='yarn'\n" + " * requirements.txt โ†’ buildLanguage='python', buildTool='pip'\n" + " * go.mod โ†’ buildLanguage='go', buildTool='go'\n" + " * *.csproj โ†’ buildLanguage='dotnet', buildTool='dotnet'\n" + "3. ๐Ÿš€ CALL this tool with collected parameters\n\n" + "**โš ๏ธ Important Guidelines:**\n" + "- DO NOT call list_repositories unless user explicitly asks to choose from available repositories\n" + "- DO NOT call list_service_connections unless user explicitly asks to choose from available connections\n" + "- ALWAYS try IDE detection first before making any API calls\n" + "- If IDE detection fails, THEN consider API calls as fallback\n\n" + "**๐ŸŽฏ Parameter Priority:**\n" + "1. ๐Ÿ‘ค USER EXPLICIT (highest) - buildLanguage, buildTool, versions, deployTarget\n" + "2. ๐Ÿ” IDE DETECTION (preferred) - repoUrl, branch, serviceName, tech stack\n" + "3. ๐Ÿค– TOOL DEFAULTS (automatic) - serviceConnectionId, organizationId\n\n" + "**๐Ÿ” IDE Detection Rules (MUST TRY FIRST):**\n" + "- ๐Ÿ“‚ Repository: `git config --get remote.origin.url` โ†’ repoUrl\n" + "- ๐ŸŒฟ Branch: `git branch --show-current` โ†’ branch\n" + "- ๐Ÿท๏ธ Service Name: Auto-extracted from repoUrl (git@host:org/repo.git โ†’ repo)\n" + "- โ˜• Java Maven: pom.xml exists โ†’ buildLanguage='java', buildTool='maven'\n" + "- ๐Ÿ—๏ธ Java Gradle: build.gradle exists โ†’ buildLanguage='java', buildTool='gradle'\n" + "- ๐ŸŸข Node npm: package.json + package-lock.json โ†’ buildLanguage='nodejs', buildTool='npm'\n" + "- ๐Ÿงถ Node yarn: package.json + yarn.lock โ†’ buildLanguage='nodejs', buildTool='yarn'\n" + "- ๐Ÿ Python: requirements.txt โ†’ buildLanguage='python', buildTool='pip'\n" + "- ๐Ÿน Go: go.mod โ†’ buildLanguage='go', buildTool='go'\n" + "- ๐Ÿ’™ .NET: *.csproj โ†’ buildLanguage='dotnet', buildTool='dotnet'\n\n" + "**๐Ÿ“ Version Detection (from project files):**\n" + "- โ˜• JDK: Read pom.xml <maven.compiler.source> โ†’ jdkVersion\n" + "- ๐ŸŸข Node: Read package.json engines.node โ†’ nodeVersion\n" + "- ๐Ÿ Python: Read .python-version, pyproject.toml โ†’ pythonVersion\n" + "- ๐Ÿน Go: Read go.mod go directive โ†’ goVersion\n\n" + "**๐ŸŽฏ Deployment Parsing:**\n" + "- '้ƒจ็ฝฒๅˆฐไธปๆœบ/VM/่™šๆ‹Ÿๆœบ' โ†’ deployTarget='vm'\n" + "- '้ƒจ็ฝฒๅˆฐKubernetes/K8s' โ†’ deployTarget='k8s'\n" + "- 'ๅชๆž„ๅปบ/ๆž„ๅปบๅˆถๅ“' โ†’ deployTarget='none'\n\n" + "**๐Ÿ”— Service Connection Strategy (3 scenarios):**\n" + "1. **User specifies ID explicitly** (e.g., 'ไฝฟ็”จๆœๅŠก่ฟžๆŽฅID abc123')\n" + " โ†’ โœ… Pass serviceConnectionId=abc123 directly, NO list_service_connections call needed\n" + "2. **User doesn't specify any ID** (most common case)\n" + " โ†’ โœ… Pass serviceConnectionId=null, tool will auto-retrieve default ID internally\n" + "3. **User wants to choose from available options** (e.g., 'ๆ˜พ็คบๅฏ็”จ็š„ๆœๅŠก่ฟžๆŽฅ่ฎฉๆˆ‘้€‰ๆ‹ฉ')\n" + " โ†’ ๐Ÿ” Call list_service_connections first, then let user choose, then create pipeline\n\n" + "**๐Ÿค” When to Use Other Tools:**\n" + "- User asks to \"select from available repositories\" โ†’ use list_repositories first\n" + "- User wants to \"choose from service connections\" โ†’ use list_service_connections first\n" + "- User wants to see options before deciding โ†’ gather info first, then create\n" + "- For quick creation with current repo โ†’ directly use IDE detection\n\n" + "**โœ… Required:** organizationId, name, buildLanguage, buildTool", inputSchema: zodToJsonSchema(types.CreatePipelineFromDescriptionSchema), }, { name: "smart_list_pipelines", description: "[Pipeline Management] Intelligently search pipelines with natural language time references (e.g., 'today', 'this week')", inputSchema: zodToJsonSchema( z.object({ organizationId: z.string().describe("Organization ID"), timeReference: z.string().optional().describe("Natural language time reference such as 'today', 'yesterday', 'this week', 'last month', etc."), pipelineName: z.string().optional().describe("Pipeline name filter"), statusList: z.string().optional().describe("Pipeline status list, comma separated (SUCCESS,RUNNING,FAIL,CANCELED,WAITING)"), perPage: z.number().int().min(1).max(30).default(10).optional().describe("Number of items per page"), page: z.number().int().min(1).default(1).optional().describe("Page number") }) ), }, { name: "create_pipeline_run", description: "[Pipeline Management] Run a pipeline with optional parameters", inputSchema: zodToJsonSchema(types.CreatePipelineRunSchema), }, { name: "get_latest_pipeline_run", description: "[Pipeline Management] Get information about the latest pipeline run", inputSchema: zodToJsonSchema(types.GetLatestPipelineRunSchema), }, { name: "get_pipeline_run", description: "[Pipeline Management] Get details of a specific pipeline run instance", inputSchema: zodToJsonSchema(types.GetPipelineRunSchema), }, { name: "list_pipeline_runs", description: "[Pipeline Management] Get a list of pipeline run instances with filtering options", inputSchema: zodToJsonSchema(types.ListPipelineRunsSchema), }, { name: "list_pipeline_jobs_by_category", description: "[Pipeline Management] Get pipeline execution tasks by category. Currently only supports DEPLOY category.", inputSchema: zodToJsonSchema(types.ListPipelineJobsByCategorySchema), }, { name: "list_pipeline_job_historys", description: "[Pipeline Management] Get the execution history of a pipeline task. Retrieve all execution records for a specific task in a pipeline.", inputSchema: zodToJsonSchema(types.ListPipelineJobHistorysSchema), }, { name: "execute_pipeline_job_run", description: "[Pipeline Management] Manually run a pipeline task. Start a specific job in a pipeline run instance.", inputSchema: zodToJsonSchema(types.ExecutePipelineJobRunSchema), }, { name: "get_pipeline_job_run_log", description: "[Pipeline Management] Get the execution logs of a pipeline job. Retrieve the log content for a specific job in a pipeline run.", inputSchema: zodToJsonSchema(types.GetPipelineJobRunLogSchema), }, { name: "update_pipeline", description: "[Pipeline Management] Update an existing pipeline in Yunxiao by pipelineId. Use this to update pipeline YAML, stages, jobs, etc.", inputSchema: zodToJsonSchema(types.UpdatePipelineSchema), }, ];

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/yjiace/alibabacloud-devops-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server