service_info
Retrieve detailed configuration, status, and health information for a specific service to monitor deployments and ensure proper functionality within your Railway infrastructure.
Instructions
[API] Get detailed information about a specific service
⚡️ Best for: ✓ Viewing service configuration and status ✓ Checking deployment details ✓ Monitoring service health
→ Prerequisites: service_list
→ Next steps: deployment_list, variable_list
→ Related: service_update, deployment_trigger
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| environmentId | Yes | ID of the environment to check (usually obtained from service_list) | |
| projectId | Yes | ID of the project containing the service | |
| serviceId | Yes | ID of the service to get information about |
Implementation Reference
- src/tools/service.tool.ts:52-54 (handler)Handler function that executes the 'service_info' tool logic by calling the service service's getServiceInfo method.async ({ projectId, serviceId, environmentId }) => { return serviceService.getServiceInfo(projectId, serviceId, environmentId); }
- src/tools/service.tool.ts:47-51 (schema)Zod input schema defining parameters for the 'service_info' tool.{ projectId: z.string().describe("ID of the project containing the service"), serviceId: z.string().describe("ID of the service to get information about"), environmentId: z.string().describe("ID of the environment to check (usually obtained from service_list)") },
- src/tools/service.tool.ts:31-55 (registration)Tool definition and registration within the serviceTools array using createTool.createTool( "service_info", formatToolDescription({ type: 'API', description: "Get detailed information about a specific service", bestFor: [ "Viewing service configuration and status", "Checking deployment details", "Monitoring service health" ], relations: { prerequisites: ["service_list"], nextSteps: ["deployment_list", "variable_list"], related: ["service_update", "deployment_trigger"] } }), { projectId: z.string().describe("ID of the project containing the service"), serviceId: z.string().describe("ID of the service to get information about"), environmentId: z.string().describe("ID of the environment to check (usually obtained from service_list)") }, async ({ projectId, serviceId, environmentId }) => { return serviceService.getServiceInfo(projectId, serviceId, environmentId); } ),
- Backend service method getServiceInfo that fetches service instance and recent deployments, formats the information, and returns a success response.async getServiceInfo(projectId: string, serviceId: string, environmentId: string) { try { const [serviceInstance, deployments] = await Promise.all([ this.client.services.getServiceInstance(serviceId, environmentId), this.client.deployments.listDeployments({ projectId, serviceId, environmentId, limit: 5 }) ]); if (!serviceInstance) { return createErrorResponse(`Service instance not found.`); } const deploymentStatus = deployments.length > 0 ? `\nLatest Deployment: ${deployments[0].status} (${deployments[0].id})` : '\nNo recent deployments'; const info = `🚀 Service: ${serviceInstance.serviceName} ID: ${serviceInstance.serviceId} Region: ${serviceInstance.region || 'Not set'} Replicas: ${serviceInstance.numReplicas || 1} Root Directory: ${serviceInstance.rootDirectory || '/'} Build Command: ${serviceInstance.buildCommand || 'Not set'} Start Command: ${serviceInstance.startCommand || 'Not set'} Health Check Path: ${serviceInstance.healthcheckPath || 'Not set'} Sleep Mode: ${serviceInstance.sleepApplication ? 'Enabled' : 'Disabled'}${deploymentStatus}`; return createSuccessResponse({ text: info, data: { serviceInstance, deployments } }); } catch (error) { return createErrorResponse(`Error getting service details: ${formatError(error)}`); } }
- src/tools/index.ts:16-37 (registration)Central registration function that collects all tools including serviceTools (containing service_info) and registers them with the MCP server.export function registerAllTools(server: McpServer) { // Collect all tools const allTools = [ ...databaseTools, ...deploymentTools, ...domainTools, ...projectTools, ...serviceTools, ...tcpProxyTools, ...variableTools, ...configTools, ...volumeTools, ...templateTools, ] as Tool[]; // Register each tool with the server allTools.forEach((tool) => { server.tool( ...tool ); }); }