Skip to main content
Glama

create-user

Create a new user in a Descope project by specifying login identifiers, contact details, roles, and tenant associations for authentication management.

Instructions

Create a new user in Descope project

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
loginIdYesPrimary login identifier for the user
additionalLoginIdsNoAdditional login identifiers
emailNoUser's email address
verifiedEmailNoWhether the email is pre-verified
phoneNoUser's phone number in E.164 format
verifiedPhoneNoWhether the phone is pre-verified
displayNameNoUser's display name
givenNameNoUser's given/first name
middleNameNoUser's middle name
familyNameNoUser's family/last name
pictureNoURL to user's profile picture
rolesNoGlobal role names to assign to the user
userTenantsNoTenant associations with specific roles
ssoAppIdsNoSSO application IDs to associate
customAttributesNoCustom attributes for the user

Implementation Reference

  • Handler function that executes the create-user tool by calling descope.management.user.create with the provided loginId and options.
    async ({ loginId, ...options }) => {
        try {
            const user = await descope.management.user.create(loginId, options);
    
            return {
                content: [
                    {
                        type: "text",
                        text: `Successfully created user:\n\n${JSON.stringify(user.data, null, 2)}`,
                    },
                ],
            };
        } catch (error) {
            return {
                content: [
                    {
                        type: "text",
                        text: `Error creating user: ${error}`,
                    },
                ],
            };
        }
    },
  • Zod schema defining the input parameters for the create-user tool.
    {
        loginId: z.string()
            .describe("Primary login identifier for the user"),
        additionalLoginIds: z.array(z.string()).optional()
            .describe("Additional login identifiers"),
        email: z.string().email().optional()
            .describe("User's email address"),
        verifiedEmail: z.boolean().optional()
            .describe("Whether the email is pre-verified"),
        phone: z.string().optional()
            .describe("User's phone number in E.164 format"),
        verifiedPhone: z.boolean().optional()
            .describe("Whether the phone is pre-verified"),
        displayName: z.string().optional()
            .describe("User's display name"),
        givenName: z.string().optional()
            .describe("User's given/first name"),
        middleName: z.string().optional()
            .describe("User's middle name"),
        familyName: z.string().optional()
            .describe("User's family/last name"),
        picture: z.string().url().optional()
            .describe("URL to user's profile picture"),
        roles: z.array(z.string()).optional()
            .describe("Global role names to assign to the user"),
        userTenants: z.array(z.object({
            tenantId: z.string(),
            roleNames: z.array(z.string()),
        })).optional()
            .describe("Tenant associations with specific roles"),
        ssoAppIds: z.array(z.string()).optional()
            .describe("SSO application IDs to associate"),
        customAttributes: z.record(z.any()).optional()
            .describe("Custom attributes for the user"),
    },
  • src/descope.ts:170-231 (registration)
    Registration of the create-user tool using server.tool(), including name, description, schema, and handler.
    server.tool(
        "create-user",
        "Create a new user in Descope project",
        {
            loginId: z.string()
                .describe("Primary login identifier for the user"),
            additionalLoginIds: z.array(z.string()).optional()
                .describe("Additional login identifiers"),
            email: z.string().email().optional()
                .describe("User's email address"),
            verifiedEmail: z.boolean().optional()
                .describe("Whether the email is pre-verified"),
            phone: z.string().optional()
                .describe("User's phone number in E.164 format"),
            verifiedPhone: z.boolean().optional()
                .describe("Whether the phone is pre-verified"),
            displayName: z.string().optional()
                .describe("User's display name"),
            givenName: z.string().optional()
                .describe("User's given/first name"),
            middleName: z.string().optional()
                .describe("User's middle name"),
            familyName: z.string().optional()
                .describe("User's family/last name"),
            picture: z.string().url().optional()
                .describe("URL to user's profile picture"),
            roles: z.array(z.string()).optional()
                .describe("Global role names to assign to the user"),
            userTenants: z.array(z.object({
                tenantId: z.string(),
                roleNames: z.array(z.string()),
            })).optional()
                .describe("Tenant associations with specific roles"),
            ssoAppIds: z.array(z.string()).optional()
                .describe("SSO application IDs to associate"),
            customAttributes: z.record(z.any()).optional()
                .describe("Custom attributes for the user"),
        },
        async ({ loginId, ...options }) => {
            try {
                const user = await descope.management.user.create(loginId, options);
    
                return {
                    content: [
                        {
                            type: "text",
                            text: `Successfully created user:\n\n${JSON.stringify(user.data, null, 2)}`,
                        },
                    ],
                };
            } catch (error) {
                return {
                    content: [
                        {
                            type: "text",
                            text: `Error creating user: ${error}`,
                        },
                    ],
                };
            }
        },
    );
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. While 'Create' implies a write operation, the description doesn't address important behavioral aspects like required permissions, whether the operation is idempotent, what happens on duplicate login IDs, or what the response contains. For a mutation tool with 15 parameters, this is insufficient.

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 for a tool with a clear primary function, though the brevity comes at the cost of missing important contextual 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 complex user creation tool with 15 parameters, no annotations, and no output schema, the description is inadequate. It doesn't explain what happens after creation, what validation occurs, or how errors are handled. The agent would need to rely heavily on the parameter schema alone without understanding the broader behavioral context.

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 input schema has 100% description coverage, so all parameters are documented in the schema itself. The description adds no additional parameter information beyond what's already in the schema descriptions. This meets the baseline expectation when schema coverage is complete.

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 resource ('new user in Descope project'), making the purpose immediately understandable. However, it doesn't differentiate this tool from its sibling 'invite-user', which likely serves a related but distinct purpose for user management.

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 'invite-user'. There's no mention of prerequisites, constraints, or typical use cases, leaving the agent to infer appropriate usage from the tool name 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

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/descope-sample-apps/descope-mcp-server'

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