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>()
    }
Behavior2/5

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

No annotations are provided, so the description carries the full burden. It mentions that 'Ids are already in the backlog when picked through the picker' and the need for re-authorization if not, which adds some behavioral context about prerequisites. However, it lacks details on permissions, rate limits, what 'ingests' entails (e.g., processing, storage), or error handling, leaving significant gaps 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.

Conciseness4/5

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

The description is appropriately sized with three sentences that are front-loaded with the core purpose. Each sentence adds relevant information about the ingestion scope and authorization flow, with minimal waste, though it could be slightly more structured for clarity.

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 tool's complexity (mutation with 3 parameters, nested objects, no annotations, no output schema), the description is incomplete. It covers the purpose and some behavioral aspects but misses parameter explanations, output details, and fuller context on usage versus siblings, making it inadequate for safe and effective tool invocation.

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?

Schema description coverage is 0%, so the description must compensate for three parameters (namespaceId, ingestConfig, tenantId) with nested objects. The description does not mention any parameters, their meanings, or how they relate to the ingestion process (e.g., what namespaceId or ingestConfig.source represents). This fails to add value beyond the bare schema.

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 'ingests all documents in the connector that are in backlog or failed status,' specifying the verb (ingests), resource (documents in connector), and scope (backlog/failed status). It distinguishes from sibling tools like ingestFile, ingestUrls, etc., which handle different ingestion sources, but doesn't explicitly name these alternatives.

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 implies usage context by mentioning 'backlog or failed status' and the authorization flow requirement, suggesting when to use it (for retrying failed/backlogged ingestions). However, it doesn't explicitly state when to use this tool versus alternatives like ingestFile or ingestUrls, nor does it provide clear exclusions or prerequisites beyond the authorization note.

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