Skip to main content
Glama

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
NameRequiredDescriptionDefault
urlYesURL to perform PUT operation
valueYesData to PATCH in the body

Implementation Reference

  • 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, }, }; }
  • 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"], }, },
  • 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"
  • Registers the list tools handler that provides the tool definitions including playwright_patch schema.
    server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools: tools, }));
  • 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) );

Other Tools

Related Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/lebrodus/mcp-playwright'

If you have feedback or need assistance with the MCP directory API, please join our Discord server