playwright_post
Execute HTTP POST requests to specified URLs with data payloads using the Playwright MCP Server, enabling browser automation and web interaction.
Instructions
Perform an HTTP POST request
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | Yes | URL to perform POST operation | |
| value | Yes | Data to post in the body |
Implementation Reference
- src/toolsHandler.ts:354-391 (handler)Handler for 'playwright_post' tool: performs HTTP POST request to the given URL with JSON data from 'value' argument, returns response JSON and status.
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, }, }; } - src/tools.ts:101-112 (schema)Schema definition for 'playwright_post' tool including input parameters 'url' and 'value'.
{ 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"], }, }, - src/requestHandler.ts:59-62 (registration)Registration of the tools list handler which exposes all tools including 'playwright_post' via MCP protocol.
// List tools handler server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools: tools, })); - src/tools.ts:164-170 (helper)API_TOOLS array categorizes 'playwright_post' as an API tool, triggering APIRequestContext setup in the handler.
export const API_TOOLS = [ "playwright_get", "playwright_post", "playwright_put", "playwright_delete", "playwright_patch" ];