getNamespace
Retrieve a specific namespace by its ID to organize and manage documents on SourceSync.ai's knowledge management platform for efficient content ingestion and semantic search.
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:164-173 (handler)MCP tool handler for 'getNamespace': extracts namespaceId and tenantId from params, creates SourceSync client, and calls 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/index.ts:160-174 (registration)Registration of the 'getNamespace' MCP tool using server.tool, including name, description, schema, and handler function.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 getNamespace tool: optional namespaceId and tenantId.export const getNamespaceSchema = z.object({ namespaceId: namespaceIdSchema, tenantId: tenantIdSchema, })
- src/sourcesync.ts:184-189 (helper)SourceSyncApiClient helper method getNamespace() that performs the actual API GET request to /v1/namespaces/{namespaceId}.public async getNamespace(): Promise<SourceSyncGetNamespaceResponse> { return this.client .url(`/v1/namespaces/${this.namespaceId}`) .get() .json<SourceSyncGetNamespaceResponse>() }