Skip to main content
Glama
scmdr

SourceSync.ai MCP Server

by scmdr

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

Implementation Reference

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

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/scmdr/sourcesyncai-mcp'

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