playwright_delete
Send HTTP DELETE requests to specified URLs using the Playwright MCP Server, enabling integration with web pages and automation of data removal tasks.
Instructions
Perform an HTTP DELETE request
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | Yes | URL to perform DELETE operation |
Input Schema (JSON Schema)
{
"properties": {
"url": {
"description": "URL to perform DELETE operation",
"type": "string"
}
},
"required": [
"url"
],
"type": "object"
}
Implementation Reference
- src/tools/api/requests.ts:156-178 (handler)DeleteRequestTool class: the primary handler executing the DELETE HTTP request using Playwright API context, retrieving status and truncated response text.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:271-281 (schema)Input schema definition for the 'playwright_delete' tool, specifying 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/toolHandler.ts:514-515 (registration)Registration in the main tool handler switch statement, dispatching 'playwright_delete' calls to DeleteRequestTool.executecase "playwright_delete": return await deleteRequestTool.execute(args, context);
- src/toolHandler.ts:308-308 (registration)Initialization of the DeleteRequestTool instance during tool setup.if (!deleteRequestTool) deleteRequestTool = new DeleteRequestTool(server);
- src/tools.ts:432-432 (registration)Inclusion in API_TOOLS array for conditional API context setup."playwright_delete",