playwright_delete
Execute an HTTP DELETE request to remove data from a specified URL using the Playwright MCP Server for browser automation.
Instructions
Perform an HTTP DELETE request
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | Yes | URL to perform DELETE operation |
Implementation Reference
- src/tools/api/requests.ts:156-178 (handler)The DeleteRequestTool class implements the execute method, which performs an HTTP DELETE request using Playwright's APIRequestContext.delete(), retrieves the response status and body (truncated), and returns a formatted success response.export class DeleteRequestTool extends ApiToolBase { /** * Execute the DELETE request tool */ async execute(args: any, context: ToolContext): Promise<ToolResponse> { return this.safeExecute(context, async (apiContext) => { const response = await apiContext.delete(args.url); let responseText; try { responseText = await response.text(); } catch (error) { responseText = "Unable to get response text"; } return createSuccessResponse([ `DELETE request to ${args.url}`, `Status: ${response.status()} ${response.statusText()}`, `Response: ${responseText.substring(0, 1000)}${responseText.length > 1000 ? '...' : ''}` ]); }); } }
- src/tools.ts:296-306 (schema)Tool schema definition including name, description, and inputSchema requiring a '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/toolHandler.ts:536-537 (registration)Switch case in handleToolCall that dispatches 'playwright_delete' calls to the DeleteRequestTool instance's execute method.case "playwright_delete": return await deleteRequestTool.execute(args, context);
- src/toolHandler.ts:340-340 (registration)Instantiation of the DeleteRequestTool instance during tool initialization.if (!deleteRequestTool) deleteRequestTool = new DeleteRequestTool(server);
- src/tools.ts:480-480 (registration)Inclusion of 'playwright_delete' in the API_TOOLS array used for conditional tool handling."playwright_delete",