Skip to main content
Glama

getConnection

Retrieve details for a specific connection by its ID in SourceSync.ai's knowledge management platform to organize, ingest, retrieve, and search content.

Instructions

Retrieves details for a specific connection by its ID.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
namespaceIdNo
connectionIdYes
tenantIdNo

Implementation Reference

  • MCP tool registration and handler function for 'getConnection'. Creates a SourceSyncApiClient instance and invokes its getConnection method to retrieve connection details by ID.
    server.tool(
      'getConnection',
      'Retrieves details for a specific connection by its ID.',
      GetConnectionSchema.shape,
      async (params) => {
        return safeApiCall(async () => {
          const { namespaceId, tenantId, connectionId } = params
    
          // Create a client with the provided API key
          const client = createClient({ namespaceId, tenantId })
    
          return await client.getConnection({
            connectionId,
          })
        })
      },
    )
  • Zod schema defining the input parameters for the getConnection tool: optional namespaceId, required connectionId, optional tenantId.
    export const GetConnectionSchema = z.object({
      namespaceId: namespaceIdSchema.optional(),
      connectionId: z.string(),
      tenantId: tenantIdSchema,
    })
  • SourceSyncApiClient.getConnection method implementation. Makes a GET request to the SourceSync API endpoint `/v1/connections/{connectionId}` with namespaceId query param to fetch connection details.
    public async getConnection({
      connectionId,
    }: SourceSyncGetConnectionRequest): Promise<SourceSyncGetConnectionResponse> {
      return this.client
        .url(`/v1/connections/${connectionId}`)
        .query({ namespaceId: this.namespaceId })
        .get()
        .json<SourceSyncGetConnectionResponse>()
    }
  • TypeScript type definitions for the SourceSync API getConnection request and response structures.
    export type SourceSyncGetConnectionRequest = {
      connectionId: string
    }
    
    export type SourceSyncGetConnectionResponse = SourceSyncApiResponse<{
      connection: SourceSyncConnection
    }>

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