listNamespaces
Retrieve available namespaces for your SourceSync.ai API key to organize and access knowledge management content.
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:148-157 (handler)MCP tool handler function that creates a SourceSync client and calls its listNamespaces method, wrapped in safeApiCall for error handling.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/index.ts:144-158 (registration)Registration of the 'listNamespaces' MCP tool using server.tool, including name, description, input schema, and handler.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 listNamespaces tool (optional tenantId).export const listNamespacesSchema = z.object({ tenantId: tenantIdSchema, })
- src/sourcesync.ts:174-179 (helper)SourceSyncApiClient method that performs the actual HTTP GET request to /v1/namespaces to list namespaces.public async listNamespaces(): Promise<SourceSyncListNamespacesResponse> { return this.client .url('/v1/namespaces') .get() .json<SourceSyncListNamespacesResponse>() }