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
| 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)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, }, }; }
- src/tools.ts:125-136 (schema)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"], }, },
- src/tools.ts:164-169 (helper)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"
- src/requestHandler.ts:60-62 (registration)Registers the list tools handler that provides the tool definitions including playwright_patch schema.server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools: tools, }));
- src/requestHandler.ts:65-67 (registration)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) );