listNamespaces
Retrieve available namespaces for organizing content in SourceSync.ai knowledge bases using your API key and tenant ID.
Instructions
Lists all namespaces available for the current API key and optional tenant ID.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| tenantId | No |
Implementation Reference
- src/index.ts:144-158 (handler)MCP tool handler for 'listNamespaces'. Creates a SourceSync client using the provided tenantId and delegates to client.listNamespaces(), wrapped in safeApiCall for error handling.server.tool( 'listNamespaces', 'Lists all namespaces available for the current API key and optional tenant ID.', listNamespacesSchema.shape, async (params: ListNamespacesParams) => { return safeApiCall(async () => { const { tenantId } = params // Create a client with the provided API key const client = createClient({ tenantId }) return await client.listNamespaces() }) }, )
- src/schemas.ts:121-123 (schema)Zod schema defining the input parameters for the listNamespaces tool (optional tenantId).export const listNamespacesSchema = z.object({ tenantId: tenantIdSchema, })
- src/sourcesync.ts:174-179 (helper)SourceSyncApiClient.listNamespaces() method implementation, which makes a GET request to /v1/namespaces to retrieve the list of namespaces.public async listNamespaces(): Promise<SourceSyncListNamespacesResponse> { return this.client .url('/v1/namespaces') .get() .json<SourceSyncListNamespacesResponse>() }
- src/sourcesync.types.ts:269-271 (schema)TypeScript type for the response of listNamespaces API call.export type SourceSyncListNamespacesResponse = SourceSyncApiResponse< SourceSyncNamespace[] >