Skip to main content
Glama

playwright_put

Send an HTTP PUT request to a specified URL with the provided data using Playwright MCP Server. Ideal for updating resources or interacting with APIs in a browser automation environment.

Instructions

Perform an HTTP PUT request

Input Schema

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

Implementation Reference

  • The handler case for 'playwright_put' in the handleToolCall switch statement. Performs HTTP PUT request via Playwright APIRequestContext and returns response details.
    case "playwright_put":
      try {
        var data = {
          data: args.value,
          headers: {
            'Content-Type': 'application/json'
          }
        };
        var response = await apiContext!.put(args.url, data);
    
        return {
          toolResult: {
            content: [{
              type: "text",
              text: `Performed PUT 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 PUT operation on ${args.url}: ${(error as Error).message}`,
            }],
            isError: true,
          },
        };
      }
  • Tool schema definition including name, description, and input schema for 'playwright_put' 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"],
      },
    },
  • API_TOOLS array includes 'playwright_put' to conditionally set up APIRequestContext in handleToolCall.
    export const API_TOOLS = [
      "playwright_get",
      "playwright_post",
      "playwright_put",
      "playwright_delete",
      "playwright_patch"
    ];
  • src/index.ts:22-26 (registration)
    Tool registration: Calls createToolDefinitions() which includes 'playwright_put' schema, and passes tools to setupRequestHandlers for MCP server.
    // Create tool definitions
    const TOOLS = createToolDefinitions();
    
    // Setup request handlers
    setupRequestHandlers(server, TOOLS);
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the action but doesn't describe what the tool actually does beyond the basic HTTP operation—no information on authentication needs, error handling, response format, rate limits, or side effects. For a tool that performs network 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 extremely concise—a single, direct sentence that states the tool's purpose without any fluff or redundancy. It's front-loaded and wastes no words, making it easy for an agent 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 operations and the lack of annotations or output schema, the description is insufficient. It doesn't cover behavioral aspects like what the tool returns, error conditions, or practical usage context. For a tool that interacts with external systems, more detail is needed to ensure correct invocation.

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 schema description coverage is 100%, with clear descriptions for both parameters (URL and data value). The description doesn't add any meaningful semantics beyond what the schema already provides—it doesn't explain parameter interactions, data format expectations (e.g., JSON, plain text), or usage examples. Baseline 3 is appropriate since the schema does the heavy lifting.

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 PUT request') which is a specific HTTP method, though it doesn't explicitly mention what resource it operates on beyond the URL parameter. It distinguishes itself from siblings like playwright_get or playwright_post by specifying the PUT method, but doesn't articulate what makes PUT unique compared to other HTTP methods in this context.

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_post or playwright_patch. It doesn't mention typical use cases for PUT (e.g., updating or replacing resources), prerequisites, or any context-specific recommendations, leaving the agent to infer usage from the method name alone.

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