deleteNamespace
Permanently remove a namespace by its ID from SourceSync.ai's knowledge management platform to clean up unused or outdated organizational structures.
Instructions
Permanently deletes a namespace by its ID.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| namespaceId | No | ||
| tenantId | No |
Implementation Reference
- src/index.ts:192-206 (registration)Registration of the 'deleteNamespace' MCP tool using server.tool, including description, input schema, and handler function that delegates to SourceSync client.server.tool( 'deleteNamespace', 'Permanently deletes a namespace by its ID.', deleteNamespaceSchema.shape, async (params: DeleteNamespaceParams) => { return safeApiCall(async () => { const { namespaceId, tenantId } = params // Create a client with the provided API key const client = createClient({ namespaceId, tenantId }) return await client.deleteNamespace() }) }, )
- src/index.ts:196-205 (handler)The handler function executed when the 'deleteNamespace' tool is called. It extracts namespaceId and tenantId from params, creates a SourceSyncApiClient instance, and calls its deleteNamespace method, wrapped in safeApiCall for error handling.async (params: DeleteNamespaceParams) => { return safeApiCall(async () => { const { namespaceId, tenantId } = params // Create a client with the provided API key const client = createClient({ namespaceId, tenantId }) return await client.deleteNamespace() }) },
- src/schemas.ts:145-148 (schema)Zod schema defining the input parameters for the deleteNamespace tool: optional namespaceId and tenantId.export const deleteNamespaceSchema = z.object({ namespaceId: namespaceIdSchema, tenantId: tenantIdSchema, })
- src/schemas.ts:170-170 (schema)TypeScript type inferred from deleteNamespaceSchema for input parameters.export type DeleteNamespaceParams = z.infer<typeof deleteNamespaceSchema>
- src/sourcesync.ts:227-232 (helper)Core implementation in SourceSyncApiClient: sends DELETE request to `/v1/namespaces/${namespaceId}` endpoint to delete the namespace.public async deleteNamespace(): Promise<SourceSyncDeleteNamespaceResponse> { return this.client .url(`/v1/namespaces/${this.namespaceId}`) .delete() .json<SourceSyncDeleteNamespaceResponse>() }