Skip to main content
Glama

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";

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