Skip to main content
Glama
railwayapp

Railway MCP Server

Official
by railwayapp

List Railway Projects

list-projects

Retrieve all Railway cloud platform projects for your account to manage deployments, services, and environments.

Instructions

List all Railway projects for the currently logged in account

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The async handler function that fetches Railway projects using listRailwayProjects, maps and formats them into a markdown list grouped by project details, handles errors, and returns a formatted tool response.
    handler: async () => {
    	try {
    		const projects = await listRailwayProjects();
    
    		const projectList = projects.map((project) => ({
    			id: project.id,
    			name: project.name,
    			team: project.team?.name || "Unknown",
    			environments:
    				project.environments?.edges?.map((env) => env.node.name) || [],
    			services:
    				project.services?.edges?.map((service) => service.node.name) || [],
    			createdAt: project.createdAt,
    			updatedAt: project.updatedAt,
    		}));
    
    		const formattedList = projectList
    			.map(
    				(project) =>
    					`**${project.name}** (ID: ${project.id})\n` +
    					`Team: ${project.team}\n` +
    					`Environments: ${project.environments.join(", ")}\n` +
    					`Services: ${project.services.join(", ")}\n` +
    					`Created: ${new Date(project.createdAt).toLocaleDateString()}\n` +
    					`Updated: ${new Date(project.updatedAt).toLocaleDateString()}\n`,
    			)
    			.join("\n");
    
    		return createToolResponse(
    			`✅ Found ${projects.length} Railway project(s):\n\n${formattedList}\n\n**Note:** To link to one of these projects, run \`railway link\` manually.`,
    		);
    	} catch (error: unknown) {
    		const errorMessage =
    			error instanceof Error ? error.message : "Unknown error occurred";
    		return createToolResponse(
    			"❌ Failed to list Railway projects\n\n" +
    				`**Error:** ${errorMessage}\n\n` +
    				"**Next Steps:**\n" +
    				"• Ensure you are logged into Railway CLI (`railway login`)\n" +
    				"• Check that your authentication token is valid\n" +
    				"• Verify you have permissions to view projects\n" +
    				"• Try running `railway login` to refresh your authentication",
    		);
    	}
    },
  • Empty input schema as the tool requires no input parameters.
    inputSchema: {},
  • src/index.ts:21-31 (registration)
    Registers all imported tools (including 'list-projects') with the MCP server by looping through Object.values(tools) and calling server.registerTool with name, schema details, and handler.
    Object.values(tools).forEach((tool) => {
    	server.registerTool(
    		tool.name,
    		{
    			title: tool.title,
    			description: tool.description,
    			inputSchema: tool.inputSchema,
    		},
    		tool.handler,
    	);
    });
  • Core helper function that executes the 'railway list --json' CLI command to retrieve the list of Railway projects, with status check and error analysis.
    export const listRailwayProjects = async (): Promise<RailwayProject[]> => {
    	try {
    		await checkRailwayCliStatus();
    		const projects = await runRailwayJsonCommand("railway list --json");
    
    		if (!Array.isArray(projects)) {
    			throw new Error("Unexpected response format from Railway CLI");
    		}
    
    		return projects;
    	} catch (error: unknown) {
    		return analyzeRailwayError(error, "railway list --json");
    	}
    };
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden for behavioral disclosure. It states it's a list operation but doesn't describe return format (e.g., pagination, fields included), error conditions, or authentication requirements beyond 'currently logged in account'. This leaves significant gaps for a tool that likely returns structured data.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, clear sentence with zero waste. It's front-loaded with the core action and resource, and every word contributes to understanding the tool's purpose without redundancy or fluff.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no annotations and no output schema, the description is incomplete. It doesn't explain what the output looks like (e.g., list of project objects, error responses), which is critical for a list tool. While the purpose is clear, the lack of behavioral and output details makes it insufficient for full agent understanding.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 0 parameters with 100% coverage, so no parameter documentation is needed. The description appropriately doesn't discuss parameters, focusing on the tool's purpose. A baseline of 4 is applied since no parameters exist, and the description doesn't introduce unnecessary complexity.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('List all') and resource ('Railway projects'), specifying scope ('for the currently logged in account'). It distinguishes from siblings like 'create-project-and-link' or 'list-services' by focusing on projects only. However, it doesn't explicitly differentiate from other list tools like 'list-deployments' or 'list-services' beyond the resource name.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., authentication status), compare with other list tools, or indicate scenarios where it's preferred over other project-related tools like 'create-project-and-link'. The context is implied but not explicit.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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