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

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/pbteja1998/sourcesyncai-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server