Skip to main content
Glama

delete_profile

Remove a persistent Hyperbrowser profile by its ID to manage browser automation resources and maintain clean infrastructure.

Instructions

Deletes an existing persistent Hyperbrowser profile.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
profileIdYesID of the profile to delete

Implementation Reference

  • The handler function that executes the delete_profile tool logic, deleting the specified Hyperbrowser profile using the SDK.
    export async function deleteProfileTool(
      params: deleteProfileToolParamSchemaType,
      extra: RequestHandlerExtra<ServerRequest, ServerNotification>
    ): Promise<CallToolResult> {
      const { profileId } = params; // Destructure validated profileId
    
      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 delete method
        await client.profiles.delete(profileId);
    
        // Return success
        return {
          content: [
            {
              type: "text",
              text: `Successfully deleted profile with ID: ${profileId}`,
            },
          ],
          isError: false,
        };
      } catch (error: any) {
        let errorMessage = `An unknown error occurred while deleting profile ${profileId}.`;
        let isError = true;
    
        // Check if it's a specific Hyperbrowser SDK error
        if (error instanceof HyperbrowserError) {
          if (error.statusCode === 404) {
            errorMessage = `Profile with ID ${profileId} not found.`;
            // Optionally, you might decide this isn't a true 'error' state for the tool
            // isError = false; // Depending on desired behavior
          } else {
            errorMessage = `Failed to delete profile ${profileId}: ${
              error.message
            } (Status: ${error.statusCode || "N/A"})`;
          }
        } else if (error instanceof Error) {
          errorMessage = `Failed to delete profile ${profileId}: ${error.message}`;
        }
    
        // Return error result
        return {
          content: [{ type: "text", text: errorMessage }],
          isError: isError,
        };
      }
    }
  • Zod schema and type definitions for the delete_profile tool parameters.
    export const deleteProfileToolParamSchemaRaw = {
      profileId: z.string().describe("ID of the profile to delete"),
    };
    
    export const deleteProfileToolParamSchema = z.object(
      deleteProfileToolParamSchemaRaw
    );
    
    export type deleteProfileToolParamSchemaType = z.infer<
      typeof deleteProfileToolParamSchema
    >;
  • Registration of the delete_profile tool on the MCP server.
      deleteProfileToolName,
      deleteProfileToolDescription,
      deleteProfileToolParamSchemaRaw,
      deleteProfileTool
    );
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 'Deletes' implies a destructive operation, it doesn't specify whether deletion is permanent, requires specific permissions, affects associated data, or has confirmation steps. This is inadequate for a mutation tool with zero annotation coverage.

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 with zero wasted words. It's appropriately sized for a simple deletion tool and front-loads the essential information without 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 destructive operation with no annotations and no output schema, the description is insufficient. It doesn't explain what happens after deletion, whether it's reversible, error conditions, or return values. Given the tool's complexity and lack of structured data, more behavioral context is needed.

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 input schema fully documents the single parameter 'profileId'. The description adds no additional parameter semantics beyond what the schema provides, maintaining the baseline score for high schema coverage.

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 specific action ('Deletes') and target resource ('an existing persistent Hyperbrowser profile'), distinguishing it from sibling tools like 'create_profile' and 'list_profiles'. It precisely communicates the tool's function without ambiguity.

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, prerequisites, or constraints. It doesn't mention when deletion is appropriate versus updating or archiving, or reference sibling tools like 'create_profile' for context.

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