Skip to main content
Glama

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
NameRequiredDescriptionDefault
namespaceIdNo
tenantIdNo

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()
        })
      },
    )
  • Zod schema defining input parameters for the getNamespace tool: namespaceId and optional tenantId.
    export const getNamespaceSchema = z.object({
      namespaceId: namespaceIdSchema,
      tenantId: tenantIdSchema,
    })
  • 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()
      })
  • 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>()
    }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/pbteja1998/sourcesyncai-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server