Skip to main content
Glama
scmdr

SourceSync.ai MCP Server

by scmdr

resyncDocuments

Reprocess documents based on specified filters to update data after schema changes or modifications. Supports multiple document types and ingestion sources for precise synchronization.

Instructions

Reprocesses documents that match the specified filter criteria. Useful for updating after schema changes.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
documentIdsNo
filterConfigYes
namespaceIdNo
tenantIdNo

Implementation Reference

  • MCP tool handler for 'resyncDocuments'. Processes input parameters, creates SourceSyncApiClient, handles documentIds fallback, converts string enums to typed enums in filterConfig, and invokes the underlying resyncDocuments API method.
    async (params: any) => { return safeApiCall(async () => { const { namespaceId, documentIds, tenantId, filterConfig } = params // Create a client with the provided parameters const client = createClient({ namespaceId, tenantId }) // Add documentIds to filter if provided and not already in filter if (documentIds && documentIds.length > 0 && !filterConfig.documentIds) { filterConfig.documentIds = documentIds } // Call the resyncDocuments method with properly structured parameters return await client.resyncDocuments({ filterConfig: { ...filterConfig, // Convert string enum values to their SourceSync enum equivalents documentTypes: filterConfig.documentTypes?.map( (type: string) => SourceSyncDocumentType[ type as keyof typeof SourceSyncDocumentType ], ), documentIngestionSources: filterConfig.documentIngestionSources?.map( (source: string) => SourceSyncIngestionSource[ source as keyof typeof SourceSyncIngestionSource ], ), documentIngestionStatuses: filterConfig.documentIngestionStatuses?.map( (status: string) => SourceSyncIngestionStatus[ status as keyof typeof SourceSyncIngestionStatus ], ), }, }) }) },
  • SourceSyncApiClient.resyncDocuments method: sends POST request to `/v1/documents/resync` endpoint with namespaceId and filterConfig, returns the API response.
    public async resyncDocuments({ filterConfig, }: Omit< SourceSyncResyncDocumentsRequest, 'namespaceId' >): Promise<SourceSyncResyncDocumentsResponse> { return this.client .url(`/v1/documents/resync`) .json({ namespaceId: this.namespaceId, filterConfig, } satisfies SourceSyncResyncDocumentsRequest) .post() .json<SourceSyncResyncDocumentsResponse>() }
  • Zod schema defining input parameters for the resyncDocuments tool: optional namespaceId, documentIds array, tenantId, and filterConfig.
    export const ResyncDocumentsSchema = z.object({ namespaceId: namespaceIdSchema.optional(), documentIds: z.array(z.string()).optional(), tenantId: tenantIdSchema, filterConfig: FilterConfigSchema, })
  • src/index.ts:524-568 (registration)
    Registration of the 'resyncDocuments' MCP tool using server.tool(), providing name, description, input schema, and handler function.
    server.tool( 'resyncDocuments', 'Reprocesses documents that match the specified filter criteria. Useful for updating after schema changes.', ResyncDocumentsSchema.shape, async (params: any) => { return safeApiCall(async () => { const { namespaceId, documentIds, tenantId, filterConfig } = params // Create a client with the provided parameters const client = createClient({ namespaceId, tenantId }) // Add documentIds to filter if provided and not already in filter if (documentIds && documentIds.length > 0 && !filterConfig.documentIds) { filterConfig.documentIds = documentIds } // Call the resyncDocuments method with properly structured parameters return await client.resyncDocuments({ filterConfig: { ...filterConfig, // Convert string enum values to their SourceSync enum equivalents documentTypes: filterConfig.documentTypes?.map( (type: string) => SourceSyncDocumentType[ type as keyof typeof SourceSyncDocumentType ], ), documentIngestionSources: filterConfig.documentIngestionSources?.map( (source: string) => SourceSyncIngestionSource[ source as keyof typeof SourceSyncIngestionSource ], ), documentIngestionStatuses: filterConfig.documentIngestionStatuses?.map( (status: string) => SourceSyncIngestionStatus[ status as keyof typeof SourceSyncIngestionStatus ], ), }, }) }) }, )

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