Skip to main content
Glama

service_info

Retrieve detailed service information including configuration, deployment status, and health metrics for infrastructure management on Railway.app.

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 that executes the core logic of the 'service_info' tool by delegating to the service service.
    async ({ projectId, serviceId, environmentId }) => { return serviceService.getServiceInfo(projectId, serviceId, environmentId); }
  • Zod input schema 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 created and registered locally in 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); } ),
  • Global registration of all tools including serviceTools (which contains service_info) to 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 ); }); }
  • Supporting method that implements the actual API calls to retrieve service instance details and recent deployments.
    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