Skip to main content
Glama

playwright_patch

Execute an HTTP PATCH request to update specific web resources by sending data to a specified URL, enabling seamless modifications in web interactions.

Instructions

Perform an HTTP PATCH request

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlYesURL to perform PUT operation
valueYesData to PATCH in the body

Implementation Reference

  • The handler case in handleToolCall function that performs an HTTP PATCH request using Playwright's APIRequestContext, sending the provided value as JSON body, and returns the response details or error.
    case "playwright_patch":
      try {
        var data = {
          data: args.value,
          headers: {
            'Content-Type': 'application/json'
          }
        };
        var response = await apiContext!.patch(args.url, data);
    
        return {
          toolResult: {
            content: [{
              type: "text",
              text: `Performed PATCH Operation ${args.url} with data ${JSON.stringify(args.value, null, 2)}`,
            }, {
              type: "text",
              text: `Response: ${JSON.stringify(await response.json(), null, 2)}`,
            }, {
              type: "text",
              text: `Response code ${response.status()}`
            }],
            isError: false,
          },
        };
      } catch (error) {
        return {
          toolResult: {
            content: [{
              type: "text",
              text: `Failed to perform PATCH operation on ${args.url}: ${(error as Error).message}`,
            }],
            isError: true,
          },
        };
      }
  • The Tool definition including name, description, and inputSchema for the playwright_patch tool.
    {
      name: "playwright_patch",
      description: "Perform an HTTP PATCH request",
      inputSchema: {
        type: "object",
        properties: {
          url: { type: "string", description: "URL to perform PUT operation" },
          value: { type: "string", description: "Data to PATCH in the body" },
        },
        required: ["url", "value"],
      },
    },
  • API_TOOLS array listing playwright_patch among API request tools, used to conditionally set up APIRequestContext in handleToolCall.
    export const API_TOOLS = [
      "playwright_get",
      "playwright_post",
      "playwright_put",
      "playwright_delete",
      "playwright_patch"
  • Registers the list tools handler that provides the tool definitions including playwright_patch schema.
    server.setRequestHandler(ListToolsRequestSchema, async () => ({
      tools: tools,
    }));
  • Registers the call tool handler that dispatches to handleToolCall based on tool name, executing playwright_patch when called.
    server.setRequestHandler(CallToolRequestSchema, async (request) =>
      handleToolCall(request.params.name, request.params.arguments ?? {}, server)
    );
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It only states the HTTP method without mentioning authentication needs, rate limits, error handling, or what the tool actually does in the Playwright context (e.g., interacting with a web page). This is inadequate for a mutation tool.

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 a single, efficient sentence with zero waste. It's appropriately sized and front-loaded, though it lacks substance.

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?

For a mutation tool with no annotations and no output schema, the description is incomplete. It doesn't explain what the tool returns, how it behaves in the Playwright ecosystem, or address complexity beyond the basic HTTP method. More context is needed for effective use.

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%, so the schema already documents both parameters. The description doesn't add any meaning beyond what the schema provides, such as clarifying the 'value' parameter format or 'url' constraints. Baseline 3 is appropriate when the schema does the heavy lifting.

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

Purpose2/5

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

The description 'Perform an HTTP PATCH request' restates the tool name 'playwright_patch' without adding specificity about what resource it patches or how it differs from siblings like playwright_put or playwright_post. It's a tautology that doesn't clarify the actual purpose beyond the HTTP method.

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 on when to use this tool versus alternatives like playwright_put or playwright_post. The description doesn't mention any context, prerequisites, or exclusions, leaving the agent to infer usage from the HTTP method alone.

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