deployment_list
Track and review recent service deployment history in a specific environment using the deployment_list API. Monitor updates, analyze changes, and manage infrastructure effectively with clear deployment insights.
Instructions
[API] List recent deployments for a service in a specific environment
⚡️ Best for: ✓ Viewing deployment history ✓ Monitoring service updates
→ Prerequisites: service_list
→ Next steps: deployment_logs, deployment_trigger
→ Related: service_info, service_restart
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| environmentId | Yes | ID of the environment to list deployments from (usually obtained from service_list) | |
| limit | No | Optional: Maximum number of deployments to return (default: 10) | |
| projectId | Yes | ID of the project containing the service | |
| serviceId | Yes | ID of the service to list deployments for |
Implementation Reference
- src/tools/deployment.tool.ts:27-29 (handler)The async handler function that executes the deployment_list tool logic by calling deploymentService.listDeployments.async ({ projectId, serviceId, environmentId, limit = 10 }) => { return deploymentService.listDeployments(projectId, serviceId, environmentId, limit); }
- src/tools/deployment.tool.ts:21-25 (schema)Zod schema defining the input parameters for the deployment_list tool.{ projectId: z.string().describe("ID of the project containing the service"), serviceId: z.string().describe("ID of the service to list deployments for"), environmentId: z.string().describe("ID of the environment to list deployments from (usually obtained from service_list)"), limit: z.number().optional().describe("Optional: Maximum number of deployments to return (default: 10)")
- src/tools/deployment.tool.ts:5-30 (registration)The deploymentTools array where deployment_list is defined and exported for global registration.export const deploymentTools = [ createTool( "deployment_list", formatToolDescription({ type: 'API', description: "List recent deployments for a service in a specific environment", bestFor: [ "Viewing deployment history", "Monitoring service updates" ], relations: { prerequisites: ["service_list"], nextSteps: ["deployment_logs", "deployment_trigger"], related: ["service_info", "service_restart"] } }), { projectId: z.string().describe("ID of the project containing the service"), serviceId: z.string().describe("ID of the service to list deployments for"), environmentId: z.string().describe("ID of the environment to list deployments from (usually obtained from service_list)"), limit: z.number().optional().describe("Optional: Maximum number of deployments to return (default: 10)") }, async ({ projectId, serviceId, environmentId, limit = 10 }) => { return deploymentService.listDeployments(projectId, serviceId, environmentId, limit); } ),
- src/tools/index.ts:32-36 (registration)Global registration of all tools, including deployment_list, to the MCP server.allTools.forEach((tool) => { server.tool( ...tool ); });
- The DeploymentService.listDeployments method implementing the core logic called by the tool handler.async listDeployments(projectId: string, serviceId: string, environmentId: string, limit: number = 5) { try { const deployments = await this.client.deployments.listDeployments({ projectId, serviceId, environmentId, limit }); if (deployments.length === 0) { return createSuccessResponse({ text: "No deployments found for this service.", data: [] }); } const deploymentDetails = deployments.map(deployment => { const status = deployment.status.toLowerCase(); const emoji = status === 'success' ? '✅' : status === 'failed' ? '❌' : '🔄'; return `${emoji} Deployment ${deployment.id} Status: ${deployment.status} Created: ${new Date(deployment.createdAt).toLocaleString()} Service: ${deployment.serviceId} ${deployment.url ? `URL: ${deployment.url}` : ''}`; }); return createSuccessResponse({ text: `Recent deployments:\n\n${deploymentDetails.join('\n\n')}`, data: deployments }); } catch (error) { return createErrorResponse(`Error listing deployments: ${formatError(error)}`); } }