Skip to main content
Glama
devskido

Playwright MCP Server

by devskido

playwright_put

Send HTTP PUT requests to update web resources by providing URL and data payload for browser automation tasks.

Instructions

Perform an HTTP PUT request

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlYesURL to perform PUT operation
valueYesData to PUT in the body

Implementation Reference

  • PutRequestTool.execute method implements the core logic: performs HTTP PUT request via apiContext.put, handles JSON validation, extracts and truncates response.
    export class PutRequestTool extends ApiToolBase { /** * Execute the PUT request tool */ async execute(args: any, context: ToolContext): Promise<ToolResponse> { return this.safeExecute(context, async (apiContext) => { // Check if the value is valid JSON if it starts with { or [ if (args.value && typeof args.value === 'string' && (args.value.startsWith('{') || args.value.startsWith('['))) { try { JSON.parse(args.value); } catch (error) { return createErrorResponse(`Failed to parse request body: ${(error as Error).message}`); } } const response = await apiContext.put(args.url, { data: args.value }); let responseText; try { responseText = await response.text(); } catch (error) { responseText = "Unable to get response text"; } return createSuccessResponse([ `PUT request to ${args.url}`, `Status: ${response.status()} ${response.statusText()}`, `Response: ${responseText.substring(0, 1000)}${responseText.length > 1000 ? '...' : ''}` ]); }); } }
  • Input schema definition for the playwright_put tool 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"], }, },
  • Dispatch in handleToolCall switch statement routes 'playwright_put' calls to the PutRequestTool instance.
    case "playwright_put": return await putRequestTool.execute(args, context);
  • Instantiation of PutRequestTool instance in initializeTools().
    if (!putRequestTool) putRequestTool = new PutRequestTool(server);
  • playwright_put listed in API_TOOLS, used in toolHandler to conditionally create API request context.
    // API Request tools for conditional launch export const API_TOOLS = [ "playwright_get", "playwright_post", "playwright_put", "playwright_delete", "playwright_patch"

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/devskido/customed-playwright'

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