Skip to main content
Glama

service_info

Retrieve detailed information about a specific Railway service, including configuration, deployment status, and health metrics for monitoring and management.

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
NameRequiredDescriptionDefault
projectIdYesID of the project containing the service
serviceIdYesID of the service to get information about
environmentIdYesID of the environment to check (usually obtained from service_list)

Implementation Reference

  • The handler function for the 'service_info' MCP tool. It takes projectId, serviceId, and environmentId as inputs and delegates to serviceService.getServiceInfo() to fetch the service details.
    async ({ projectId, serviceId, environmentId }) => { return serviceService.getServiceInfo(projectId, serviceId, environmentId); }
  • Zod input schema for the 'service_info' tool defining the required parameters: projectId, serviceId, and environmentId.
    { 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)") },
  • The 'service_info' tool is registered using createTool(), which defines its name, description, schema, and handler. This is added to the serviceTools array that gets exported and later registered with the MCP server.
    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); } ),
  • All tools, including 'service_info' from serviceTools, are collected and registered with the MCP server using server.tool() in the registerAllTools function.
    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 ); }); }
  • The core helper method getServiceInfo() in ServiceService that fetches service instance details and recent deployments using the client API, formats the response, and is called by the tool handler.
    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)}`); } }

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