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 );

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