Skip to main content
Glama

cortex_list_users

List all users across organizations using a superadmin API key for centralized user management.

Instructions

List all users across organizations (requires superadmin API key via CORTEX_SUPERADMIN_KEY)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function for cortex_list_users tool. It checks if superadmin access is available, calls client.listUsers(), maps results to a summary, and returns the JSON response or an error.
    async () => {
      try {
        if (!client.superadminAvailable) {
          return {
            content: [
              {
                type: "text" as const,
                text: "User listing across organizations requires CORTEX_SUPERADMIN_KEY environment variable to be set.",
              },
            ],
            isError: true,
          };
        }
    
        const users = await client.listUsers();
        const summary = users.map((u) => ({
          id: u.id,
          name: u.name,
          organization: u.organization,
          roles: u.roles,
          status: u.status,
          hasKey: u.hasKey,
          hasPassword: u.hasPassword,
        }));
    
        return {
          content: [
            {
              type: "text" as const,
              text: JSON.stringify(summary, null, 2),
            },
          ],
        };
      } catch (error) {
        return {
          content: [
            {
              type: "text" as const,
              text: `Error listing users: ${error instanceof Error ? error.message : String(error)}`,
            },
          ],
          isError: true,
        };
      }
    },
  • The schema for cortex_list_users: an empty object {} since there are no input parameters.
    {},
  • src/tools/users.ts:9-9 (registration)
    Registration of the tool via server.tool() call with the name 'cortex_list_users' and description 'List all users across organizations (requires superadmin API key via CORTEX_SUPERADMIN_KEY)'.
    server.tool(
  • src/index.ts:44-44 (registration)
    The call to registerUserTools(server, client) in the main entry point which registers cortex_list_users along with other user tools.
    registerUserTools(server, client);
  • The client.listUsers() method that makes the actual HTTP request to the Cortex API endpoint /user using superadmin auth.
    async listUsers(): Promise<CortexUser[]> {
      return this.request<CortexUser[]>("/user", {}, true);
    }
Behavior4/5

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

The description discloses the authentication requirement (superadmin API key) and implies a read-only operation. No annotations contradict this, and no additional side effects are needed for a list operation.

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?

One sentence, no wasted words. Directly states the action and a critical context (key requirement).

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

Completeness4/5

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

Given no parameters and no output schema, the description covers the essentials. It could mention that output is a list of users, but it's implied by 'list all users'.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

There are no parameters, so schema coverage is 100%. The description adds no parameter info, but baseline for 0 params is 4, which is appropriate.

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

Purpose5/5

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

The description clearly states the tool lists all users across organizations, specifying the required superadmin API key. It distinguishes from sibling tools like cortex_get_user (specific user) and cortex_list_organizations (lists orgs).

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

Usage Guidelines4/5

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

The description implicitly tells when to use (needing a global user list) and mentions the authentication prerequisite. However, it does not explicitly state when not to use or name alternative tools for specific users.

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/solomonneas/cortex-mcp'

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