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
| Name | Required | Description | Default |
|---|---|---|---|
| ingestConfig | Yes | ||
| namespaceId | No | ||
| tenantId | No |
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
- src/index.ts:311-330 (handler)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, }, }) }) }, )
- src/schemas.ts:267-278 (schema)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, })
- src/sourcesync.ts:431-451 (helper)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>() }
- src/sourcesync.types.ts:462-472 (schema)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 } }