Skip to main content
Glama

playwright_post

Execute HTTP POST requests with specified URL and body data to automate browser tasks via the MCP Browser Automation Server, facilitating efficient data submission and interaction.

Instructions

Perform an HTTP POST request

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlYesURL to perform POST operation
valueYesData to post in the body

Implementation Reference

  • The switch case implementing the logic for the 'playwright_post' tool. It performs an HTTP POST request to the specified URL with the provided data (args.value) as JSON, using Playwright's APIRequestContext. Returns the response JSON and status code.
    case "playwright_post": try { var data = { data: args.value, headers: { 'Content-Type': 'application/json' } }; var response = await apiContext!.post(args.url, data); return { toolResult: { content: [{ type: "text", text: `Performed POST 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 POST operation on ${args.url}: ${(error as Error).message}`, }], isError: true, }, }; }
  • The tool definition object for 'playwright_post', providing the name, description, and input schema (url and value as required strings).
    { name: "playwright_post", description: "Perform an HTTP POST request", inputSchema: { type: "object", properties: { url: { type: "string", description: "URL to perform POST operation" }, value: { type: "string", description: "Data to post in the body" }, }, required: ["url", "value"], }, },
  • API_TOOLS constant array listing 'playwright_post' among API request tools, used in toolsHandler.ts to conditionally set up APIRequestContext without launching a browser.
    export const API_TOOLS = [ "playwright_get", "playwright_post", "playwright_put", "playwright_delete", "playwright_patch" ];
  • src/index.ts:22-26 (registration)
    Registration of all tools including 'playwright_post' via createToolDefinitions() and passing to setupRequestHandlers on the MCP server.
    // Create tool definitions const TOOLS = createToolDefinitions(); // Setup request handlers setupRequestHandlers(server, 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/hrmeetsingh/mcp-browser-automation'

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