Skip to main content
Glama
scmdr

SourceSync.ai MCP Server

by scmdr

createConnection

Establish connections to cloud storage services like Notion, Google Drive, and Dropbox to authorize document ingestion for knowledge management.

Instructions

Creates a new 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.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
namespaceIdNo
nameYes
connectorYes
clientRedirectUrlNo
tenantIdNo

Implementation Reference

  • src/index.ts:636-656 (registration)
    Registration of the MCP tool 'createConnection' including its handler function that wraps the SourceSync client call.
    server.tool(
      'createConnection',
      'Creates a new 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.',
      CreateConnectionSchema.shape,
      async (params: any) => {
        return safeApiCall(async () => {
          const { namespaceId, name, connector, clientRedirectUrl, tenantId } =
            params
    
          // Create a client with the provided parameters
          const client = createClient({ namespaceId, tenantId })
    
          // Call the createConnection method with the connector as enum
          return await client.createConnection({
            name,
            connector,
            clientRedirectUrl,
          })
        })
      },
    )
  • Core handler logic for createConnection in SourceSyncApiClient class, performing the HTTP POST request to the SourceSync API.
    public async createConnection({
      name,
      connector,
      clientRedirectUrl,
    }: Omit<
      SourceSyncCreateConnectionRequest,
      'namespaceId'
    >): Promise<SourceSyncCreateConnectionResponse> {
      return this.client
        .url('/v1/connections')
        .json({
          namespaceId: this.namespaceId,
          name,
          connector,
          clientRedirectUrl,
        } satisfies SourceSyncCreateConnectionRequest)
        .post()
        .json<SourceSyncCreateConnectionResponse>()
    }
  • Zod schema defining input parameters for the createConnection tool, used for validation in MCP.
    export const CreateConnectionSchema = z.object({
      namespaceId: namespaceIdSchema.optional(),
      name: z.string(),
      connector: ConnectorEnum,
      clientRedirectUrl: z.string().optional(),
      tenantId: tenantIdSchema,
    })
  • TypeScript type definitions for the SourceSync API request and response for createConnection.
    export type SourceSyncCreateConnectionRequest = {
      namespaceId: string
      name: string
      connector: SourceSyncConnector
      clientRedirectUrl?: string
    }
    
    export type SourceSyncCreateConnectionResponse = SourceSyncApiResponse<{
      connection: SourceSyncFaunaRef
      authorizationUrl: string
    }>
Behavior2/5

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

No annotations are provided, so the description carries the full burden. It discloses that the tool initiates an OAuth-like flow (authorization URL, user redirection, document selection), which is valuable behavioral context. However, it lacks details on permissions required, rate limits, error handling, or what happens after user authorization (e.g., automatic ingestion). For a tool with no annotations, this is a significant gap.

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

Conciseness4/5

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

The description is appropriately sized with three sentences that are front-loaded: the first states the purpose, the second explains key parameters, and the third describes the authorization flow. There's minimal waste, though the third sentence could be more concise.

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 the complexity (OAuth-like flow, 5 parameters), no annotations, and no output schema, the description is incomplete. It misses details on parameter semantics for three parameters, behavioral aspects like error handling, and the return value (only mentions an authorization URL). For a tool with this complexity, it should do more to guide the agent.

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

Parameters3/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. It explains two parameters: 'connector' (as a SourceSync enum) and 'clientRedirectUrl' (optional, for custom redirect). However, it doesn't cover the other three parameters (namespaceId, name, tenantId), leaving them undocumented. The description adds some value but doesn't fully compensate for the coverage gap.

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's purpose: 'Creates a new connection to a specific source.' It specifies the verb ('creates') and resource ('connection'), and mentions the authorization flow and document ingestion outcome. However, it doesn't explicitly differentiate from sibling tools like 'updateConnection' or 'listConnections' beyond the creation aspect.

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 context by mentioning the authorization URL and user document selection, suggesting it's for setting up data ingestion from external sources. It doesn't provide explicit when-to-use guidance versus alternatives like 'ingestConnector' or 'ingestFile', nor does it mention prerequisites or exclusions.

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

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