Skip to main content
Glama

create_user

Creates a new user with required name and email, and optional settings like locale, newsletter, address, and authentication.

Instructions

Create a user.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
first_nameYesFirst name of the user.
middle_nameNoMiddle name of the user.
last_nameYesLast name of the user.
emailYesThe e-mail of the user.
localeNo
wants_newsletterNoBoolean representing the possibility of the user to receive newsletters.
with_authenticationNoIf the user should be able to login and thus receive login details by mail. Only relevant when creating the user.
customNoThe custom properties of the user.
address_attributesNo
invoice_address_attributesNo
label_idsNoAn array containing the identifiers of the labels associated with the user. When updating this array, the existing labels are replaced with the new ones provided.

Implementation Reference

  • The handler function for the 'create_user' tool. It accepts the validated input body, calls apiPost to POST /users, logs the response, and formats the result using formatCreate.
    server.registerTool(
      "create_user",
      {
        description: "Create a user.",
        annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: false },
        inputSchema: {
          first_name: z.string().describe("First name of the user."),
          middle_name: z.string().optional().describe("Middle name of the user."),
          last_name: z.string().describe("Last name of the user."),
          email: z.string().describe("The e-mail of the user."),
          locale: userLocaleEnum.optional(),
          wants_newsletter: z
            .boolean()
            .optional()
            .describe("Boolean representing the possibility of the user to receive newsletters."),
          with_authentication: z
            .boolean()
            .optional()
            .describe(
              "If the user should be able to login and thus receive login details by mail. Only relevant when creating the user.",
            ),
          custom: z.object({}).optional().describe("The custom properties of the user."),
          address_attributes: z
            .object({
              addressee: z.string().optional().describe("The addressee of the address."),
              address: z.string().describe("Concatenation of the street and house number."),
              address_line2: z.string().optional().describe("A string representing the second line of the address."),
              postal_code: z.string().describe("A string representing the postal code."),
              city: z.string().describe("A string representing the city."),
              state_province: z.string().optional().describe("An letter USA state code."),
              country: z.string().describe("An ISO3166 two-letter country code."),
            })
            .optional(),
          invoice_address_attributes: z
            .object({
              addressee: z.string().optional().describe("The addressee of the address."),
              address: z.string().describe("Concatenation of the street and house number."),
              address_line2: z.string().optional().describe("A string representing the second line of the address."),
              postal_code: z.string().describe("A string representing the postal code."),
              city: z.string().describe("A string representing the city."),
              state_province: z.string().optional().describe("An letter USA state code."),
              country: z.string().describe("An ISO3166 two-letter country code."),
            })
            .optional(),
          label_ids: z
            .array(z.number().int())
            .optional()
            .describe(
              "An array containing the identifiers of the labels associated with the user. When updating this array, the existing labels are replaced with the new ones provided.\n",
            ),
        },
      },
      async (body) => {
        try {
          const record = await apiPost<EduframeRecord>("/users", body);
          void logResponse("create_user", body, record);
          return formatCreate(record, "user");
        } catch (error) {
          return formatError(error);
        }
      },
    );
  • Input schema (inputSchema) for create_user, defined inline using Zod for validation. Includes fields like first_name, middle_name, last_name, email, locale, wants_newsletter, with_authentication, custom, address_attributes, invoice_address_attributes, and label_ids.
    inputSchema: {
      first_name: z.string().describe("First name of the user."),
      middle_name: z.string().optional().describe("Middle name of the user."),
      last_name: z.string().describe("Last name of the user."),
      email: z.string().describe("The e-mail of the user."),
      locale: userLocaleEnum.optional(),
      wants_newsletter: z
        .boolean()
        .optional()
        .describe("Boolean representing the possibility of the user to receive newsletters."),
      with_authentication: z
        .boolean()
        .optional()
        .describe(
          "If the user should be able to login and thus receive login details by mail. Only relevant when creating the user.",
        ),
      custom: z.object({}).optional().describe("The custom properties of the user."),
      address_attributes: z
        .object({
          addressee: z.string().optional().describe("The addressee of the address."),
          address: z.string().describe("Concatenation of the street and house number."),
          address_line2: z.string().optional().describe("A string representing the second line of the address."),
          postal_code: z.string().describe("A string representing the postal code."),
          city: z.string().describe("A string representing the city."),
          state_province: z.string().optional().describe("An letter USA state code."),
          country: z.string().describe("An ISO3166 two-letter country code."),
        })
        .optional(),
      invoice_address_attributes: z
        .object({
          addressee: z.string().optional().describe("The addressee of the address."),
          address: z.string().describe("Concatenation of the street and house number."),
          address_line2: z.string().optional().describe("A string representing the second line of the address."),
          postal_code: z.string().describe("A string representing the postal code."),
          city: z.string().describe("A string representing the city."),
          state_province: z.string().optional().describe("An letter USA state code."),
          country: z.string().describe("An ISO3166 two-letter country code."),
        })
        .optional(),
      label_ids: z
        .array(z.number().int())
        .optional()
        .describe(
          "An array containing the identifiers of the labels associated with the user. When updating this array, the existing labels are replaced with the new ones provided.\n",
        ),
    },
  • Tool registration via server.registerTool() call in registerUserTools function, called from src/tools/index.ts when all tools are registered.
    server.registerTool(
      "create_user",
      {
        description: "Create a user.",
        annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: false },
        inputSchema: {
          first_name: z.string().describe("First name of the user."),
          middle_name: z.string().optional().describe("Middle name of the user."),
          last_name: z.string().describe("Last name of the user."),
          email: z.string().describe("The e-mail of the user."),
          locale: userLocaleEnum.optional(),
          wants_newsletter: z
            .boolean()
            .optional()
            .describe("Boolean representing the possibility of the user to receive newsletters."),
          with_authentication: z
            .boolean()
            .optional()
            .describe(
              "If the user should be able to login and thus receive login details by mail. Only relevant when creating the user.",
            ),
          custom: z.object({}).optional().describe("The custom properties of the user."),
          address_attributes: z
            .object({
              addressee: z.string().optional().describe("The addressee of the address."),
              address: z.string().describe("Concatenation of the street and house number."),
              address_line2: z.string().optional().describe("A string representing the second line of the address."),
              postal_code: z.string().describe("A string representing the postal code."),
              city: z.string().describe("A string representing the city."),
              state_province: z.string().optional().describe("An letter USA state code."),
              country: z.string().describe("An ISO3166 two-letter country code."),
            })
            .optional(),
          invoice_address_attributes: z
            .object({
              addressee: z.string().optional().describe("The addressee of the address."),
              address: z.string().describe("Concatenation of the street and house number."),
              address_line2: z.string().optional().describe("A string representing the second line of the address."),
              postal_code: z.string().describe("A string representing the postal code."),
              city: z.string().describe("A string representing the city."),
              state_province: z.string().optional().describe("An letter USA state code."),
              country: z.string().describe("An ISO3166 two-letter country code."),
            })
            .optional(),
          label_ids: z
            .array(z.number().int())
            .optional()
            .describe(
              "An array containing the identifiers of the labels associated with the user. When updating this array, the existing labels are replaced with the new ones provided.\n",
            ),
        },
      },
      async (body) => {
        try {
          const record = await apiPost<EduframeRecord>("/users", body);
          void logResponse("create_user", body, record);
          return formatCreate(record, "user");
        } catch (error) {
          return formatError(error);
        }
      },
    );
  • The apiPost helper function used by create_user to perform the HTTP POST request to the Eduframe API at '/users'.
    export async function apiPost<T>(path: string, body: unknown): Promise<T> {
      const { token } = getConfig();
      const url = buildUrl(path);
    
      const response = await fetch(url.toString(), {
        method: "POST",
        headers: buildHeaders(token),
        body: JSON.stringify(body),
      });
    
      return handleResponse<T>(response);
    }
  • The formatCreate helper function used by create_user to format the created resource record as a human-readable success message.
    export function formatCreate(record: EduframeRecord, resourceName: string): CallToolResult {
      return {
        content: [
          {
            type: "text",
            text: `Successfully created ${resourceName}:\n\n${formatJSON(record)}${RESPONSE_LOG_HINT}`,
          },
        ],
      };
    }
Behavior2/5

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

Annotations provide basic safety hints but description adds no behavioral context such as permission requirements, side effects like email sending, or whether it can be undone. The description merely repeats the action implied by the name.

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

Conciseness2/5

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

While very short, it is under-specified for a tool with 11 parameters and nested objects. Conciseness should not come at the cost of clarity; a single sentence is insufficient.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness1/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no output schema and complex input, the description provides almost no contextual information about return values, error cases, or required relationships. Completely inadequate.

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 73%, so parameters are fairly well documented in the schema. Description adds no extra meaning beyond what's already in the input schema.

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

Purpose2/5

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

Description 'Create a user' is extremely vague and does not distinguish this tool from many sibling create tools like create_account, create_teacher, etc. It fails to specify what kind of user or any unique aspects.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines1/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance on when to use this tool vs alternatives, nor any prerequisites or context. Completely absent.

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/martijnpieters/eduframe-mcp'

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