ingestSitemap
Extract and ingest website content using sitemap.xml. Apply path filtering, link limits, and custom chunking for structured data integration with AI models.
Instructions
Ingests content from a website using its sitemap.xml. Supports path filtering and link limits.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ingestConfig | Yes | ||
| namespaceId | No | ||
| tenantId | No |
Implementation Reference
- src/index.ts:271-288 (handler)Primary MCP handler and registration for the 'ingestSitemap' tool. This executes the tool by delegating to the SourceSyncApiClient.ingestSitemap method.server.tool( 'ingestSitemap', 'Ingests content from a website using its sitemap.xml. Supports path filtering and link limits.', IngestSitemapSchema.shape, async (params) => { return safeApiCall(async () => { const { namespaceId, ingestConfig, tenantId } = params // Create a client with the provided parameters const client = createClient({ namespaceId, tenantId }) // Direct passthrough to the API return await client.ingestSitemap({ ingestConfig, }) }) }, )
- src/schemas.ts:216-230 (schema)Zod schema defining the input parameters for the ingestSitemap tool.export const IngestSitemapSchema = z.object({ namespaceId: namespaceIdSchema.optional(), ingestConfig: z.object({ source: z.literal(SourceSyncIngestionSource.SITEMAP), config: z.object({ url: z.string(), maxLinks: z.number().optional(), includePaths: z.array(z.string()).optional(), excludePaths: z.array(z.string()).optional(), metadata: z.record(z.union([z.string(), z.array(z.string())])).optional(), }), chunkConfig: chunkConfigSchema.optional(), }), tenantId: tenantIdSchema, })
- src/sourcesync.ts:390-407 (helper)SourceSyncApiClient.ingestSitemap method, called by the MCP handler, which sends POST request to /v1/ingest/sitemap API endpoint.public async ingestSitemap({ ingestConfig, }: Omit< SourceSyncIngestSitemapRequest, 'namespaceId' >): Promise<SourceSyncIngestResponse> { return this.client .url('/v1/ingest/sitemap') .json({ namespaceId: this.namespaceId, ingestConfig: { ...ingestConfig, chunkConfig: SourceSyncApiClient.CHUNK_CONFIG, }, } satisfies SourceSyncIngestSitemapRequest) .post() .json<SourceSyncIngestResponse>() }
- src/sourcesync.types.ts:429-443 (helper)TypeScript type definition for the SourceSyncIngestSitemapRequest used in the API client method.export type SourceSyncIngestSitemapRequest = { namespaceId: string ingestConfig: { source: SourceSyncIngestionSource.SITEMAP config: { url: string maxLinks?: number includePaths?: string[] excludePaths?: string[] scrapeOptions?: SourceSyncScrapeOptions metadata?: Record<string, any> } chunkConfig?: SourceSyncChunkConfig } }