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

TableJSON Schema
NameRequiredDescriptionDefault
urlYesURL to perform DELETE operation

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);
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden but provides minimal behavioral information. It states it performs an HTTP DELETE request but doesn't disclose what happens after the request (success/failure responses, error handling, side effects), authentication requirements, rate limits, or what gets destroyed. For a mutation tool with zero annotation coverage, this is inadequate transparency.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is extremely concise - a single sentence with zero waste. It's front-loaded with the core action and appropriately sized for what it communicates. Every word earns its place, though it could benefit from additional context.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given this is a mutation tool (DELETE) with no annotations, no output schema, and minimal description, the description is incomplete. It doesn't explain what the tool returns, error conditions, or behavioral expectations. For a tool that performs destructive operations in a Playwright context, more information about typical use cases, response handling, and integration with other Playwright tools would be needed.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100% with the single 'url' parameter well-documented in the schema. The description doesn't add any meaningful parameter semantics beyond what the schema already provides (URL to perform DELETE operation). It doesn't explain URL format expectations, authentication requirements in URLs, or what constitutes a valid DELETE endpoint. Baseline 3 is appropriate when schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states the action ('Perform an HTTP DELETE request') which is a clear verb, but it doesn't specify what resource it operates on or differentiate from sibling tools. It's vague about what exactly gets deleted - URLs, API endpoints, or web elements? Compared to siblings like playwright_click or playwright_fill, the purpose is generic rather than specific to the Playwright context.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided about when to use this tool versus alternatives. The description doesn't mention when DELETE is appropriate versus other HTTP methods (like GET, POST, PUT, PATCH from siblings), nor does it specify typical use cases like deleting resources through REST APIs. There's no mention of prerequisites or context for when this tool should be selected.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

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