getConnection
Retrieve connection details by ID to access SourceSync.ai knowledge management platform data sources.
Instructions
Retrieves details for a specific connection by its ID.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| namespaceId | No | ||
| connectionId | Yes | ||
| tenantId | No |
Implementation Reference
- src/index.ts:677-693 (handler)MCP tool registration and handler implementation for 'getConnection'. The handler extracts namespaceId, tenantId, and connectionId from input params, creates a SourceSyncApiClient instance, and calls its getConnection method, wrapped in safeApiCall for standardized error handling and response formatting.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, }) }) }, )
- src/schemas.ts:481-485 (schema)Zod schema defining the input shape for the getConnection tool: optional namespaceId and tenantId, required connectionId.export const GetConnectionSchema = z.object({ namespaceId: namespaceIdSchema.optional(), connectionId: z.string(), tenantId: tenantIdSchema, })
- src/sourcesync.ts:273-281 (helper)Core API client method that performs the HTTP GET request to /v1/connections/{connectionId} with namespaceId query param to retrieve the connection details from SourceSync API.public async getConnection({ connectionId, }: SourceSyncGetConnectionRequest): Promise<SourceSyncGetConnectionResponse> { return this.client .url(`/v1/connections/${connectionId}`) .query({ namespaceId: this.namespaceId }) .get() .json<SourceSyncGetConnectionResponse>() }
- src/sourcesync.types.ts:351-357 (schema)TypeScript interfaces defining the request (connectionId) and response shape (SourceSyncApiResponse containing SourceSyncConnection) for the internal getConnection API call.export type SourceSyncGetConnectionRequest = { connectionId: string } export type SourceSyncGetConnectionResponse = SourceSyncApiResponse<{ connection: SourceSyncConnection }>