check-railway-status
Verify the installation and login status of the Railway CLI to ensure proper setup before using other Railway tools on the MCP Server.
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:4-32 (handler)Complete implementation of the 'check-railway-status' tool, including name, title, description, empty input schema, and the handler function that checks CLI status and returns formatted response.export const checkRailwayStatusTool = { name: "check-railway-status", title: "Check Railway CLI Status", description: "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.", inputSchema: {}, 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/tools/index.ts:1-1 (registration)Registration/export of the tool in the main tools index module, making it available for import alongside other tools.export { checkRailwayStatusTool } from "./check-railway-status";
- src/cli/core.ts:17-24 (helper)Supporting helper function called by the tool handler to verify if the Railway CLI is installed and the user is logged in by running version check and 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"); } };