project_list
Retrieve a comprehensive list of all projects in your Railway account, including project IDs, to streamline project discovery and management.
Instructions
[API] List all projects in your Railway account
⚡️ Best for: ✓ Getting an overview of all projects ✓ Finding project IDs ✓ Project discovery and management
→ Next steps: project_info, service_list
→ Related: project_create, project_delete
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Input Schema (JSON Schema)
{
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {},
"type": "object"
}
Implementation Reference
- src/tools/project.tool.ts:22-24 (handler)The handler function for the 'project_list' tool, which delegates to projectService.listProjects() to fetch and format the list of projects.async () => { return projectService.listProjects(); }
- src/tools/project.tool.ts:5-25 (registration)Creation of the 'project_list' tool using createTool, including description, empty input schema, and handler. Exported as part of projectTools.export const projectTools = [ createTool( "project_list", formatToolDescription({ type: 'API', description: "List all projects in your Railway account", bestFor: [ "Getting an overview of all projects", "Finding project IDs", "Project discovery and management" ], relations: { nextSteps: ["project_info", "service_list"], related: ["project_create", "project_delete"] } }), {}, async () => { return projectService.listProjects(); } ),
- src/tools/index.ts:16-37 (registration)Registration of all tools with the MCP server, including 'project_list' via projectTools import and server.tool() call.export function registerAllTools(server: McpServer) { // Collect all tools const allTools = [ ...databaseTools, ...deploymentTools, ...domainTools, ...projectTools, ...serviceTools, ...tcpProxyTools, ...variableTools, ...configTools, ...volumeTools, ...templateTools, ] as Tool[]; // Register each tool with the server allTools.forEach((tool) => { server.tool( ...tool ); }); }
- Core implementation in ProjectService.listProjects(): fetches projects via API client, formats a detailed text summary, and returns structured response.async listProjects() { try { const projects = await this.client.projects.listProjects(); if (projects.length === 0) { return createSuccessResponse({ text: "No projects found.", data: [] }); } const projectDetails = projects.map(project => { const environments = project.environments?.edges?.length || 0; const services = project.services?.edges?.length || 0; return `📁 ${project.name} (ID: ${project.id}) Description: ${project.description || 'No description'} Environments: ${environments} ${environments > 0 ? `${project.environments.edges.map(edge => `- ${edge.node.name} (${edge.node.id})`).join('\n')}` : ''} Services: ${services} ${services > 0 ? `${project.services.edges.map(edge => `- ${edge.node.name} (${edge.node.id})`).join('\n')}` : ''} Created: ${new Date(project.createdAt).toLocaleString()}`; }); return createSuccessResponse({ text: `Projects:\n\n${projectDetails.join('\n\n')}`, data: projects }); } catch (error) { return createErrorResponse(`Error listing projects: ${formatError(error)}`); } }