Skip to main content
Glama

create_bucket

Create a new storage bucket with security validation and audit logging. Specify bucket name and public/private access to organize and secure your Supabase Storage files.

Instructions

Create a new storage bucket with comprehensive security validation and audit logging

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
bucket_nameYesName of the bucket to create (3-63 chars, lowercase, alphanumeric with hyphens)
is_publicNoWhether the bucket should be public

Implementation Reference

  • Main handler function for 'create_bucket' tool. Validates input, calls supabase.storage.createBucket, handles errors, audits the request, and returns success response with security info.
    async function handleCreateBucket(args: any, requestId: string, startTime: number) { const { bucket_name, is_public } = args as { bucket_name: string; is_public?: boolean }; // Input validation if (!bucket_name || typeof bucket_name !== 'string') { throw new Error('Invalid bucket_name parameter'); } const inputHash = generateSecureHash(JSON.stringify({ bucket_name, is_public })); try { const options: any = { public: is_public || false }; const { data, error } = await supabase.storage.createBucket(bucket_name, options); if (error) { throw new Error(`Failed to create bucket: ${error.message}`); } auditRequest('create_bucket', true, inputHash); return { content: [ { type: 'text', text: JSON.stringify({ success: true, message: `Successfully created secure bucket: ${bucket_name}`, bucket_name: data.name, security_configuration: { public: options.public, audit_logging_enabled: true, threat_detection_enabled: true }, request_id: requestId, processing_time: Date.now() - startTime }, null, 2) } ] }; } catch (error) { auditRequest('create_bucket', false, inputHash, getErrorMessage(error)); throw error; } }
  • Tool registration and input schema definition for 'create_bucket' in the ListToolsRequestSchema handler. Specifies parameters: bucket_name (required, validated), is_public (optional boolean).
    { name: 'create_bucket', description: 'Create a new storage bucket with comprehensive security validation and audit logging', inputSchema: { type: 'object', properties: { bucket_name: { type: 'string', description: 'Name of the bucket to create (3-63 chars, lowercase, alphanumeric with hyphens)', minLength: 3, maxLength: 63, pattern: '^[a-z0-9][a-z0-9\\-]*[a-z0-9]$' }, is_public: { type: 'boolean', description: 'Whether the bucket should be public', default: false } }, required: ['bucket_name'], additionalProperties: false }
  • src/index.ts:464-465 (registration)
    Dispatch/registration in the main CallToolRequestSchema switch statement, routing 'create_bucket' calls to handleCreateBucket function.
    case 'create_bucket': return await handleCreateBucket(args, requestId, startTime);

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