Skip to main content
Glama
devskido

Playwright MCP Server

by devskido

playwright_delete

Delete web resources by sending HTTP DELETE requests through browser automation, enabling removal of data or content from web servers.

Instructions

Perform an HTTP DELETE request

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlYesURL to perform DELETE operation

Implementation Reference

  • The DeleteRequestTool class provides the execute method that performs the HTTP DELETE request to the specified URL using Playwright's API request context and returns the status and 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 ? '...' : ''}` ]); }); } }
  • Defines the input schema for the playwright_delete tool, 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"], }, },
  • Registers the dispatching of 'playwright_delete' tool calls to the DeleteRequestTool's execute method in the main tool handler switch statement.
    case "playwright_delete": return await deleteRequestTool.execute(args, context);
  • Initializes the DeleteRequestTool instance used for handling playwright_delete calls.
    if (!deleteRequestTool) deleteRequestTool = new DeleteRequestTool(server);
  • Imports the DeleteRequestTool class from the requests module.
    GetRequestTool, PostRequestTool, PutRequestTool, PatchRequestTool, DeleteRequestTool } from './tools/api/requests.js';

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/devskido/customed-playwright'

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