Skip to main content
Glama

list_profiles

Retrieve existing Hyperbrowser profiles with pagination options to manage browser automation sessions efficiently.

Instructions

Lists existing persistent Hyperbrowser profiles, with optional pagination.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pageNoPage number for pagination (optional)
limitNoNumber of profiles per page (optional)

Implementation Reference

  • The handler function that executes the list_profiles tool logic, fetching profiles from Hyperbrowser API with pagination.
    export async function listProfilesTool(
      params: listProfilesToolParamSchemaType,
      extra: RequestHandlerExtra<ServerRequest, ServerNotification>
    ): Promise<CallToolResult> {
      const { page, limit } = params; // Destructure validated optional params
    
      let apiKey: string | undefined = undefined;
      if (extra.authInfo && extra.authInfo.extra?.isSSE) {
        apiKey = extra.authInfo.token;
      }
    
      try {
        const client = await getClient({ hbApiKey: apiKey }); // Get client instance
    
        // Call the SDK list method with optional parameters
        const response = await client.profiles.list({ page, limit });
    
        // Return the list of profiles and pagination info
        return {
          content: [
            {
              type: "text",
              // response contains { profiles: ProfileResponse[], totalCount, page, perPage }
              text: JSON.stringify(response, null, 2),
            },
          ],
          isError: false,
        };
      } catch (error: any) {
        let errorMessage = "An unknown error occurred while listing profiles.";
    
        // Check if it's a specific Hyperbrowser SDK error
        if (error instanceof HyperbrowserError) {
          errorMessage = `Failed to list profiles: ${error.message} (Status: ${
            error.statusCode || "N/A"
          })`;
        } else if (error instanceof Error) {
          errorMessage = `Failed to list profiles: ${error.message}`;
        }
    
        // Return error result
        return {
          content: [{ type: "text", text: errorMessage }],
          isError: true,
        };
      }
    }
  • Zod schema definition for list_profiles tool parameters (page and limit).
    export const listProfilesToolParamSchemaRaw = {
      page: z.number().int().positive().optional().describe("Page number for pagination (optional)"),
      limit: z.number().int().positive().optional().describe("Number of profiles per page (optional)"),
    };
    
    export const listProfilesToolParamSchema = z.object(
      listProfilesToolParamSchemaRaw
    );
    
    export type listProfilesToolParamSchemaType = z.infer<
      typeof listProfilesToolParamSchema
    >;
  • Registration of the list_profiles tool in the MCP server using server.tool() with name, description, schema, and handler.
      listProfilesToolName,
      listProfilesToolDescription,
      listProfilesToolParamSchemaRaw,
      listProfilesTool
    );
  • Import of list_profiles tool components (handler, description, name) in setup_server.
      listProfilesTool,
      listProfilesToolDescription,
      listProfilesToolName,
    } from "../tools/list-profiles";
  • Import of listProfilesToolParamSchemaRaw schema for registration.
      deleteProfileToolParamSchemaRaw,
      listProfilesToolParamSchemaRaw,
    } from "../tools/tool-types";
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. While 'Lists' implies a read-only operation, it doesn't explicitly state this. It mentions pagination but doesn't describe default behavior when parameters aren't provided, what format the results come in, or any limitations like rate limits or authentication requirements. The description provides minimal behavioral context beyond the basic 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?

The description is a single, efficient sentence that communicates the core purpose upfront. Every word earns its place - 'Lists' (action), 'existing persistent Hyperbrowser profiles' (resource), and 'with optional pagination' (key behavioral feature). There's no redundancy or unnecessary elaboration.

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 tool with no annotations and no output schema, the description is insufficiently complete. While it states what the tool does, it doesn't describe what the output looks like (list format, fields included), default behavior when parameters aren't provided, or any constraints or requirements. Given the lack of structured metadata, the description should provide more contextual information about the tool's behavior and results.

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 100%, so the schema already fully documents both parameters (page and limit). The description adds the context that pagination is 'optional,' which is useful but doesn't provide additional semantic meaning beyond what the schema's optional nature already indicates. This meets the baseline for high schema coverage scenarios.

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 ('Lists') and resource ('existing persistent Hyperbrowser profiles'), making the purpose immediately understandable. It distinguishes itself from siblings like create_profile and delete_profile by focusing on listing rather than creation or deletion. However, it doesn't explicitly differentiate from other listing/search tools that might exist in the broader context.

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 mentions 'optional pagination' which provides some context about when to use parameters, but offers no guidance on when to use this tool versus alternatives. There's no mention of when to use list_profiles versus search functions or how it relates to other profile management tools like create_profile or delete_profile.

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/hyperbrowserai/mcp'

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