Skip to main content
Glama

deployment_list

View recent deployment history for a specific service environment to monitor updates and track changes in your Railway infrastructure.

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
NameRequiredDescriptionDefault
projectIdYesID of the project containing the service
serviceIdYesID of the service to list deployments for
environmentIdYesID of the environment to list deployments from (usually obtained from service_list)
limitNoOptional: Maximum number of deployments to return (default: 10)

Implementation Reference

  • Handler function for the 'deployment_list' tool that delegates to deploymentService.listDeployments.
    async ({ projectId, serviceId, environmentId, limit = 10 }) => { return deploymentService.listDeployments(projectId, serviceId, environmentId, limit); }
  • Input schema using Zod for validating parameters of 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)") },
  • The createTool invocation that defines, including name, description, schema, and handler, and adds it to the deploymentTools export array for later registration.
    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); } ),
  • Registers all tools, including 'deployment_list', with the MCP server by spreading the tool objects into server.tool().
    allTools.forEach((tool) => { server.tool( ...tool ); });
  • Core implementation logic for listing deployments, called by the tool handler, formats results with emojis and details.
    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)}`); } }

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/epitaphe360/railway-mcp'

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