Skip to main content
Glama

api_delete

Send a DELETE request to a specified API endpoint, allowing removal of resources or data. Requires URL and optional headers for structured API interactions within browser automation workflows.

Instructions

Perform a DELETE request to an API endpoint

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
headersNoRequest headers
urlYesAPI endpoint URL

Implementation Reference

  • The core handler function that performs the DELETE HTTP request to the specified URL using Playwright's APIRequestContext, returning the response status or error message.
    async function handleApiDelete(client: APIRequestContext, args: any): Promise<{ toolResult: CallToolResult }> {
      try {
        const options = args.headers ? { headers: args.headers } : undefined;
        const response = await client.delete(args.url, options);
        return {
          toolResult: {
            content: [
              {
                type: "text",
                text: `DELETE ${args.url} - Status: ${response.status()}`,
              }
            ],
            isError: false,
          },
        };
      } catch (error) {
        return {
          toolResult: {
            content: [{
              type: "text",
              text: `DELETE request failed: ${(error as Error).message}`,
            }],
            isError: true,
          },
        };
      }
    }
  • src/tools.ts:198-213 (registration)
    Registers the 'api_delete' tool in the registerTools() function, including its name, description, and input schema definition.
    {
      name: "api_delete",
      description: "Perform a DELETE request to an API endpoint",
      inputSchema: {
        type: "object",
        properties: {
          url: { type: "string", description: "API endpoint URL" },
          headers: { 
            type: "object", 
            description: "Request headers",
            additionalProperties: { type: "string" }
          }
        },
        required: ["url"]
      }
    }
  • Defines the input schema for the api_delete tool, specifying the required 'url' parameter and optional 'headers'.
    inputSchema: {
      type: "object",
      properties: {
        url: { type: "string", description: "API endpoint URL" },
        headers: { 
          type: "object", 
          description: "Request headers",
          additionalProperties: { type: "string" }
        }
      },
      required: ["url"]
    }
  • Switch case in executeToolCall that routes api_delete tool calls to the handleApiDelete handler.
    case "api_delete":
      return await handleApiDelete(apiClient!, args);
Behavior2/5

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

With no annotations, the description carries full burden but only states the basic action. It doesn't disclose critical behavioral traits such as authentication needs, rate limits, error handling, or that DELETE is typically destructive—significant gaps for a mutation tool.

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, clearly front-loaded with the core action. It's appropriately sized for the tool's scope.

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?

For a mutation tool with no annotations and no output schema, the description is inadequate. It lacks details on behavior, error handling, or response format, leaving the agent with insufficient context to use it correctly.

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 parameters are documented in the schema. The description adds no meaning beyond the schema, such as example usage or constraints, but doesn't need to compensate for gaps, meeting the baseline.

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 a DELETE request') and target ('to an API endpoint'), which is specific and unambiguous. However, it doesn't differentiate from sibling tools like api_get or api_post beyond the HTTP method, missing explicit distinction.

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?

No guidance is provided on when to use this tool versus alternatives like api_get or api_post, nor any context about prerequisites or exclusions. The description merely states what it does without 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/imprvhub/mcp-browser-agent'

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