Skip to main content
Glama

playwright_delete

Delete resources from a specified URL using an HTTP DELETE request. This tool, part of the Playwright MCP Server, enables precise browser automation for managing web interactions.

Instructions

Perform an HTTP DELETE request

Input Schema

NameRequiredDescriptionDefault
urlYesURL to perform DELETE operation

Input Schema (JSON Schema)

{ "properties": { "url": { "description": "URL to perform DELETE operation", "type": "string" } }, "required": [ "url" ], "type": "object" }

Implementation Reference

  • The switch case that handles the 'playwright_delete' tool invocation, performing an HTTP DELETE request using Playwright's APIRequestContext and returning the status code.
    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, }, }; }
  • Tool definition object specifying the name, description, and input schema (requiring 'url') for the 'playwright_delete' tool.
    { name: "playwright_delete", description: "Perform an HTTP DELETE request", inputSchema: { type: "object", properties: { url: { type: "string", description: "URL to perform DELETE operation" } }, required: ["url"], }, },
  • MCP server request handler for listing tools, which includes 'playwright_delete' via the 'tools' array from createToolDefinitions().
    // List tools handler server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools: tools, }));
  • Array categorizing 'playwright_delete' as an API tool, used to conditionally set up APIRequestContext in the handler.
    export const API_TOOLS = [ "playwright_get", "playwright_post", "playwright_put", "playwright_delete", "playwright_patch" ];
  • src/index.ts:22-26 (registration)
    Initialization of tool definitions (including 'playwright_delete') and setup of request handlers in the main server entry point.
    // Create tool definitions const TOOLS = createToolDefinitions(); // Setup request handlers setupRequestHandlers(server, TOOLS);

Other Tools

Related Tools

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/lebrodus/mcp-playwright'

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