Skip to main content
Glama

ingestFile

Add files to a knowledge base namespace with automatic parsing and configurable chunking for content organization.

Instructions

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

Input Schema

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

Implementation Reference

  • Core handler implementation of ingestFile in SourceSyncApiClient: sends formData POST request to /v1/ingest/file API endpoint with file, metadata, and default chunk config.
    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>()
    }
  • src/index.ts:228-248 (registration)
    MCP server.tool registration for 'ingestFile', including description, input schema, and thin wrapper handler that creates SourceSync client and delegates to client.ingestFile.
    // Add ingestFile tool
    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 schema defining input parameters for ingestFile tool: namespaceId (opt), file (Blob), metadata (opt), chunkConfig (opt), tenantId.
    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,
    })
Behavior2/5

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

With no annotations provided, the description carries full burden but offers minimal behavioral insight. It mentions 'automatic parsing' but doesn't cover critical aspects like permissions, rate limits, error handling, or what 'ingests' entails (e.g., storage, indexing). This leaves 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 brief and front-loaded, with two sentences that efficiently state the core function. There's no wasted text, though it could benefit from more detail given the tool's complexity.

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?

For a mutation tool with 5 parameters, low schema coverage, no annotations, and no output schema, the description is inadequate. It lacks details on behavior, parameters, and expected outcomes, making it incomplete for effective agent use.

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 low at 20%, with only chunkConfig having a description. The tool description adds no parameter details beyond the schema, failing to compensate for the coverage gap. It doesn't explain parameters like namespaceId, file, metadata, or tenantId, leaving them undocumented.

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 action ('ingests') and resource ('a file into the namespace'), specifying the tool's purpose. It distinguishes from sibling tools like ingestText or ingestUrls by focusing on file ingestion, though it doesn't explicitly contrast with them.

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

Usage Guidelines2/5

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

No guidance is provided on when to use this tool versus alternatives like ingestText or ingestUrls. The description mentions 'supports various file formats with automatic parsing,' which hints at context but lacks explicit when/when-not instructions or prerequisites.

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