Skip to main content
Glama
scmdr

SourceSync.ai MCP Server

by scmdr

ingestFile

Upload and parse files into a specified namespace, supporting multiple formats and customizable chunk configurations for efficient content management within SourceSync.ai's knowledge platform.

Instructions

Ingests a file into the namespace. Supports various file formats with automatic parsing.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
chunkConfigNoOptional Chunk config. When not passed, default chunk config will be used.
fileYes
metadataNo
namespaceIdNo
tenantIdNo

Implementation Reference

  • Core handler logic for ingesting a file by sending form data to the SourceSync API /v1/ingest/file endpoint.
    public async ingestFile({ file, metadata, }: Omit< SourceSyncIngestFileRequest, 'namespaceId' >): Promise<SourceSyncIngestResponse> { return this.client .url('/v1/ingest/file') .formData({ namespaceId: this.namespaceId, file, metadata: JSON.stringify(metadata), chunkConfig: JSON.stringify(SourceSyncApiClient.CHUNK_CONFIG), }) .post() .json<SourceSyncIngestResponse>() }
  • MCP server.tool registration and handler function for 'ingestFile' tool, which creates SourceSync client and delegates to its ingestFile method.
    server.tool( 'ingestFile', 'Ingests a file into the namespace. Supports various file formats with automatic parsing.', IngestFileSchema.shape, async (params) => { return safeApiCall(async () => { const { namespaceId, tenantId, file, metadata, chunkConfig } = params // Create a client with the provided parameters const client = createClient({ namespaceId, tenantId }) // Direct passthrough to the API return await client.ingestFile({ file: file as unknown as File, // Type cast to File as required by the client metadata, chunkConfig, }) }) },
  • Zod input schema definition for the ingestFile tool, defining parameters like file (Blob), metadata, chunkConfig, etc.
    export const IngestFileSchema = z.object({ namespaceId: namespaceIdSchema.optional(), file: z.instanceof(Blob), metadata: z.record(z.union([z.string(), z.array(z.string())])).optional(), chunkConfig: chunkConfigSchema.optional(), tenantId: tenantIdSchema, })
  • src/index.ts:229-248 (registration)
    Explicit registration of the 'ingestFile' MCP tool using server.tool with name 'ingestFile'.
    server.tool( 'ingestFile', 'Ingests a file into the namespace. Supports various file formats with automatic parsing.', IngestFileSchema.shape, async (params) => { return safeApiCall(async () => { const { namespaceId, tenantId, file, metadata, chunkConfig } = params // Create a client with the provided parameters const client = createClient({ namespaceId, tenantId }) // Direct passthrough to the API return await client.ingestFile({ file: file as unknown as File, // Type cast to File as required by the client metadata, chunkConfig, }) }) }, )

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