Skip to main content
Glama

resyncDocuments

Reprocess documents matching filter criteria to update content after schema changes in SourceSync.ai knowledge bases.

Instructions

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

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
namespaceIdNo
documentIdsNo
tenantIdNo
filterConfigYes

Implementation Reference

  • Core implementation of resyncDocuments in SourceSyncApiClient: sends POST request to /v1/documents/resync with filterConfig to queue documents for reprocessing.
    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>()
    }
  • MCP tool handler for resyncDocuments: destructures params, creates API client, merges documentIds into filterConfig, converts string enums to typed enums, calls underlying client.resyncDocuments, wrapped in safeApiCall.
    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
                  ],
              ),
          },
        })
      })
    },
  • Zod schema defining input parameters for 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)
    MCP server.tool registration for 'resyncDocuments' tool, specifying 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
                    ],
                ),
            },
          })
        })
      },
    )
  • TypeScript type definitions for SourceSyncResyncDocumentsRequest and Response used by the API client.
    export type SourceSyncResyncDocumentsRequest = {
      namespaceId: string
      filterConfig: SourceSyncDocumentFilterConfig
    }
    
    export type SourceSyncResyncDocumentsResponse = SourceSyncApiResponse<{
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions 'reprocesses' and 'updating', which imply a mutation operation, but doesn't specify whether this is destructive, requires specific permissions, has rate limits, or what the reprocessing entails. The behavioral context is insufficient for a mutation tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is concise and front-loaded, consisting of two sentences that directly state the tool's purpose and a key use case. Every sentence adds value without redundancy, making it efficient and well-structured.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity (4 parameters, nested objects, no output schema, and no annotations), the description is incomplete. It lacks details on parameter usage, behavioral traits, and expected outcomes, making it inadequate for a mutation tool with multiple input options.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema description coverage is 0%, so the description must compensate by explaining parameters. It mentions 'filter criteria' but doesn't detail what parameters are available (e.g., namespaceId, documentIds, filterConfig) or their purposes. This leaves significant gaps in understanding the tool's inputs.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose with a specific verb ('reprocesses') and resource ('documents'), and mentions the filter criteria. However, it doesn't explicitly differentiate this tool from sibling tools like 'updateDocuments' or 'deleteDocuments', which might also operate on documents with filters.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides some context ('useful for updating after schema changes'), which implies when to use it, but doesn't offer explicit guidance on when to choose this tool over alternatives like 'updateDocuments' or 'deleteDocuments'. No exclusions or prerequisites are mentioned.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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

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