Skip to main content
Glama

check-railway-status

Verify Railway CLI installation and login status to ensure proper setup before using Railway cloud platform tools.

Instructions

Check whether the Railway CLI is installed and if the user is logged in. This tool helps agents verify the Railway CLI setup before attempting to use other Railway tools.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The main handler function for the 'check-railway-status' tool. It checks the Railway CLI status by calling checkRailwayCliStatus() and returns a formatted text response indicating success or failure with instructions.
    handler: async () => { try { await checkRailwayCliStatus(); return createToolResponse( "✅ Railway CLI Status Check Passed\n\n" + "• Railway CLI is installed and accessible\n" + "• User is authenticated and logged in\n\n" + "You can now use other Railway tools to manage your projects.", ); } catch (error: unknown) { const errorMessage = error instanceof Error ? error.message : "Unknown error occurred"; return createToolResponse( "❌ Railway CLI Status Check Failed\n\n" + `**Error:** ${errorMessage}\n\n` + "**Next Steps:**\n" + "• If Railway CLI is not installed: Install it from https://docs.railway.com/guides/cli\n" + "• If not logged in: Run `railway login` to authenticate\n" + "• If token is expired: Run `railway login` to refresh your authentication", ); } },
  • src/index.ts:21-31 (registration)
    Registers all tools from './tools/index.ts' (including 'checkRailwayStatusTool' renamed by its .name property 'check-railway-status') into the MCP server.
    Object.values(tools).forEach((tool) => { server.registerTool( tool.name, { title: tool.title, description: tool.description, inputSchema: tool.inputSchema, }, tool.handler, ); });
  • Helper function that verifies Railway CLI installation and authentication by running 'railway --version' and 'railway whoami' commands.
    export const checkRailwayCliStatus = async (): Promise<void> => { try { await runRailwayCommand("railway --version"); await runRailwayCommand("railway whoami"); } catch (error: unknown) { return analyzeRailwayError(error, "railway whoami"); } };
  • Utility function to create a standardized text response object for MCP tools.
    export const createToolResponse = (text: string) => ({ content: [{ type: "text" as const, text }], });

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

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