playwright_put
Send an HTTP PUT request to a specified URL with the provided data using Playwright MCP Server. Ideal for updating resources or interacting with APIs in a browser automation environment.
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:393-429 (handler)The handler case for 'playwright_put' in the handleToolCall switch statement. Performs HTTP PUT request via Playwright APIRequestContext and returns response details.case "playwright_put": try { var data = { data: args.value, headers: { 'Content-Type': 'application/json' } }; var response = await apiContext!.put(args.url, data); return { toolResult: { 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 { toolResult: { content: [{ type: "text", text: `Failed to perform PUT operation on ${args.url}: ${(error as Error).message}`, }], isError: true, }, }; }
- src/tools.ts:113-124 (schema)Tool schema definition including name, description, and input schema for 'playwright_put' in createToolDefinitions().{ 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:164-170 (helper)API_TOOLS array includes 'playwright_put' to conditionally set up APIRequestContext in handleToolCall.export const API_TOOLS = [ "playwright_get", "playwright_post", "playwright_put", "playwright_delete", "playwright_patch" ];
- src/index.ts:22-26 (registration)Tool registration: Calls createToolDefinitions() which includes 'playwright_put' schema, and passes tools to setupRequestHandlers for MCP server.// Create tool definitions const TOOLS = createToolDefinitions(); // Setup request handlers setupRequestHandlers(server, TOOLS);