Skip to main content
Glama

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
NameRequiredDescriptionDefault
projectIdYesID of the project

Implementation Reference

  • 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)}`);
        }
      }
  • 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);
      }
    )
  • Zod schema defining the required 'projectId' string input parameter.
      projectId: z.string().describe("ID of the project")
    },

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

C2.9/5.0
Behavior1/5

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

Description provides no behavioral traits: not stating it is read-only (though likely), no mention of permissions, rate limits, or side effects. Annotations are missing entirely, placing full burden on description, which fails.

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

Conciseness4/5

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

Description is extremely concise (one sentence) with no wasteful words. However, it may be too brief for a tool with no output schema or annotations, slightly reducing score.

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 low complexity (1 param, no output schema, no annotations), description should provide richer context like expected return format, pagination, or filters. It lacks any such detail, making it incomplete.

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 coverage is 100% as the sole parameter 'projectId' is described as 'ID of the project'. Description adds no extra meaning beyond the schema, so baseline score of 3 is appropriate.

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

Purpose5/5

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

Description clearly states the action ('List') and resource ('environments') with scope ('in a project'), using a specific verb and noun. It distinguishes from sibling tools like project_list or deployment_list, which target different resources.

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?

No guidance on when to use this tool vs alternatives, no prerequisites or exclusions. The agent is left to infer usage from context alone.

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