Skip to main content
Glama

api_delete

Remove a resource from a web API by performing a DELETE request with configurable headers.

Instructions

Perform a DELETE request to an API endpoint

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlYesAPI endpoint URL
headersNoRequest headers

Implementation Reference

  • The handleApiDelete function is the actual handler that executes the api_delete tool logic. It makes an HTTP DELETE request using Playwright's APIRequestContext, optionally passing headers, and returns the status code.
    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,
          },
        };
      }
    }
  • The schema definition for the api_delete tool, specifying its name, description, and input schema (url required, headers optional).
    {
      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"]
      }
    }
  • src/tools.ts:14-20 (registration)
    The API_TOOLS array that registers 'api_delete' as one of the available API tools.
    export const API_TOOLS = [
      "api_get",
      "api_post",
      "api_put",
      "api_patch",
      "api_delete"
    ];
  • The switch case in executeToolCall that dispatches the 'api_delete' tool name to handleApiDelete.
    case "api_delete":
      return await handleApiDelete(apiClient!, args);
  • The CallToolRequestSchema handler that receives tool call requests and delegates to executeToolCall, which handles api_delete routing.
    server.setRequestHandler(CallToolRequestSchema, async (request) => {
      return executeToolCall(
        request.params.name, 
        request.params.arguments ?? {}, 
        server
      );
    });
Behavior2/5

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

With no annotations, the description carries the full burden but only states the action without disclosing side effects, idempotency, authentication needs, rate limits, or return format. This is minimal for an agent.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, front-loaded sentence with no wasted words. It is appropriately concise for a simple tool, though slightly more context could be included without losing efficiency.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's simplicity (2 params, no output schema), the description covers the basic action but omits expected return values, error conditions, or usage scope, leaving the description marginally adequate.

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 coverage is 100% with descriptive parameter names (url, headers). The description adds no additional meaning beyond the schema, so baseline 3 is appropriate.

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

Purpose5/5

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

The description clearly states the tool performs a DELETE request to an API endpoint, using a specific verb and resource that distinguishes it from sibling tools (api_get, api_patch, etc.) which handle other 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?

No guidance is provided on when to use this tool versus alternatives like api_get or api_post. The description merely repeats the method, missing explicit when/when-not context or prerequisites.

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/imprvhub/mcp-browser-agent'

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