Skip to main content
Glama
InsForge

Insforge MCP Server

delete-bucket

Remove a storage bucket from the Insforge MCP Server to manage cloud storage resources. Specify the bucket name to delete it permanently.

Instructions

Deletes a storage bucket

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
apiKeyNoAPI key for authentication (optional if provided via --api_key)
bucketNameYesName of the bucket to delete

Implementation Reference

  • The core handler logic for the 'delete-bucket' tool. It performs a DELETE request to the storage API endpoint using the provided bucket name and API key, handles the response, and returns formatted success or error messages.
    withUsageTracking('delete-bucket', async ({ apiKey, bucketName }) => {
      try {
        const actualApiKey = getApiKey(apiKey);
        const response = await fetch(`${API_BASE_URL}/api/storage/buckets/${bucketName}`, {
          method: 'DELETE',
          headers: {
            'x-api-key': actualApiKey,
          },
        });
    
        const result = await handleApiResponse(response);
    
        return await addBackgroundContext({
          content: [
            {
              type: 'text',
              text: formatSuccessMessage('Bucket deleted', result),
            },
          ],
        });
      } catch (error) {
        const errMsg = error instanceof Error ? error.message : 'Unknown error occurred';
        return {
          content: [
            {
              type: 'text',
              text: `Error deleting bucket: ${errMsg}`,
            },
          ],
          isError: true,
        };
      }
    })
  • Zod schema defining the input parameters: apiKey (optional string) and bucketName (required string).
    {
      apiKey: z
        .string()
        .optional()
        .describe('API key for authentication (optional if provided via --api_key)'),
      bucketName: z.string().describe('Name of the bucket to delete'),
    },
  • The server.tool() call that registers the 'delete-bucket' tool, specifying its name, description, input schema, and handler function.
    server.tool(
      'delete-bucket',
      'Deletes a storage bucket',
      {
        apiKey: z
          .string()
          .optional()
          .describe('API key for authentication (optional if provided via --api_key)'),
        bucketName: z.string().describe('Name of the bucket to delete'),
      },
      withUsageTracking('delete-bucket', async ({ apiKey, bucketName }) => {
        try {
          const actualApiKey = getApiKey(apiKey);
          const response = await fetch(`${API_BASE_URL}/api/storage/buckets/${bucketName}`, {
            method: 'DELETE',
            headers: {
              'x-api-key': actualApiKey,
            },
          });
    
          const result = await handleApiResponse(response);
    
          return await addBackgroundContext({
            content: [
              {
                type: 'text',
                text: formatSuccessMessage('Bucket deleted', result),
              },
            ],
          });
        } catch (error) {
          const errMsg = error instanceof Error ? error.message : 'Unknown error occurred';
          return {
            content: [
              {
                type: 'text',
                text: `Error deleting bucket: ${errMsg}`,
              },
            ],
            isError: true,
          };
        }
      })
    );

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/InsForge/insforge-mcp'

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