Skip to main content
Glama
Infisical

Infisical MCP Server

Official
by Infisical

create-environment

Set up new environments in Infisical by specifying project ID, name, and slug. This tool facilitates organized secret management within defined project structures.

Instructions

Create a new environment in Infisical

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesThe name of the environment to create (required)
positionNoThe position of the environment to create
projectIdYesThe ID of the project to create the environment in (required)
slugYesThe slug of the environment to create (required)

Implementation Reference

  • The main handler logic for the 'create-environment' tool. It validates input using Zod, calls the Infisical SDK to create the environment, and returns a success response with the created environment details.
    if (name === AvailableTools.CreateEnvironment) {
    	const data = createEnvironmentSchema.zod.parse(args);
    
    	const environment = await infisicalSdk.environments().create({
    		projectId: data.projectId,
    		name: data.name,
    		slug: data.slug,
    		position: data.position
    	});
    
    	return {
    		content: [
    			{
    				type: "text",
    				text: `Environment created successfully: ${JSON.stringify(environment, null, 3)}`
    			}
    		]
    	};
    }
  • Defines the Zod validation schema and the tool capability metadata (name, description, inputSchema) for the 'create-environment' tool.
    const createEnvironmentSchema = {
    	zod: z.object({
    		projectId: z.string(),
    		name: z.string(),
    		slug: z.string(),
    		position: z.number().optional()
    	}),
    	capability: {
    		name: AvailableTools.CreateEnvironment,
    		description: "Create a new environment in Infisical",
    		inputSchema: {
    			type: "object",
    			properties: {
    				projectId: {
    					type: "string",
    					description: "The ID of the project to create the environment in (required)"
    				},
    				name: {
    					type: "string",
    					description: "The name of the environment to create (required)"
    				},
    				slug: {
    					type: "string",
    					description: "The slug of the environment to create (required)"
    				},
    				position: {
    					type: "number",
    					description: "The position of the environment to create"
    				}
    			},
    
    			required: ["projectId", "name", "slug"]
    		}
    	}
    };
  • src/index.ts:452-467 (registration)
    Registers all tool capabilities, including 'create-environment', in the ListToolsRequestHandler, making the tool discoverable.
    server.setRequestHandler(ListToolsRequestSchema, async () => {
    	return {
    		tools: [
    			createSecretSchema.capability,
    			deleteSecretSchema.capability,
    			updateSecretSchema.capability,
    			listSecretsSchema.capability,
    			getSecretSchema.capability,
    			createProjectSchema.capability,
    			createEnvironmentSchema.capability,
    			createFolderSchema.capability,
    			inviteMembersToProjectSchema.capability,
    			listProjectsSchema.capability
    		]
    	};
    });
  • src/index.ts:64-64 (registration)
    Defines the string constant for the tool name in the AvailableTools enum, used in schema and handler.
    CreateEnvironment = "create-environment",
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states this is a creation operation, implying mutation, but doesn't cover critical aspects like required permissions, whether the operation is idempotent, rate limits, or what happens on success/failure. For a mutation tool with zero annotation coverage, this is a significant gap.

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

Conciseness5/5

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

The description is a single, efficient sentence that directly states the tool's purpose without unnecessary words. It's front-loaded with the core action and resource, making it easy to parse quickly.

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?

For a mutation tool with no annotations and no output schema, the description is incomplete. It doesn't explain what an 'environment' represents in Infisical's context, what happens after creation, or potential side effects. The agent would need to guess about the operation's behavior and outcomes.

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?

The description adds no parameter-specific information beyond what's already in the input schema, which has 100% coverage with clear descriptions for all 4 parameters. The baseline score of 3 reflects adequate schema documentation, but the description doesn't provide additional context like parameter relationships or usage examples.

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

Purpose4/5

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

The description clearly states the action ('Create') and the resource ('a new environment in Infisical'), making the purpose immediately understandable. However, it doesn't differentiate this tool from sibling tools like 'create-project' or 'create-folder', which would require specifying what distinguishes an 'environment' from other Infisical entities.

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?

The description provides no guidance on when to use this tool versus alternatives like 'create-project' or 'create-folder'. It doesn't mention prerequisites (e.g., needing an existing project), exclusions, or typical use cases, leaving the agent to infer context from parameter names alone.

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

Install Server

Other Tools

Related Tools

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/Infisical/infisical-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server