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
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/check-railway-status.ts:10-31 (handler)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, ); });
- src/cli/core.ts:17-24 (helper)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"); } };
- src/utils.ts:21-23 (helper)Utility function to create a standardized text response object for MCP tools.export const createToolResponse = (text: string) => ({ content: [{ type: "text" as const, text }], });