project_environments
Retrieve all environments for a specific project to manage deployment configurations and variables across different stages.
Instructions
List all environments in a project
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| projectId | Yes | ID of the project |
Implementation Reference
- src/services/project.service.ts:107-132 (handler)Executes the core logic for listing project environments: queries the Railway API client, formats detailed environment information (name, ID, creation date, ephemeral status, unmerged changes), handles empty results and errors.async listEnvironments(projectId: string) { try { const environments = await this.client.projects.listEnvironments(projectId); if (environments.length === 0) { return createSuccessResponse({ text: "No environments found in this project.", data: [] }); } const environmentDetails = environments.map(env => `🌍 ${env.name} (ID: ${env.id}) Created: ${new Date(env.createdAt).toLocaleString()} ${env.isEphemeral ? '(Ephemeral)' : '(Permanent)'} ${env.unmergedChangesCount ? `Unmerged Changes: ${env.unmergedChangesCount}` : ''}` ); return createSuccessResponse({ text: `Environments in project:\n\n${environmentDetails.join('\n\n')}`, data: environments }); } catch (error) { return createErrorResponse(`Error listing environments: ${formatError(error)}`); } }
- src/tools/project.tool.ts:109-118 (registration)Registers the 'project_environments' tool with description, input schema requiring projectId, and handler that delegates to projectService.listEnvironments.createTool( "project_environments", "List all environments in a project", { projectId: z.string().describe("ID of the project") }, async ({projectId}) => { return projectService.listEnvironments(projectId); } )
- src/tools/project.tool.ts:113-114 (schema)Zod schema defining the required 'projectId' string input parameter.projectId: z.string().describe("ID of the project") },