create-folder
Create and organize folders in Infisical for structured secret management. Specify folder name, project ID, environment, optional path, and description for efficient organization.
Instructions
Create a new folder in Infisical
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| description | No | The description of the folder to create | |
| environment | Yes | The environment to create the folder in (required) | |
| name | Yes | The name of the folder to create (required) | |
| path | No | The path to create the folder in (Defaults to /) | |
| projectId | Yes | The project to create the folder in (required) |
Implementation Reference
- src/index.ts:639-658 (handler)Handler for the 'create-folder' tool: validates input using Zod schema, creates the folder via Infisical SDK, and returns the result as text content.if (name === AvailableTools.CreateFolder) { const data = createFolderSchema.zod.parse(args); const folder = await infisicalSdk.folders().create({ description: data.description, environment: data.environment, name: data.name, path: data.path, projectId: data.projectId }); return { content: [ { type: "text", text: `Folder created successfully: ${JSON.stringify(folder, null, 3)}` } ] }; }
- src/index.ts:358-396 (schema)Input schema (Zod and JSON Schema capability) defining parameters for the 'create-folder' tool: projectId, environment, name, path, description.const createFolderSchema = { zod: z.object({ description: z.string().optional(), environment: z.string(), name: z.string(), path: z.string().default("/"), projectId: z.string() }), capability: { name: AvailableTools.CreateFolder, description: "Create a new folder in Infisical", inputSchema: { type: "object", properties: { description: { type: "string", description: "The description of the folder to create" }, environment: { type: "string", description: "The environment to create the folder in (required)" }, name: { type: "string", description: "The name of the folder to create (required)" }, path: { type: "string", description: "The path to create the folder in (Defaults to /)" }, projectId: { type: "string", description: "The project to create the folder in (required)" } }, required: ["name", "projectId", "environment"] } } };
- src/index.ts:452-467 (registration)Tool registration in ListToolsRequestSchema handler by including createFolderSchema.capability in the list of available tools.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 (helper)Enum defining all tool names as constants, including CreateFolder = "create-folder", used for matching tool names in handlers and schemas.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" }