create_environment
Create a new environment (e.g., production, staging) within a specified project using the project UUID and environment name.
Instructions
Create a new environment in a project
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| project_uuid | Yes | Project UUID | |
| name | Yes | Environment name (e.g., production, staging) |
Implementation Reference
- src/tools/handlers.ts:122-125 (handler)Handler for create_environment tool: validates required params (project_uuid, name) and sends a POST request to /projects/{project_uuid}/environments to create the environment.
case 'create_environment': requireParam(args, 'project_uuid'); requireParam(args, 'name'); return client.post(`/projects/${args.project_uuid}/environments`, args); - src/tools/definitions.ts:241-252 (schema)Schema definition for create_environment tool: requires project_uuid and name as string inputs.
{ name: 'create_environment', description: 'Create a new environment in a project', inputSchema: { type: 'object', properties: { project_uuid: { type: 'string', description: 'Project UUID' }, name: { type: 'string', description: 'Environment name (e.g., production, staging)' } }, required: ['project_uuid', 'name'] } }, - src/types.ts:127-130 (schema)TypeScript interface for CreateEnvironmentInput, defining the shape of input data for creating an environment.
export interface CreateEnvironmentInput { project_uuid: string; name: string; } - src/index.ts:36-38 (registration)Tool registration via MCP ListToolsRequestSchema handler which returns all tool definitions (including create_environment) via getToolDefinitions().
this.server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools: getToolDefinitions() })); - src/tools/handlers.ts:527-531 (helper)Helper function used by the create_environment handler to validate that required parameters are provided.
function requireParam(args: ToolArgs, param: string): void { if (!args[param]) { throw new McpError(ErrorCode.InvalidParams, `${param} is required`); } }