playwright_patch
Execute HTTP PATCH requests via the MCP Browser Automation Server to update specific resources by sending data to defined URLs, enabling precise modifications in automated browser workflows.
Instructions
Perform an HTTP PATCH request
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | Yes | URL to perform PUT operation | |
| value | Yes | Data to PATCH in the body |
Implementation Reference
- src/toolsHandler.ts:460-495 (handler)Executes the 'playwright_patch' tool by performing an HTTP PATCH request to the specified URL with the provided JSON data, returning the response body and status code or an error message.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, }, }; }
- src/tools.ts:125-136 (schema)Defines the input schema and metadata for the 'playwright_patch' tool within the createToolDefinitions() function.{ 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"], }, },
- src/tools.ts:164-169 (registration)Registers 'playwright_patch' as one of the API tools that trigger API context setup in the handler.export const API_TOOLS = [ "playwright_get", "playwright_post", "playwright_put", "playwright_delete", "playwright_patch"