Skip to main content
Glama
scmdr

SourceSync.ai MCP Server

by scmdr

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
NameRequiredDescriptionDefault
nameYes
fileStorageConfigYes
vectorStorageConfigYes
embeddingModelConfigYes
webScraperConfigNo
tenantIdNo

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)
        })
      },
    )
  • 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,
    })
  • 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>()
    }
  • 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>

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

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