Skip to main content
Glama
Infisical

Infisical MCP Server

Official
by Infisical

create-secret

Add a new secret to a specified project and environment in Infisical, defining its name, value, and path for secure storage and management.

Instructions

Create a new secret in Infisical

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
environmentSlugYesThe slug of the environment to create the secret in (required)
projectIdYesThe ID of the project to create the secret in (required)
secretNameYesThe name of the secret to create (required)
secretPathNoThe path of the secret to create (Defaults to /)
secretValueNoThe value of the secret to create

Implementation Reference

  • Handler logic for the 'create-secret' tool: parses arguments using Zod, invokes Infisical SDK's createSecret method, and returns a success response with the created secret details.
    if (name === AvailableTools.CreateSecret) {
    	const data = createSecretSchema.zod.parse(args);
    
    	const { secret } = await infisicalSdk.secrets().createSecret(data.secretName, {
    		environment: data.environmentSlug,
    		projectId: data.projectId,
    		secretPath: data.secretPath,
    		secretValue: data.secretValue ?? ""
    	});
    
    	return {
    		content: [
    			{
    				type: "text",
    				text: `Secret created successfully: ${JSON.stringify(secret, null, 3)}`
    			}
    		]
    	};
    }
  • Input schema definition using Zod and MCP capability spec for the 'create-secret' tool.
    const createSecretSchema = {
    	zod: z.object({
    		projectId: z.string(),
    		environmentSlug: z.string(),
    		secretName: z.string(),
    		secretValue: z.string().optional(),
    		secretPath: z.string().default("/")
    	}),
    	capability: {
    		name: AvailableTools.CreateSecret,
    		description: "Create a new secret in Infisical",
    		inputSchema: {
    			type: "object",
    			properties: {
    				projectId: {
    					type: "string",
    					description: "The ID of the project to create the secret in (required)"
    				},
    				environmentSlug: {
    					type: "string",
    					description: "The slug of the environment to create the secret in (required)"
    				},
    				secretName: {
    					type: "string",
    					description: "The name of the secret to create (required)"
    				},
    				secretValue: {
    					type: "string",
    					description: "The value of the secret to create"
    				},
    				secretPath: {
    					type: "string",
    					description: "The path of the secret to create (Defaults to /)"
    				}
    			},
    			required: ["projectId", "environmentSlug", "secretName"]
    		}
    	}
    };
  • src/index.ts:452-467 (registration)
    Registration of the 'create-secret' tool (via its capability) in the list of available tools returned by ListToolsRequestSchema handler.
    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:57-68 (registration)
    Enum defining the tool name constant 'create-secret' used throughout the implementation.
    enum AvailableTools {
    	CreateSecret = "create-secret",
    	DeleteSecret = "delete-secret",
    	UpdateSecret = "update-secret",
    	ListSecrets = "list-secrets",
    	GetSecret = "get-secret",
    	CreateProject = "create-project",
    	CreateEnvironment = "create-environment",
    	CreateFolder = "create-folder",
    	InviteMembersToProject = "invite-members-to-project",
    	ListProjects = "list-projects"
    }
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure but only states the basic action. It doesn't mention authentication requirements, rate limits, whether the operation is idempotent, what happens if a secret already exists, or any side effects. For a mutation tool that creates sensitive data, 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 states the core purpose without unnecessary words. It's appropriately sized and front-loaded with the essential information.

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 that creates sensitive secrets with no annotations and no output schema, the description is inadequate. It doesn't explain what the tool returns, error conditions, or important behavioral aspects like whether secret values are encrypted at rest. The context demands more completeness.

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 description coverage is 100%, so the schema already documents all 5 parameters thoroughly. The description adds no additional parameter information beyond what's in the schema, meeting the baseline expectation but not providing extra value.

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 a new secret') and target resource ('in Infisical'), providing a specific verb+resource combination. However, it doesn't distinguish this tool from its sibling 'update-secret' or explain when to create versus update an existing secret.

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 'update-secret' or 'get-secret'. There's no mention of prerequisites, appropriate contexts, or exclusions, leaving the agent without usage direction beyond the basic purpose.

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