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
| Name | Required | Description | Default |
|---|---|---|---|
| namespaceId | No | ||
| connectionId | Yes | ||
| tenantId | No |
Implementation Reference
- src/index.ts:677-693 (handler)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, }) }) }, ) - src/schemas.ts:481-485 (schema)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, }) - src/sourcesync.ts:273-281 (helper)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>() } - src/sourcesync.types.ts:351-357 (schema)TypeScript type definitions for the SourceSync API getConnection request and response structures.
export type SourceSyncGetConnectionRequest = { connectionId: string } export type SourceSyncGetConnectionResponse = SourceSyncApiResponse<{ connection: SourceSyncConnection }>