playwright_put
Send HTTP PUT requests to update resources by specifying a URL and data payload. This tool enables modifying web content through browser automation.
Instructions
Perform an HTTP PUT request
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | Yes | URL to perform PUT operation | |
| value | Yes | Data to PUT in the body |
Implementation Reference
- src/toolsHandler.ts:379-411 (handler)The handler function for the 'playwright_put' tool. It performs a PUT request to the specified URL with the provided data using the Playwright API context, returns the response details or an error message.case "playwright_put": try { var data = { data: args.value, headers: { 'Content-Type': 'application/json' } }; var response = await apiContext!.put(args.url, data); return { content: [{ type: "text", text: `Performed PUT 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 PUT operation on ${args.url}: ${(error as Error).message}`, }], isError: true, }; }
- src/tools.ts:117-128 (schema)The schema definition for the 'playwright_put' tool, specifying the input parameters: url (string) and value (string). This is part of the tools array returned by createToolDefinitions() used for MCP tool listing.{ name: "playwright_put", description: "Perform an HTTP PUT request", inputSchema: { type: "object", properties: { url: { type: "string", description: "URL to perform PUT operation" }, value: { type: "string", description: "Data to PUT in the body" }, }, required: ["url", "value"], }, },
- src/tools.ts:167-172 (helper)Helper constant listing API tools, including 'playwright_put', likely used for conditional resource management or browser launch decisions.export const API_TOOLS = [ "playwright_get", "playwright_post", "playwright_put", "playwright_delete", "playwright_patch"