Skip to main content
Glama
247arjun
by 247arjun

curl_delete

Send HTTP DELETE requests via curl to remove or delete resources from specified URLs, with optional headers, redirects, and timeout settings.

Instructions

Make an HTTP DELETE request using curl

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
follow_redirectsNoWhether to follow redirects
headersNoOptional HTTP headers in the format 'Header: Value'
timeoutNoRequest timeout in seconds
urlYesThe URL to make the DELETE request to

Implementation Reference

  • The handler function for the 'curl_delete' tool. It constructs the curl command arguments for an HTTP DELETE request, including URL, headers, redirects, and timeout options, then executes it using the shared executeCurl helper and returns the response.
    async ({ url, headers, follow_redirects, timeout }) => {
      const args = ['curl'];
      
      // Add the URL
      args.push(url);
      
      // Add DELETE method
      args.push('-X', 'DELETE');
      
      // Add headers if provided
      if (headers && headers.length > 0) {
        headers.forEach(header => {
          args.push('-H', header);
        });
      }
      
      // Add follow redirects option
      if (follow_redirects) {
        args.push('-L');
      }
      
      // Add timeout if provided
      if (timeout) {
        args.push('--max-time', timeout.toString());
      }
      
      // Include response headers in output
      args.push('-i');
      
      try {
        const result = await executeCurl(args);
        
        return {
          content: [
            {
              type: "text",
              text: `Exit Code: ${result.exitCode}\n\nResponse:\n${result.stdout}${result.stderr ? `\n\nErrors:\n${result.stderr}` : ''}`,
            },
          ],
        };
      } catch (error) {
        return {
          content: [
            {
              type: "text",
              text: `Error executing curl: ${error instanceof Error ? error.message : String(error)}`,
            },
          ],
        };
      }
  • Zod schema defining the input parameters for the 'curl_delete' tool: url (required), headers (optional array), follow_redirects (optional boolean, default false), timeout (optional number).
    {
      url: z.string().describe("The URL to make the DELETE request to"),
      headers: z.array(z.string()).optional().describe("Optional HTTP headers in the format 'Header: Value'"),
      follow_redirects: z.boolean().optional().default(false).describe("Whether to follow redirects"),
      timeout: z.number().optional().describe("Request timeout in seconds"),
    },
  • src/index.ts:293-295 (registration)
    Registration of the 'curl_delete' tool on the MCP server instance, specifying name, description, input schema, and handler function.
    server.tool(
      "curl_delete",
      "Make an HTTP DELETE request using curl",
  • Shared helper function used by all curl tools, including curl_delete, to safely spawn and execute curl processes, capturing stdout, stderr, and exit code.
    async function executeCurl(args: string[]): Promise<{ stdout: string; stderr: string; exitCode: number }> {
      return new Promise((resolve) => {
        // Ensure we're only calling curl with safe arguments
        if (!args.includes('curl')) {
          args.unshift('curl');
        }
        
        const child = spawn('curl', args.slice(1), {
          stdio: ['pipe', 'pipe', 'pipe'],
          shell: false,
        });
    
        let stdout = '';
        let stderr = '';
    
        child.stdout.on('data', (data) => {
          stdout += data.toString();
        });
    
        child.stderr.on('data', (data) => {
          stderr += data.toString();
        });
    
        child.on('close', (code) => {
          resolve({
            stdout,
            stderr,
            exitCode: code || 0,
          });
        });
    
        child.on('error', (error) => {
          resolve({
            stdout: '',
            stderr: error.message,
            exitCode: 1,
          });
        });
      });
    }
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 but only states the basic action. It doesn't mention potential side effects (e.g., resource deletion), error handling, rate limits, or authentication requirements, which are critical for a destructive operation like DELETE. This leaves significant gaps in understanding the tool's behavior.

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, direct sentence with zero waste—it states exactly what the tool does without unnecessary words. It's appropriately sized and front-loaded, 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 an HTTP DELETE operation (a potentially destructive action) and the lack of annotations and output schema, the description is incomplete. It fails to address key aspects like what the tool returns, error conditions, or safety considerations, which are essential for proper tool invocation in this context.

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%, so all parameters are documented in the schema. The description adds no additional meaning about parameters beyond what the schema provides, such as examples or constraints. This meets the baseline for high schema coverage but doesn't enhance parameter understanding.

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 ('Make an HTTP DELETE request') and the method ('using curl'), which is specific and unambiguous. However, it doesn't distinguish this tool from its sibling tools (curl_get, curl_post, etc.) beyond the HTTP method, missing explicit 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 curl_advanced or other HTTP method-specific tools. It lacks context about scenarios where DELETE is appropriate or prerequisites such as authentication needs, leaving the agent to infer usage from the 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/247arjun/mcp-curl'

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