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>()
    }
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 states the tool ingests content, implying a write operation, but doesn't mention permissions required, side effects (e.g., overwriting existing data), rate limits, or what happens on success/failure. The mention of 'optional metadata and chunk configuration' adds minimal context beyond the basic action.

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 a single, efficient sentence that front-loads the core action and adds brief details about optional features. Every word earns its place with no redundancy or unnecessary elaboration, making it easy to parse quickly.

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 complexity (3 parameters with nested objects, no annotations, no output schema), the description is incomplete. It lacks details on behavioral traits, full parameter meanings, return values, and usage context. For a write operation tool with multiple parameters, this minimal description leaves significant gaps for an agent to operate effectively.

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 undocumented parameters. It mentions 'optional metadata and chunk configuration,' which partially explains two nested parameters (metadata and chunkConfig), but ignores namespaceId, tenantId, and required fields like source and text. This leaves key parameters unexplained, failing to adequately supplement the 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 action ('ingests') and resource ('raw text content into the namespace'), making the purpose understandable. It distinguishes from siblings like ingestFile, ingestUrls, etc., by specifying text content, but doesn't explicitly contrast with ingestConnector or other ingest methods beyond mentioning 'raw text content'.

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 ingestConnector. It mentions optional metadata and chunk configuration, but doesn't specify use cases, prerequisites, or exclusions, leaving the agent to infer usage from the name alone.

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