Skip to main content
Glama

ingestConnector

Processes backlog or failed documents in SourceSync.ai connectors by automatically ingesting them into knowledge bases without requiring manual ID input.

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
NameRequiredDescriptionDefault
namespaceIdNo
ingestConfigYes
tenantIdNo

Implementation Reference

  • MCP tool handler that wraps the SourceSync client ingestConnector call with safeApiCall for error handling.
    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 input schema for the ingestConnector tool defining namespaceId, ingestConfig (with source, config including 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/index.ts:311-330 (registration)
    Registration of the 'ingestConnector' tool on the MCP server with description, schema, and handler function.
    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, }, }) }) }, )
  • SourceSyncApiClient method that makes the HTTP POST request to the dynamic ingest endpoint based on the connector source.
    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>() }

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

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