Skip to main content
Glama

create-bucket

Create a new storage bucket for organizing and managing files in cloud infrastructure, with options to set public or private access.

Instructions

Create new storage bucket

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
apiKeyNoAPI key for authentication (optional if provided via --api_key)
bucketNameYes
isPublicNo

Implementation Reference

  • Core execution logic for the create-bucket tool: authenticates with API key, sends POST request to backend /api/storage/buckets endpoint with bucketName and isPublic, handles response with formatting and background context, or returns error.
    withUsageTracking('create-bucket', async ({ apiKey, bucketName, isPublic }) => { try { const actualApiKey = getApiKey(apiKey); const response = await fetch(`${API_BASE_URL}/api/storage/buckets`, { method: 'POST', headers: { 'x-api-key': actualApiKey, 'Content-Type': 'application/json', }, body: JSON.stringify({ bucketName, isPublic } as CreateBucketRequest), }); const result = await handleApiResponse(response); return await addBackgroundContext({ content: [ { type: 'text', text: formatSuccessMessage('Bucket created', result), }, ], }); } catch (error) { const errMsg = error instanceof Error ? error.message : 'Unknown error occurred'; return { content: [ { type: 'text', text: `Error creating bucket: ${errMsg}`, }, ], isError: true, }; } })
  • MCP server.tool registration for 'create-bucket': specifies name, description, input parameters schema, and references the wrapped handler function.
    server.tool( 'create-bucket', 'Create new storage bucket', { apiKey: z .string() .optional() .describe('API key for authentication (optional if provided via --api_key)'), ...createBucketRequestSchema.shape, }, withUsageTracking('create-bucket', async ({ apiKey, bucketName, isPublic }) => { try { const actualApiKey = getApiKey(apiKey); const response = await fetch(`${API_BASE_URL}/api/storage/buckets`, { method: 'POST', headers: { 'x-api-key': actualApiKey, 'Content-Type': 'application/json', }, body: JSON.stringify({ bucketName, isPublic } as CreateBucketRequest), }); const result = await handleApiResponse(response); return await addBackgroundContext({ content: [ { type: 'text', text: formatSuccessMessage('Bucket created', result), }, ], }); } catch (error) { const errMsg = error instanceof Error ? error.message : 'Unknown error occurred'; return { content: [ { type: 'text', text: `Error creating bucket: ${errMsg}`, }, ], isError: true, }; } }) );
  • Input validation schema using Zod: optional apiKey string and spreads createBucketRequestSchema.shape (defines bucketName and isPublic fields). createBucketRequestSchema imported from external package.
    { apiKey: z .string() .optional() .describe('API key for authentication (optional if provided via --api_key)'), ...createBucketRequestSchema.shape, },
  • Registers all Insforge tools (including create-bucket) on the Streamable HTTP MCP server instance.
    registerInsforgeTools(mcpServer, { apiKey, apiBaseUrl, });
  • Registers all Insforge tools (including create-bucket) on the Stdio MCP server instance.
    const toolsConfig = registerInsforgeTools(server, { apiKey: api_key, apiBaseUrl: api_base_url || process.env.API_BASE_URL, });

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