@railway/mcp-server
Version: 
Official Railway MCP server
28 lines (25 loc) • 1.33 kB
JavaScript
import { checkRailwayCliStatus } from "./core-BMlc7cvF.js";
import { createToolResponse } from "./utils-Cvxm88Gr.js";
//#region src/tools/check-railway-status.ts
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\nYou can now use other Railway tools to manage your projects.");
		} catch (error) {
			const errorMessage = error instanceof Error ? error.message : "Unknown error occurred";
			return createToolResponse(`❌ Railway CLI Status Check Failed
**Error:** ${errorMessage}\n\n**Next Steps:**
• If Railway CLI is not installed: Install it from https://docs.railway.com/guides/cli
• If not logged in: Run \`railway login\` to authenticate
• If token is expired: Run \`railway login\` to refresh your authentication`);
		}
	}
};
//#endregion
export { checkRailwayStatusTool };
//# sourceMappingURL=check-railway-status-Dk2GHwtA.js.map