Skip to main content
Glama

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

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

Implementation Reference

  • 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,
          },
        };
      }
  • 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"],
      },
    },
  • 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,
    }));
  • 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"
    ];
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden but only states the basic action without disclosing behavioral traits such as authentication needs, error handling, rate limits, or what happens on success/failure. It mentions 'POST request' but doesn't clarify if it's idempotent, destructive, or has side effects beyond the implied data submission.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence with zero waste—'Perform an HTTP POST request' is front-loaded and directly states the tool's purpose without unnecessary elaboration. It's appropriately sized for a simple HTTP tool.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity of HTTP operations, no annotations, and no output schema, the description is incomplete. It lacks context on response handling, error cases, or behavioral expectations, which are critical for an agent to use this tool correctly in real-world scenarios.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 100% description coverage, clearly documenting both parameters (url and value). The description adds no additional meaning beyond what the schema provides, such as format examples or constraints, so it meets the baseline of 3 for high schema coverage without extra value.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Perform an HTTP POST request') with a specific HTTP method, which distinguishes it from siblings like playwright_get or playwright_delete. However, it doesn't specify what resource or endpoint it targets beyond the generic 'HTTP POST request', making it slightly less specific than ideal.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives like playwright_put or playwright_patch, nor does it mention any prerequisites or context for POST requests. It's a generic statement that offers no usage differentiation among the HTTP method siblings.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install 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