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,
    })

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

C2.8/5.0
Behavior2/5

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

No annotations are provided, so the description carries full burden. It mentions 'automatic parsing' as a behavioral trait, but lacks critical details: it doesn't specify if this is a read/write operation (though 'ingests' implies mutation), what permissions are needed, whether it's idempotent, rate limits, or what happens on success/failure. For a mutation tool with zero annotation coverage, this is inadequate.

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 extremely concise with two sentences that are front-loaded and waste no words. Every part ('ingests a file into the namespace', 'supports various file formats with automatic parsing') adds value without redundancy.

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 (5 parameters, mutation operation, no annotations, no output schema), the description is incomplete. It lacks details on behavioral traits, parameter meanings, output format, error handling, and differentiation from siblings. For a file ingestion tool with rich input schema, this leaves significant gaps for the agent.

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-specific information beyond implying file format support, failing to compensate for the coverage gap. It doesn't explain what 'namespaceId', 'file', 'metadata', or 'tenantId' mean or how they affect ingestion.

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 it supports various formats with automatic parsing. However, it doesn't explicitly differentiate from sibling ingestion tools like ingestText, ingestUrls, ingestWebsite, ingestSitemap, or ingestConnector, which all perform ingestion but for different input types.

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?

The description provides no guidance on when to use this tool versus alternatives. With multiple sibling ingestion tools (e.g., ingestText for text, ingestUrls for URLs), the agent is left to infer usage based on the 'file' parameter, but no explicit when/when-not rules or prerequisites are stated.

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