Skip to main content
Glama

createNamespace

Configure and establish a new namespace by defining file storage, vector storage, and embedding model settings. Required inputs include name, S3-compatible storage details, vector storage provider, and embedding model specifications.

Instructions

Creates a new namespace with the provided configuration. Requires a name, file storage configuration, vector storage configuration, and embedding model configuration.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
embeddingModelConfigYes
fileStorageConfigYes
nameYes
tenantIdNo
vectorStorageConfigYes
webScraperConfigNo

Implementation Reference

  • MCP tool handler that wraps the client.createNamespace call in safeApiCall for error handling.
    async (params: CreateNamespaceParams) => { return safeApiCall(async () => { const { tenantId, ...createParams } = params // Create a client with the provided API key const client = createClient({ tenantId }) return await client.createNamespace(createParams) }) },
  • src/index.ts:128-142 (registration)
    Registration of the 'createNamespace' MCP tool using server.tool, including name, description, schema reference, and inline handler.
    server.tool( 'createNamespace', 'Creates a new namespace with the provided configuration. Requires a name, file storage configuration, vector storage configuration, and embedding model configuration.', createNamespaceSchema.shape, async (params: CreateNamespaceParams) => { return safeApiCall(async () => { const { tenantId, ...createParams } = params // Create a client with the provided API key const client = createClient({ tenantId }) return await client.createNamespace(createParams) }) }, )
  • Zod schema definition for createNamespace tool input parameters (CreateNamespaceParams).
    export const createNamespaceSchema = z.object({ name: z.string(), fileStorageConfig: fileStorageConfigSchema, vectorStorageConfig: vectorStorageConfigSchema, embeddingModelConfig: embeddingModelConfigSchema, webScraperConfig: webScraperConfigSchema.optional(), tenantId: tenantIdSchema, })
  • SourceSyncApiClient method that performs the actual HTTP POST to /v1/namespaces to create the namespace.
    public async createNamespace({ name, fileStorageConfig, vectorStorageConfig, embeddingModelConfig, webScraperConfig, }: SourceSyncCreateNamespaceRequest): Promise<SourceSyncCreateNamespaceResponse> { return this.client .url('/v1/namespaces') .json({ name, fileStorageConfig, vectorStorageConfig, embeddingModelConfig, webScraperConfig, } satisfies SourceSyncCreateNamespaceRequest) .post() .json<SourceSyncCreateNamespaceResponse>() }

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/pbteja1998/sourcesyncai-mcp'

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