ingestConnector
Ingests backlogged or failed documents in the connector without requiring document IDs, streamlining data integration into SourceSync.ai MCP Server’s knowledge management platform.
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 |
|---|---|---|---|
| ingestConfig | Yes | ||
| namespaceId | No | ||
| tenantId | No |
Implementation Reference
- src/sourcesync.ts:434-451 (handler)Core handler function in SourceSyncApiClient that executes the ingestion by making the HTTP POST request to the SourceSync API ingest endpoint, dynamically constructing the URL based on the source 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>() }
- src/index.ts:311-329 (registration)Registers the 'ingestConnector' MCP tool with the server, including description, input schema, and thin wrapper handler that creates a SourceSyncApiClient and calls its ingestConnector method.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/schemas.ts:267-278 (schema)Zod schema defining the input parameters for the ingestConnector tool, including namespaceId, ingestConfig (with source, config.connectionId, optional metadata and chunkConfig), and optional tenantId.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 by the API client method.export type SourceSyncIngestConnectorRequest = { namespaceId: string ingestConfig: { source: SourceSyncIngestionSource config: { connectionId: string metadata?: Record<string, any> } chunkConfig?: SourceSyncChunkConfig } }