Skip to main content
Glama

playwright_delete

Execute HTTP DELETE requests to specified URLs using Playwright automation. Streamline web data removal or API interactions within browser automation workflows.

Instructions

Perform an HTTP DELETE request

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlYesURL to perform DELETE operation

Implementation Reference

  • Executes the playwright_delete tool by performing an HTTP DELETE request to the provided URL using Playwright's APIRequestContext and returns the response status or error message.
    case "playwright_delete": try { var response = await apiContext!.delete(args.url); return { toolResult: { content: [{ type: "text", text: `Performed delete Operation ${args.url}`, }, { type: "text", text: `Response code ${response.status()}` }], isError: false, }, }; } catch (error) { return { toolResult: { content: [{ type: "text", text: `Failed to perform delete operation on ${args.url}: ${(error as Error).message}`, }], isError: true, }, }; }
  • Defines the input schema for the playwright_delete tool, specifying the required 'url' parameter.
    name: "playwright_delete", description: "Perform an HTTP DELETE request", inputSchema: { type: "object", properties: { url: { type: "string", description: "URL to perform DELETE operation" } }, required: ["url"], }, },
  • src/index.ts:23-26 (registration)
    Registers all tools including playwright_delete by creating tool definitions from tools.ts and setting up request handlers on the MCP server.
    const TOOLS = createToolDefinitions(); // Setup request handlers setupRequestHandlers(server, TOOLS);
  • Conditionally creates APIRequestContext for API tools like playwright_delete based on inclusion in API_TOOLS.
    // Check if the tool requires api interaction const requiresApi = API_TOOLS.includes(name); let page: Page | undefined; let apiContext: APIRequestContext; // Only launch browser if the tool requires browser interaction if (requiresBrowser) { page = await ensureBrowser(); } // Set up API context for API-related operations if (requiresApi) { apiContext = await ensureApiContext(args.url); }
  • Helper function to create Playwright APIRequestContext with baseURL from args.url, used by API tools including playwright_delete.
    async function ensureApiContext(url: string) { return await request.newContext({ baseURL: url, }); }

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/hrmeetsingh/mcp-browser-automation'

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