Skip to main content
Glama
pvinis
by pvinis

playwright_put

Execute HTTP PUT requests to send data to specified URLs, enabling direct updates or modifications to web resources in a real browser 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 PutRequestTool class and its execute method implement the core logic for the 'playwright_put' tool, performing an HTTP PUT request using Playwright's APIRequestContext.put(), handling JSON validation, and returning status and response details.
    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 ? '...' : ''}`
          ]);
        });
      }
    }
  • Tool schema definition for 'playwright_put', including name, description, and input schema requiring 'url' and 'value' parameters.
    {
      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"],
      },
    },
  • Registration and dispatch in the main tool handler switch statement, routing 'playwright_put' calls to the PutRequestTool.execute method.
    case "playwright_put":
      return await putRequestTool.execute(args, context);
  • Instantiation of the PutRequestTool instance in the initializeTools function.
    if (!putRequestTool) putRequestTool = new PutRequestTool(server);
  • src/tools.ts:431-432 (registration)
    Inclusion of 'playwright_put' in the API_TOOLS array for conditional API context initialization.
    "playwright_put",
    "playwright_delete",
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. While it mentions 'Perform an HTTP PUT request', it doesn't describe what this entails—whether it requires authentication, has side effects (mutations), handles errors, or returns specific response data. For a mutation tool 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 ('Perform an HTTP PUT request') with zero waste. It's front-loaded and appropriately sized for the tool's purpose, 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 an HTTP PUT operation (a mutation tool with no annotations and no output schema), the description is incomplete. It doesn't explain what the tool returns, error handling, authentication needs, or typical use cases. For a tool that likely modifies server-side resources, more context is needed to guide safe and effective 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?

The input schema has 100% description coverage, with clear documentation for both parameters ('url' and 'value'). The description doesn't add any semantic details beyond what the schema provides, such as format examples or constraints. With high schema coverage, the baseline score of 3 is appropriate.

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 verb+resource combination. However, it doesn't distinguish this tool from its sibling 'playwright_patch' or 'playwright_post', which are also HTTP methods. The purpose is clear but lacks sibling differentiation.

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_patch' or 'playwright_post'. There's no mention of typical use cases for PUT requests (e.g., updating resources) or prerequisites. It's a generic statement with no usage 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

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/pvinis/mcp-playwright-stealth'

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