ingestConnector
Processes backlogged or failed documents in SourceSync.ai connectors by automatically ingesting them without requiring manual ID input, using existing authorization flows.
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
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| namespaceId | No | ||
| ingestConfig | Yes | ||
| tenantId | No |
Implementation Reference
- src/index.ts:311-330 (registration)MCP tool registration for 'ingestConnector', including the handler function that wraps the SourceSync client call.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, }, }) }) }, )
- src/sourcesync.ts:434-451 (handler)Core implementation of ingestConnector in SourceSyncApiClient, makes the HTTP POST request to the SourceSync API.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>() }
- src/schemas.ts:267-278 (schema)Zod schema defining the input parameters for the ingestConnector tool.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, })
- src/sourcesync.types.ts:462-472 (helper)TypeScript type definition for the SourceSyncIngestConnectorRequest used in the API client.export type SourceSyncIngestConnectorRequest = { namespaceId: string ingestConfig: { source: SourceSyncIngestionSource config: { connectionId: string metadata?: Record<string, any> } chunkConfig?: SourceSyncChunkConfig } }