Skip to main content
Glama
devskido

Playwright MCP Server

by devskido

playwright_put

Send HTTP PUT requests to update web resources by providing URL and data payload for browser automation tasks.

Instructions

Perform an HTTP PUT request

Input Schema

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

Implementation Reference

  • PutRequestTool.execute method implements the core logic: performs HTTP PUT request via apiContext.put, handles JSON validation, extracts and truncates response.
    export class PutRequestTool extends ApiToolBase {
      /**
       * Execute the PUT request tool
       */
      async execute(args: any, context: ToolContext): Promise<ToolResponse> {
        return this.safeExecute(context, async (apiContext) => {
          // Check if the value is valid JSON if it starts with { or [
          if (args.value && typeof args.value === 'string' && 
              (args.value.startsWith('{') || args.value.startsWith('['))) {
            try {
              JSON.parse(args.value);
            } catch (error) {
              return createErrorResponse(`Failed to parse request body: ${(error as Error).message}`);
            }
          }
          
          const response = await apiContext.put(args.url, {
            data: args.value
          });
          
          let responseText;
          try {
            responseText = await response.text();
          } catch (error) {
            responseText = "Unable to get response text";
          }
          
          return createSuccessResponse([
            `PUT request to ${args.url}`,
            `Status: ${response.status()} ${response.statusText()}`,
            `Response: ${responseText.substring(0, 1000)}${responseText.length > 1000 ? '...' : ''}`
          ]);
        });
      }
    }
  • Input schema definition for the playwright_put tool 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"],
      },
    },
  • Dispatch in handleToolCall switch statement routes 'playwright_put' calls to the PutRequestTool instance.
    case "playwright_put":
      return await putRequestTool.execute(args, context);
  • Instantiation of PutRequestTool instance in initializeTools().
    if (!putRequestTool) putRequestTool = new PutRequestTool(server);
  • playwright_put listed in API_TOOLS, used in toolHandler to conditionally create API request context.
    // API Request tools for conditional launch
    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?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the action but doesn't describe what happens during execution—such as error handling, response expectations, or side effects. For a mutation tool (PUT implies writing data) with zero annotation coverage, 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 front-loaded and appropriately sized for a simple tool, avoiding unnecessary elaboration while stating the core action clearly.

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 this is a mutation tool (PUT) with no annotations, no output schema, and minimal description, the description is incomplete. It doesn't explain what the tool returns, error conditions, or how it integrates with the Playwright context (e.g., browser session). For a tool that modifies data, more context is needed to ensure safe and correct usage.

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%, with both parameters ('url' and 'value') clearly documented in the schema. The description adds no additional meaning beyond what the schema provides, such as format details or examples. Baseline 3 is appropriate when the schema does the heavy lifting, but no extra value is added.

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 PUT request' clearly states the action (perform) and resource (HTTP PUT request), but it's generic and doesn't distinguish this tool from its sibling 'playwright_patch' or 'playwright_post' which are also HTTP methods. It lacks specificity about what makes PUT unique compared to other HTTP verbs 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 resources idempotently) or prerequisites, leaving the agent to infer usage from general HTTP knowledge without tool-specific context.

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/devskido/customed-playwright'

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