invite-members-to-project
Add users to an Infisical project by specifying emails or usernames, assigning roles, and linking them to a specific project ID.
Instructions
Invite members to a project in Infisical
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| emails | No | The emails of the members to invite. Either usernames or emails must be provided. | |
| projectId | Yes | The ID of the project to invite members to (required) | |
| roleSlugs | No | The role slugs of the members to invite. If not provided, the default role 'member' will be used. Ask the user to confirm the role they want to use if not explicitly specified. | |
| usernames | No | The usernames of the members to invite. Either usernames or emails must be provided. |
Implementation Reference
- src/index.ts:660-678 (handler)Handler for the 'invite-members-to-project' tool: validates arguments using Zod schema, invokes infisicalSdk.projects().inviteMembers() with projectId, emails, usernames, and roleSlugs, and returns the result as text content.if (name === AvailableTools.InviteMembersToProject) { const data = inviteMembersToProjectSchema.zod.parse(args); const projectMemberships = await infisicalSdk.projects().inviteMembers({ projectId: data.projectId, emails: data.emails, usernames: data.usernames, roleSlugs: data.roleSlugs }); return { content: [ { type: "text", text: `Members successfully invited to project: ${JSON.stringify(projectMemberships, null, 3)}` } ] }; }
- src/index.ts:417-451 (schema)Schema definition including Zod validator and JSON schema for tool inputs: requires projectId, optional arrays for emails, usernames, and roleSlugs.const inviteMembersToProjectSchema = { zod: z.object({ projectId: z.string(), emails: z.array(z.string()).optional(), usernames: z.array(z.string()).optional(), roleSlugs: z.array(z.string()).optional() }), capability: { name: AvailableTools.InviteMembersToProject, description: "Invite members to a project in Infisical", inputSchema: { type: "object", properties: { projectId: { type: "string", description: "The ID of the project to invite members to (required)" }, emails: { type: "array", description: "The emails of the members to invite. Either usernames or emails must be provided." }, usernames: { type: "array", description: "The usernames of the members to invite. Either usernames or emails must be provided." }, roleSlugs: { type: "array", description: "The role slugs of the members to invite. If not provided, the default role 'member' will be used. Ask the user to confirm the role they want to use if not explicitly specified." } }, required: ["projectId"] } } };
- src/index.ts:452-467 (registration)Registration of all tools including 'invite-members-to-project' via the ListToolsRequestSchema handler, exposing the capability.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 'InviteMembersToProject = "invite-members-to-project"' used throughout.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" }