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
| Name | Required | Description | Default |
|---|---|---|---|
| embeddingModelConfig | Yes | ||
| fileStorageConfig | Yes | ||
| name | Yes | ||
| tenantId | No | ||
| vectorStorageConfig | Yes | ||
| webScraperConfig | No |
Implementation Reference
- src/index.ts:132-141 (handler)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) }) }, )
- src/schemas.ts:112-119 (schema)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, })
- src/sourcesync.ts:151-169 (helper)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>() }