Skip to main content
Glama

updateConnection

Modify an existing data source connection to change the source, update redirect URLs, or select different documents for ingestion in SourceSync.ai.

Instructions

Updates a connection to a specific source. The connector parameter should be a valid SourceSync connector enum value. The clientRedirectUrl parameter is optional and can be used to specify a custom redirect URL for the connection. This will give you a authorization url which you can redirect the user to. The user will then be asked to pick the documents they want to ingest. This is useful if you want to update the connection to a different source or if you want to update the clientRedirectUrl or if you want to pick a different or new set of documents.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
namespaceIdNo
connectionIdYes
nameNo
clientRedirectUrlNo
tenantIdNo

Implementation Reference

  • MCP tool handler for 'updateConnection': extracts parameters, creates SourceSyncApiClient instance, and delegates to its updateConnection method wrapped in safeApiCall for error handling.
    async (params) => { return safeApiCall(async () => { const { namespaceId, tenantId, connectionId, name, clientRedirectUrl } = params // Create a client with the provided API key const client = createClient({ namespaceId, tenantId }) return await client.updateConnection({ connectionId, name, clientRedirectUrl, }) }) },
  • Zod schema defining the input parameters and validation for the updateConnection tool.
    export const UpdateConnectionSchema = z.object({ namespaceId: namespaceIdSchema.optional(), connectionId: z.string(), name: z.string().optional(), clientRedirectUrl: z.string().optional(), tenantId: tenantIdSchema, })
  • src/index.ts:695-714 (registration)
    Registers the 'updateConnection' tool on the MCP server with name, description, input schema, and handler function.
    server.tool( 'updateConnection', 'Updates a connection to a specific source. The connector parameter should be a valid SourceSync connector enum value. The clientRedirectUrl parameter is optional and can be used to specify a custom redirect URL for the connection. This will give you a authorization url which you can redirect the user to. The user will then be asked to pick the documents they want to ingest. This is useful if you want to update the connection to a different source or if you want to update the clientRedirectUrl or if you want to pick a different or new set of documents.', UpdateConnectionSchema.shape, async (params) => { return safeApiCall(async () => { const { namespaceId, tenantId, connectionId, name, clientRedirectUrl } = params // Create a client with the provided API key const client = createClient({ namespaceId, tenantId }) return await client.updateConnection({ connectionId, name, clientRedirectUrl, }) }) }, )
  • Implementation of SourceSyncApiClient.updateConnection: sends PATCH request to /v1/connections/{connectionId} with namespaceId, name, and clientRedirectUrl.
    public async updateConnection({ connectionId, name, clientRedirectUrl, }: Omit<SourceSyncUpdateConnectionRequest, 'namespaceId'> & { connectionId: string }): Promise<SourceSyncUpdateConnectionResponse> { return this.client .url(`/v1/connections/${connectionId}`) .json({ namespaceId: this.namespaceId, name, clientRedirectUrl, } satisfies SourceSyncUpdateConnectionRequest) .patch() .json<SourceSyncUpdateConnectionResponse>() }

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