playwright_patch
Execute browser automation HTTP PATCH requests via the Playwright framework, enabling data updates on web pages using Chrome DevTools Protocol.
Instructions
Perform an HTTP PATCH request
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | Yes | URL to perform PUT operation | |
| value | Yes | Data to PATCH in the body |
Input Schema (JSON Schema)
{
"properties": {
"url": {
"description": "URL to perform PUT operation",
"type": "string"
},
"value": {
"description": "Data to PATCH in the body",
"type": "string"
}
},
"required": [
"url",
"value"
],
"type": "object"
}
Implementation Reference
- src/toolsHandler.ts:438-469 (handler)The handler function for the 'playwright_patch' tool. It sends a PATCH request to the specified URL with the provided JSON data using Playwright's APIRequestContext and returns the response details.case "playwright_patch": try { var data = { data: args.value, headers: { 'Content-Type': 'application/json' } }; var response = await apiContext!.patch(args.url, data); return { 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 { content: [{ type: "text", text: `Failed to perform PATCH operation on ${args.url}: ${(error as Error).message}`, }], isError: true, }; }