getNamespace
Retrieve a specific namespace by its ID from SourceSync.ai's knowledge management platform to organize and access content in knowledge bases.
Instructions
Retrieves a specific namespace by its ID.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| namespaceId | No | ||
| tenantId | No |
Implementation Reference
- src/index.ts:160-174 (registration)Registration of the 'getNamespace' MCP tool, including the handler function that creates a SourceSync client and calls getNamespace on it.server.tool( 'getNamespace', 'Retrieves a specific namespace by its ID.', getNamespaceSchema.shape, async (params: GetNamespaceParams) => { return safeApiCall(async () => { const { namespaceId, tenantId } = params // Create a client with the provided API key const client = createClient({ namespaceId, tenantId }) return await client.getNamespace() }) }, )
- src/schemas.ts:125-128 (schema)Zod schema defining input parameters for the getNamespace tool: namespaceId and optional tenantId.export const getNamespaceSchema = z.object({ namespaceId: namespaceIdSchema, tenantId: tenantIdSchema, })
- src/index.ts:164-172 (handler)The handler function for the getNamespace tool, which extracts parameters, creates the client, and delegates to client.getNamespace() wrapped in safeApiCall.async (params: GetNamespaceParams) => { return safeApiCall(async () => { const { namespaceId, tenantId } = params // Create a client with the provided API key const client = createClient({ namespaceId, tenantId }) return await client.getNamespace() })
- src/sourcesync.ts:184-189 (helper)Core implementation in SourceSyncApiClient that performs the HTTP GET request to fetch the namespace details from the API.public async getNamespace(): Promise<SourceSyncGetNamespaceResponse> { return this.client .url(`/v1/namespaces/${this.namespaceId}`) .get() .json<SourceSyncGetNamespaceResponse>() }