Skip to main content
Glama

playwright_post

Send HTTP POST requests to submit data to web endpoints through browser automation, enabling form submissions and API interactions via Playwright with Chrome DevTools Protocol.

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 handler logic within handleToolCall that executes the playwright_post tool by sending a POST request using Playwright's APIRequestContext.
    case "playwright_post":
      try {
        var data = {
          data: args.value,
          headers: {
            'Content-Type': 'application/json'
          }
        };
    
        var response = await apiContext!.post(args.url, data);
        return {
          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 {
          content: [{
            type: "text",
            text: `Failed to perform POST operation on ${args.url}: ${(error as Error).message}`,
          }],
          isError: true,
        };
      }
  • Tool definition object containing name, description, and inputSchema for the playwright_post tool.
    {
      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 that includes 'playwright_post', used in toolsHandler.ts to determine if API context is needed without launching a browser.
    export const API_TOOLS = [
      "playwright_get",
      "playwright_post",
      "playwright_put",
      "playwright_delete",
      "playwright_patch"
    ];
  • src/index.ts:22-26 (registration)
    Where the tool definitions are created and passed to setupRequestHandlers for MCP server registration.
    // Create tool definitions
    const TOOLS = createToolDefinitions();
    
    // Setup request handlers
    setupRequestHandlers(server, TOOLS);
  • Registration of the general tool call handler that dispatches to specific tool handlers including playwright_post.
    server.setRequestHandler(CallToolRequestSchema, async (request) =>
      handleToolCall(request.params.name, request.params.arguments ?? {}, server)
    );
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the action but doesn't describe traits like authentication needs, rate limits, error handling, or what the response might look like (e.g., status codes, body content). For a tool that performs HTTP operations, this is a significant gap in transparency.

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. It's appropriately sized and front-loaded, clearly stating the tool's purpose without unnecessary details, making it easy to parse quickly.

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 POST requests and the lack of annotations and output schema, the description is incomplete. It doesn't explain return values, error cases, or behavioral aspects like idempotency or side effects. For a tool with no structured support, this minimal description leaves critical gaps for an AI agent.

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?

Schema description coverage is 100%, so the schema already documents both parameters (url and value) with descriptions. The description adds no additional meaning beyond what the schema provides, such as examples or constraints. With high schema coverage, the baseline is 3, as the description doesn't compensate but also doesn't detract.

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

Purpose3/5

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

The description 'Perform an HTTP POST request' states the action (POST) and resource type (HTTP request), which is clear but vague. It doesn't specify what kind of POST request (e.g., to a web page, API endpoint) or distinguish it from siblings like playwright_put or playwright_patch, which are also HTTP methods.

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. It doesn't mention when to choose POST over PUT or PATCH (sibling tools), nor does it specify any prerequisites or contexts for usage, such as needing a valid URL or specific data formats.

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

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/lars-hagen/mcp-playwright-cdp'

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