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>()
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden but is incomplete. It mentions generating an authorization URL and user document selection, but omits critical behavioral details like required permissions, whether this is a read-only or destructive operation, rate limits, or what happens to existing connections. The description adds some context but leaves significant gaps.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is moderately concise but could be more front-loaded. The first sentence states the purpose, but subsequent sentences mix parameter details with behavioral explanations, creating some redundancy (e.g., repeating 'update' scenarios). It earns its place but lacks optimal structure.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given 5 parameters with 0% schema coverage, no annotations, and no output schema, the description is insufficient. It covers basic purpose and one parameter but misses most parameter meanings, behavioral traits, and output details. For a complex update tool, this leaves too many gaps for effective agent use.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate but only addresses 1 of 5 parameters ('clientRedirectUrl'). It mentions 'connector parameter' (not in schema) and ignores 'namespaceId', 'connectionId', 'name', and 'tenantId'. The description adds minimal semantic value beyond the bare schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool 'updates a connection to a specific source' with specific actions like updating to a different source, clientRedirectUrl, or document selection. It distinguishes from siblings like 'createConnection' (creation vs update) and 'getConnection' (read vs update), though not all sibling distinctions are explicit.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage scenarios ('useful if you want to update...') for updating source, redirect URL, or documents, but lacks explicit guidance on when to use this versus alternatives like 'revokeConnection' or 'resyncDocuments'. No clear exclusions or prerequisites are stated.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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

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