Skip to main content
Glama
r-huijts
by r-huijts

list_all_users

Retrieve all users in your Portkey organization with their roles and account details to manage access and permissions.

Instructions

List all users in your Portkey organization, including their roles and account details

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Inline handler function for the 'list_all_users' tool that invokes portkeyService.listUsers() and returns the users data as formatted JSON text content.
    async () => {
      const users = await portkeyService.listUsers();
      return {
        content: [{ type: "text", text: JSON.stringify(users, null, 2) }]
      }
    }
  • src/index.ts:20-30 (registration)
    Registers the 'list_all_users' MCP tool with the server, including name, description, empty input schema ({}), and the handler function.
    server.tool(
      "list_all_users",
      "List all users in your Portkey organization, including their roles and account details",
      {},
      async () => {
        const users = await portkeyService.listUsers();
        return {
          content: [{ type: "text", text: JSON.stringify(users, null, 2) }]
        }
      }
    );
  • Core helper method 'listUsers()' in PortkeyService class that performs the actual API call to Portkey's /admin/users endpoint to retrieve the list of users.
    async listUsers(): Promise<PortkeyUsersResponse> {
      try {
        const response = await fetch(`${this.baseUrl}/admin/users`, {
          method: 'GET',
          headers: {
            'x-portkey-api-key': this.apiKey,
            'Accept': 'application/json'
          }
        });
    
        if (!response.ok) {
          throw new Error(`HTTP error! status: ${response.status}`);
        }
    
        const data = await response.json() as PortkeyUsersResponse;
        return {
          total: data.total,
          object: data.object,
          data: data.data.map(user => ({
            object: user.object,
            id: user.id,
            first_name: user.first_name,
            last_name: user.last_name,
            email: user.email,
            role: user.role,
            created_at: user.created_at,
            last_updated_at: user.last_updated_at
          }))
        };
      } catch (error) {
        console.error('PortkeyService Error:', error);
        throw new Error('Failed to fetch users from Portkey API');
      }
    }
Behavior2/5

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

No annotations are provided, so the description carries the full burden. It states the tool lists users, implying a read-only operation, but doesn't disclose behavioral traits such as pagination, rate limits, authentication requirements, or what happens if no users exist. For a tool with zero annotation coverage, this is a significant gap in transparency.

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 front-loads the key action ('List all users') and includes essential details ('in your Portkey organization, including their roles and account details'). There is no wasted language, and it's appropriately sized for the tool's simplicity.

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

Completeness3/5

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

Given the tool's complexity (0 parameters, no output schema, no annotations), the description is minimally complete. It states what the tool does but lacks behavioral context (e.g., output format, error handling). Without annotations or output schema, more detail on return values or usage constraints would improve completeness, but it's adequate for a basic list tool.

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?

The tool has 0 parameters, and schema description coverage is 100%, so no parameter documentation is needed. The description doesn't add parameter semantics, but with no parameters, the baseline is 4 as it adequately covers the tool's purpose without unnecessary details.

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 verb ('List') and resource ('all users in your Portkey organization'), specifying what fields are included ('their roles and account details'). It distinguishes from some siblings like 'get_user_stats' (statistics vs. list) and 'invite_user' (create vs. list), but doesn't explicitly differentiate from all list-type tools like 'list_configs' or 'list_workspaces'.

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?

No guidance is provided on when to use this tool versus alternatives. It doesn't mention prerequisites, timing considerations, or comparisons with siblings like 'get_user_stats' (which might provide aggregated data) or 'invite_user' (which is for adding users). The description implies a comprehensive listing but offers no context for selection.

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/r-huijts/portkey-admin-mcp-server'

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