getNamespace
Retrieve a specific namespace by its ID to access organized content within SourceSync.ai's knowledge management platform.
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 SourceSyncApiClient, calls its getNamespace() method, and wraps the call in safeApiCall for error handling.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)Registers the 'getNamespace' tool on the MCP server using server.tool(), providing name, description, input schema from getNamespaceSchema, and the 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 for 'getNamespace' tool inputs: optional namespaceId (string) and tenantId (string).export const getNamespaceSchema = z.object({ namespaceId: namespaceIdSchema, tenantId: tenantIdSchema, })
- src/sourcesync.ts:184-189 (helper)Core implementation in SourceSyncApiClient: makes authenticated GET request to `/v1/namespaces/${namespaceId}` using wretch client and returns the parsed JSON response.public async getNamespace(): Promise<SourceSyncGetNamespaceResponse> { return this.client .url(`/v1/namespaces/${this.namespaceId}`) .get() .json<SourceSyncGetNamespaceResponse>() }