Skip to main content
Glama
Desmond-Labs

Supabase Storage MCP

by Desmond-Labs

setup_buckets

Initialize standard storage buckets to organize file management workflows with structured naming conventions.

Instructions

Initialize standard storage buckets for organized file management workflows

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
base_bucket_nameNoBase name for bucketsstorage
user_idNoUser identifier for organization

Implementation Reference

  • The main handler function that implements the setup_buckets tool logic. It creates standard buckets like {base_bucket_name}-images and {base_bucket_name}-exports with security configurations, audits the request, and returns a structured result.
    async function handleSetupBuckets(args: any, requestId: string, startTime: number) {
      const { base_bucket_name = 'storage', user_id } = args;
      
      const inputHash = generateSecureHash(JSON.stringify({ base_bucket_name, user_id }));
      
      try {
        const bucketsToCreate = [
          `${base_bucket_name}-images`,
          `${base_bucket_name}-exports`
        ];
        
        const bucketsCreated: string[] = [];
        
        for (const bucketName of bucketsToCreate) {
          const { data, error } = await supabase.storage.createBucket(bucketName, {
            public: false,
            fileSizeLimit: 50 * 1024 * 1024, // 50MB
            allowedMimeTypes: ['image/jpeg', 'image/png', 'image/webp', 'image/gif']
          });
          
          if (error && !error.message.includes('already exists')) {
            throw new Error(`Failed to create bucket ${bucketName}: ${error.message}`);
          }
          
          bucketsCreated.push(bucketName);
        }
        
        auditRequest('setup_buckets', true, inputHash);
        
        const result: SetupBucketsResult = {
          success: true,
          buckets_created: bucketsCreated,
          message: `Successfully created bucket structure: ${bucketsCreated.join(', ')}`,
          security_configuration: {
            images_bucket: {
              public: false,
              file_size_limit: 50 * 1024 * 1024,
              allowed_mime_types: ['image/jpeg', 'image/png', 'image/webp', 'image/gif'],
              audit_logging_enabled: true,
              threat_detection_enabled: true
            },
            exports_bucket: {
              public: false,
              file_size_limit: 50 * 1024 * 1024,
              allowed_mime_types: ['image/jpeg', 'image/png', 'image/webp', 'image/gif'],
              audit_logging_enabled: true,
              threat_detection_enabled: true
            }
          }
        };
        
        return {
          content: [
            {
              type: 'text',
              text: JSON.stringify(result, null, 2)
            }
          ]
        };
      } catch (error) {
        auditRequest('setup_buckets', false, inputHash, getErrorMessage(error));
        throw error;
      }
    }
  • src/index.ts:84-106 (registration)
    Tool registration in the ListToolsRequestSchema handler, defining the name, description, and input schema for setup_buckets.
    {
      name: 'setup_buckets',
      description: 'Initialize standard storage buckets for organized file management workflows',
      inputSchema: {
        type: 'object',
        properties: {
          base_bucket_name: {
            type: 'string',
            description: 'Base name for buckets',
            default: 'storage',
            minLength: 3,
            maxLength: 50
          },
          user_id: {
            type: 'string',
            description: 'User identifier for organization',
            maxLength: 36
          }
        },
        required: [],
        additionalProperties: false
      }
    },
  • Type definition for the output/result of the setup_buckets tool, used in the handler for structuring the response.
    export interface SetupBucketsResult {
      success: boolean;
      buckets_created: string[];
      message: string;
      security_configuration: {
        images_bucket: {
          public: boolean;
          file_size_limit: number;
          allowed_mime_types: string[];
          audit_logging_enabled: boolean;
          threat_detection_enabled: boolean;
        };
        exports_bucket: {
          public: boolean;
          file_size_limit: number;
          allowed_mime_types: string[];
          audit_logging_enabled: boolean;
          threat_detection_enabled: boolean;
        };
      };
    }
  • src/index.ts:467-468 (registration)
    Dispatch case in the main CallToolRequestSchema switch statement that routes calls to the setup_buckets handler.
    case 'setup_buckets':
      return await handleSetupBuckets(args, requestId, startTime);
Behavior2/5

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

With no annotations provided, the description carries full burden but lacks critical behavioral details. It doesn't disclose whether this is a read/write operation, if it requires specific permissions, what 'standard' means, or potential side effects like overwriting existing buckets, making it insufficient for safe agent invocation.

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 wasted words, clearly front-loading the purpose. It's appropriately sized for a tool with two parameters and no complex annotations, making it easy to parse.

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 no annotations and no output schema, the description is incomplete for a tool that likely performs mutations (implied by 'Initialize'). It lacks details on behavioral traits, return values, error handling, and how it differs from siblings, leaving significant gaps for agent decision-making.

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 the schema fully documents both parameters. The description adds no additional meaning beyond implying 'standard' buckets and 'organized workflows', which doesn't clarify parameter usage beyond what the schema provides, meeting the baseline for high coverage.

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 ('Initialize') and resource ('standard storage buckets'), specifying it's for 'organized file management workflows'. It distinguishes from siblings like 'create_bucket' by implying a multi-bucket setup with organizational standards, though not explicitly contrasting them.

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 'create_bucket' or 'batch_download'. It mentions 'organized file management workflows' but doesn't specify prerequisites, exclusions, or comparative contexts, leaving usage ambiguous.

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/Desmond-Labs/supabase-storage-mcp'

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