Skip to main content
Glama
railwayapp

Railway MCP Server

Official
by railwayapp

List Railway Services

list-services

Display all services in your current Railway project to manage deployments and configurations.

Instructions

List all services for the currently linked Railway project

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
workspacePathYesThe path to the workspace to list services from

Implementation Reference

  • The main handler function that executes the list-services tool logic, calling getRailwayServices and formatting success/error responses.
    handler: async ({ workspacePath }: GetServicesOptions) => {
    	try {
    		const result = await getRailwayServices({ workspacePath });
    
    		if (!result.success) {
    			throw new Error(result.error);
    		}
    
    		const services = result.services || [];
    
    		if (services.length === 0) {
    			return createToolResponse(
    				"ℹ️ No services found for the currently linked Railway project.\n\n" +
    					"**Next Steps:**\n" +
    					"• Ensure you have a project linked (`railway link`)\n" +
    					"• Check that your project has services created\n" +
    					"• Create a new service through the Railway dashboard or CLI",
    			);
    		}
    
    		const formattedList = services
    			.map((service, index) => `${index + 1}. **${service}**`)
    			.join("\n");
    
    		return createToolResponse(
    			`✅ Found ${services.length} service(s) in the linked Railway project:\n\n${formattedList}\n\n**Note:** To link to a specific service, use the \`link-service\` tool.`,
    		);
    	} catch (error: unknown) {
    		const errorMessage =
    			error instanceof Error ? error.message : "Unknown error occurred";
    		return createToolResponse(
    			"❌ Failed to list Railway services\n\n" +
    				`**Error:** ${errorMessage}\n\n` +
    				"**Next Steps:**\n" +
    				"• Ensure you are logged into Railway CLI (`railway login`)\n" +
    				"• Check that you have a project linked (`railway link`)\n" +
    				"• Verify you have permissions to view services\n" +
    				"• Try running `railway login` to refresh your authentication",
    		);
    	}
    },
  • Zod input schema defining the workspacePath parameter for the tool.
    inputSchema: {
    	workspacePath: z
    		.string()
    		.describe("The path to the workspace to list services from"),
    },
  • src/index.ts:21-31 (registration)
    Registration of all tools (including list-services) into the MCP server via dynamic loop over tools object.
    Object.values(tools).forEach((tool) => {
    	server.registerTool(
    		tool.name,
    		{
    			title: tool.title,
    			description: tool.description,
    			inputSchema: tool.inputSchema,
    		},
    		tool.handler,
    	);
    });
  • Export of the listServicesTool making it available for import in src/index.ts.
    export { listServicesTool } from "./list-services";
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions the scope ('currently linked Railway project') but fails to describe return format, pagination, error conditions, or authentication needs. For a read operation with zero annotation coverage, this leaves significant gaps in understanding how the tool behaves.

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, efficient sentence that directly states the tool's purpose without unnecessary words. It is appropriately sized and front-loaded, with zero waste.

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 the tool's simplicity (1 parameter, no output schema, no annotations), the description is minimal but incomplete. It lacks details on return values, error handling, and usage context relative to siblings, making it insufficient for full agent understanding despite the low complexity.

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

Parameters3/5

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

Schema description coverage is 100%, so the schema fully documents the single parameter 'workspacePath'. The description adds no additional meaning beyond implying context about the linked project, which doesn't enhance parameter understanding. Baseline 3 is appropriate when the schema does all the work.

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 services') and the target resource ('for the currently linked Railway project'), providing specific verb+resource pairing. However, it doesn't distinguish this tool from sibling tools like 'list-projects' or 'list-deployments' beyond the resource type, missing explicit differentiation.

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 like 'list-projects' or 'list-deployments', nor does it mention prerequisites such as having a linked project. It only states the basic function without contextual usage information.

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