createNamespace
Create a new namespace in SourceSync.ai by configuring file storage, vector storage, and embedding models for organizing and managing documents with semantic search capabilities.
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 |
|---|---|---|---|
| name | Yes | ||
| fileStorageConfig | Yes | ||
| vectorStorageConfig | Yes | ||
| embeddingModelConfig | Yes | ||
| webScraperConfig | No | ||
| tenantId | No |
Implementation Reference
- src/index.ts:128-142 (registration)Registration of the MCP 'createNamespace' tool, including the inline handler that delegates to SourceSync client.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 defining input parameters for the createNamespace tool.export const createNamespaceSchema = z.object({ name: z.string(), fileStorageConfig: fileStorageConfigSchema, vectorStorageConfig: vectorStorageConfigSchema, embeddingModelConfig: embeddingModelConfigSchema, webScraperConfig: webScraperConfigSchema.optional(), tenantId: tenantIdSchema, })
- src/sourcesync.ts:151-169 (handler)Core implementation in SourceSyncApiClient that sends POST request 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>() }
- src/sourcesync.types.ts:258-268 (schema)TypeScript type definitions for createNamespace request and response.export type SourceSyncCreateNamespaceRequest = { name: string fileStorageConfig: SourceSyncFileStorageConfig vectorStorageConfig: SourceSyncVectorStorageConfig embeddingModelConfig: SourceSyncEmbeddingModelConfig webScraperConfig?: SourceSyncWebScraperConfig } export type SourceSyncCreateNamespaceResponse = SourceSyncApiResponse<SourceSyncNamespace>