Skip to main content
Glama

ingestText

Adds text content to a knowledge base with configurable metadata and chunking options for organized content management.

Instructions

Ingests raw text content into the namespace. Supports optional metadata and chunk configuration.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
namespaceIdNo
ingestConfigYes
tenantIdNo

Implementation Reference

  • src/index.ts:209-226 (registration)
    MCP server.tool registration for the 'ingestText' tool, including name, description, schema, and handler function.
    server.tool(
      'ingestText',
      'Ingests raw text content into the namespace. Supports optional metadata and chunk configuration.',
      ingestTextSchema.shape,
      async (params: IngestTextParams) => {
        return safeApiCall(async () => {
          const { namespaceId, tenantId, ingestConfig } = params
    
          // Create a client with the provided parameters
          const client = createClient({ namespaceId, tenantId })
    
          // Direct passthrough to the API
          return await client.ingestText({
            ingestConfig,
          })
        })
      },
    )
  • The handler function passed to MCP server for executing the ingestText tool logic, delegating to SourceSync client.
    async (params: IngestTextParams) => {
      return safeApiCall(async () => {
        const { namespaceId, tenantId, ingestConfig } = params
    
        // Create a client with the provided parameters
        const client = createClient({ namespaceId, tenantId })
    
        // Direct passthrough to the API
        return await client.ingestText({
          ingestConfig,
        })
      })
    },
  • Zod schema defining the input parameters for the ingestText tool.
    export const ingestTextSchema = z.object({
      namespaceId: namespaceIdSchema.optional(),
      ingestConfig: z.object({
        source: z.literal(SourceSyncIngestionSource.TEXT),
        config: z.object({
          name: z.string().optional(),
          text: z.string(),
          metadata: z.record(z.union([z.string(), z.array(z.string())])).optional(),
        }),
        chunkConfig: chunkConfigSchema.optional(),
      }),
      tenantId: tenantIdSchema,
    })
  • Core implementation of ingestText in SourceSyncApiClient, making the POST request to the SourceSync API /v1/ingest/text endpoint.
    public async ingestText({
      ingestConfig,
    }: Omit<
      SourceSyncIngestTextRequest,
      'namespaceId'
    >): Promise<SourceSyncIngestResponse> {
      return this.client
        .url('/v1/ingest/text')
        .json({
          namespaceId: this.namespaceId,
          ingestConfig: {
            ...ingestConfig,
            chunkConfig: SourceSyncApiClient.CHUNK_CONFIG,
          },
        } satisfies SourceSyncIngestTextRequest)
        .post()
        .json<SourceSyncIngestResponse>()
    }

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

C2.7/5.0
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 'ingests' which implies a write operation, but doesn't specify whether this is idempotent, what permissions are required, whether it's asynchronous, what happens on failure, or what the expected output looks like. The mention of 'optional metadata and chunk configuration' is helpful but 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.

Conciseness4/5

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

The description is appropriately concise with two sentences that efficiently convey the core functionality and key features. It's front-loaded with the main purpose and follows with supporting details, though it could be slightly more structured by separating required vs optional aspects.

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 3 parameters (including complex nested objects), 0% schema description coverage, and no output schema, the description is inadequate. It doesn't explain what 'ingests' means operationally, what the expected outcome is, error conditions, or provide sufficient parameter guidance given the schema complexity.

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?

With 0% schema description coverage and 3 parameters (including nested objects), the description provides minimal help. It mentions 'optional metadata and chunk configuration' which hints at some parameters, but doesn't explain the required namespaceId, tenantId, or the structure of ingestConfig. The schema shows complex nested objects that aren't addressed in the description.

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 ('raw text content into the namespace'), making the purpose understandable. It distinguishes from some siblings like ingestFile or ingestUrls by specifying text content, but doesn't explicitly differentiate from ingestConnector or ingestWebsite which might also handle text.

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 like ingestFile, ingestUrls, or ingestWebsite. It mentions optional metadata and chunk configuration but doesn't explain when these features are needed or what the default behavior is when they're omitted.

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