Skip to main content
Glama

SourceSync.ai MCP Server

by scmdr

ingestConnector

Enables automated ingestion of backlogged or failed documents from a connector, eliminating the need for manual ID input. Re-ingestion requires reauthorization if documents are not in the backlog.

Instructions

Ingests all documents in the connector that are in backlog or failed status. No need to provide the document ids or file ids for the ingestion. Ids are already in the backlog when picked thorough the picker. If not, the user has to go through the authorization flow again, where they will be asked to pick the documents again.

Input Schema

NameRequiredDescriptionDefault
ingestConfigYes
namespaceIdNo
tenantIdNo

Input Schema (JSON Schema)

{ "$schema": "http://json-schema.org/draft-07/schema#", "additionalProperties": false, "properties": { "ingestConfig": { "additionalProperties": false, "properties": { "chunkConfig": { "additionalProperties": false, "description": "Optional Chunk config. When not passed, default chunk config will be used.", "properties": { "chunkOverlap": { "type": "number" }, "chunkSize": { "type": "number" } }, "required": [ "chunkSize", "chunkOverlap" ], "type": "object" }, "config": { "additionalProperties": false, "properties": { "connectionId": { "type": "string" }, "metadata": { "additionalProperties": { "anyOf": [ { "type": "string" }, { "items": { "type": "string" }, "type": "array" } ] }, "type": "object" } }, "required": [ "connectionId" ], "type": "object" }, "source": { "type": "string" } }, "required": [ "source", "config" ], "type": "object" }, "namespaceId": { "type": "string" }, "tenantId": { "type": "string" } }, "required": [ "ingestConfig" ], "type": "object" }

Implementation Reference

  • MCP server tool registration and handler for 'ingestConnector'. Creates SourceSyncApiClient and calls its ingestConnector method with parameters.
    server.tool( 'ingestConnector', 'Ingests all documents in the connector that are in backlog or failed status. No need to provide the document ids or file ids for the ingestion. Ids are already in the backlog when picked thorough the picker. If not, the user has to go through the authorization flow again, where they will be asked to pick the documents again.', IngestConnectorSchema.shape, async (params) => { return safeApiCall(async () => { const { namespaceId, tenantId, ingestConfig } = params // Create a client with the provided API key const client = createClient({ namespaceId, tenantId }) return await client.ingestConnector({ ingestConfig: { ...ingestConfig, source: ingestConfig.source as unknown as SourceSyncIngestionSource, }, }) }) }, )
  • Zod schema definition for IngestConnector tool input validation.
    export const IngestConnectorSchema = z.object({ namespaceId: namespaceIdSchema.optional(), ingestConfig: z.object({ source: z.string(), config: z.object({ connectionId: z.string(), metadata: z.record(z.union([z.string(), z.array(z.string())])).optional(), }), chunkConfig: chunkConfigSchema.optional(), }), tenantId: tenantIdSchema, })
  • SourceSyncApiClient.ingestConnector method that makes the actual API call to ingest from a connector.
    /** * Ingest content from a connector */ public async ingestConnector({ ingestConfig, }: Omit< SourceSyncIngestConnectorRequest, 'namespaceId' >): Promise<SourceSyncIngestResponse> { return this.client .url(`/v1/ingest/${toLowerKebabCase(ingestConfig.source)}`) .json({ namespaceId: this.namespaceId, ingestConfig: { ...ingestConfig, chunkConfig: SourceSyncApiClient.CHUNK_CONFIG, }, } satisfies SourceSyncIngestConnectorRequest) .post() .json<SourceSyncIngestResponse>() }
  • TypeScript type definition for SourceSyncIngestConnectorRequest used in the API client.
    export type SourceSyncIngestConnectorRequest = { namespaceId: string ingestConfig: { source: SourceSyncIngestionSource config: { connectionId: string metadata?: Record<string, any> } chunkConfig?: SourceSyncChunkConfig } }

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