|
@@ -50,6 +50,7 @@ The registry is composed from endpoint components under `src/api/components/`. G
|
|
|
| Custom URLs | `CustomUrlsEndpoint.ts` | Manually add URLs the sitemap crawler would miss |
|
|
| Custom URLs | `CustomUrlsEndpoint.ts` | Manually add URLs the sitemap crawler would miss |
|
|
|
| Webhooks | `WebhooksEndpoint.ts` | Per-site webhook CRUD (scrape_started / completed / failed) |
|
|
| Webhooks | `WebhooksEndpoint.ts` | Per-site webhook CRUD (scrape_started / completed / failed) |
|
|
|
| Search | `SearchEndpoint.ts` | Semantic search over scraped content (REST wrapper over Qdrant) |
|
|
| Search | `SearchEndpoint.ts` | Semantic search over scraped content (REST wrapper over Qdrant) |
|
|
|
|
|
+| URL Exclusions | `UrlExclusionsEndpoint.ts` | Per-site URL exclusion patterns (glob-based) |
|
|
|
| Qdrant | `QdrantEndpoint.ts` | Vector DB management, per-site embedding lifecycle, v1→v2 migration |
|
|
| Qdrant | `QdrantEndpoint.ts` | Vector DB management, per-site embedding lifecycle, v1→v2 migration |
|
|
|
| MCP | `McpEndpoint.ts` | MCP call logs and analytics |
|
|
| MCP | `McpEndpoint.ts` | MCP call logs and analytics |
|
|
|
| Documentation | `DocumentationEndpoint.ts` | `/doc`, `/doc/openapi`, `/doc/endpoints` |
|
|
| Documentation | `DocumentationEndpoint.ts` | `/doc`, `/doc/openapi`, `/doc/endpoints` |
|
|
@@ -67,12 +68,14 @@ Use `GET /doc/endpoints` for the exact, always-up-to-date list. A summarised sna
|
|
|
- `GET /api/jobs/:id` — job status and result
|
|
- `GET /api/jobs/:id` — job status and result
|
|
|
|
|
|
|
|
### Sites
|
|
### Sites
|
|
|
|
|
+- `POST /api/sites/detect` — auto-detect site type, platform, and sitemap URL from a given URL
|
|
|
- `GET /api/sites` — list with analytics
|
|
- `GET /api/sites` — list with analytics
|
|
|
- `GET /api/sites/deleted` — soft-deleted sites
|
|
- `GET /api/sites/deleted` — soft-deleted sites
|
|
|
- `GET /api/sites/:id` — detail, supports either internal UUID or `custom_id`
|
|
- `GET /api/sites/:id` — detail, supports either internal UUID or `custom_id`
|
|
|
- `GET /api/sites/:id/results` — scraped content with filters
|
|
- `GET /api/sites/:id/results` — scraped content with filters
|
|
|
- `PATCH /api/sites/:id/schedule` — enable/disable scheduled scraping
|
|
- `PATCH /api/sites/:id/schedule` — enable/disable scheduled scraping
|
|
|
- `PATCH /api/sites/:id/custom-id` — set/update custom_id
|
|
- `PATCH /api/sites/:id/custom-id` — set/update custom_id
|
|
|
|
|
+- `PATCH /api/sites/:id/settings` — update site settings (site_type, site_platform, custom_sitemap_url, max_crawl_depth, max_pages)
|
|
|
- `PATCH /api/sites/:id/qdrant` — enable/disable embeddings (also see `PUT /api/sites/:siteId/qdrant/toggle`)
|
|
- `PATCH /api/sites/:id/qdrant` — enable/disable embeddings (also see `PUT /api/sites/:siteId/qdrant/toggle`)
|
|
|
- `DELETE /api/sites/:id` — soft delete
|
|
- `DELETE /api/sites/:id` — soft delete
|
|
|
- `DELETE /api/sites/:id/force` — hard delete
|
|
- `DELETE /api/sites/:id/force` — hard delete
|
|
@@ -87,6 +90,11 @@ Use `GET /doc/endpoints` for the exact, always-up-to-date list. A summarised sna
|
|
|
- `PATCH /api/sites/:id/custom-urls/:customUrlId`
|
|
- `PATCH /api/sites/:id/custom-urls/:customUrlId`
|
|
|
- `DELETE /api/sites/:id/custom-urls/:customUrlId`
|
|
- `DELETE /api/sites/:id/custom-urls/:customUrlId`
|
|
|
|
|
|
|
|
|
|
+### Site URL exclusions
|
|
|
|
|
+- `POST /api/sites/:siteId/url-exclusions` — add a glob pattern to exclude URLs from scraping
|
|
|
|
|
+- `GET /api/sites/:siteId/url-exclusions` — list exclusion patterns for a site
|
|
|
|
|
+- `DELETE /api/sites/:siteId/url-exclusions/:exclusionId` — delete an exclusion pattern
|
|
|
|
|
+
|
|
|
### Site webhooks
|
|
### Site webhooks
|
|
|
- `POST /api/sites/:id/webhooks`
|
|
- `POST /api/sites/:id/webhooks`
|
|
|
- `GET /api/sites/:id/webhooks`
|
|
- `GET /api/sites/:id/webhooks`
|
|
@@ -147,12 +155,21 @@ The lookup in `src/database/SiteDatabase.ts` tries both. `custom_id` must be a v
|
|
|
|
|
|
|
|
## Content categories
|
|
## Content categories
|
|
|
|
|
|
|
|
-Scraped pages are classified into four buckets, used consistently across the API, the DB, and the MCP tools:
|
|
|
|
|
|
|
+Scraped pages are classified into 13 buckets, used consistently across the API, the DB, and the MCP tools:
|
|
|
|
|
|
|
|
- `shipping` — shipping, delivery, logistics
|
|
- `shipping` — shipping, delivery, logistics
|
|
|
- `contacts` — contact info, support
|
|
- `contacts` — contact info, support
|
|
|
- `terms` — terms of service, privacy, legal
|
|
- `terms` — terms of service, privacy, legal
|
|
|
- `faq` — frequently asked questions, help pages
|
|
- `faq` — frequently asked questions, help pages
|
|
|
|
|
+- `services` — services offered
|
|
|
|
|
+- `about` — about the company/organization
|
|
|
|
|
+- `team` — team members, staff pages
|
|
|
|
|
+- `blog` — blog posts, articles, news
|
|
|
|
|
+- `pricing` — pricing, plans, rates
|
|
|
|
|
+- `testimonials` — reviews, testimonials, case studies
|
|
|
|
|
+- `gallery` — image galleries, portfolios
|
|
|
|
|
+- `landing` — landing pages, home page
|
|
|
|
|
+- `other` — pages that don't fit the above categories
|
|
|
|
|
|
|
|
## Error responses
|
|
## Error responses
|
|
|
|
|
|
|
@@ -196,7 +213,7 @@ Status codes follow standard REST semantics: `400` for bad input, `401` for bad
|
|
|
| Field | Required | Description |
|
|
| Field | Required | Description |
|
|
|
|---|---|---|
|
|
|---|---|---|
|
|
|
| `q` | yes | Natural-language query. |
|
|
| `q` | yes | Natural-language query. |
|
|
|
-| `category` | no | One of `shipping`, `contacts`, `terms`, `faq`. Omit to search all four in parallel and get a merged, score-ranked list. |
|
|
|
|
|
|
|
+| `category` | no | One of `shipping`, `contacts`, `terms`, `faq`, `services`, `about`, `team`, `blog`, `pricing`, `testimonials`, `gallery`, `landing`, `other`. Omit to search all 13 in parallel and get a merged, score-ranked list. |
|
|
|
| `limit` | no | 1–20, default 10. Applies to the final merged list. |
|
|
| `limit` | no | 1–20, default 10. Applies to the final merged list. |
|
|
|
|
|
|
|
|
**Example — search a single category:**
|
|
**Example — search a single category:**
|
|
@@ -264,7 +281,7 @@ Each REST search is written to `mcp_logs` with `tool_name: "rest_search"` so it
|
|
|
|
|
|
|
|
## MCP (Model Context Protocol)
|
|
## MCP (Model Context Protocol)
|
|
|
|
|
|
|
|
-When both `MCP_ENABLED=true` and `QDRANT_ENABLED=true`, the server mounts a **Streamable HTTP** MCP endpoint at `/mcp` (see `src/mcp/McpServer.ts`). Five tools are registered:
|
|
|
|
|
|
|
+When both `MCP_ENABLED=true` and `QDRANT_ENABLED=true`, the server mounts a **Streamable HTTP** MCP endpoint at `/mcp` (see `src/mcp/McpServer.ts`). 14 tools are registered:
|
|
|
|
|
|
|
|
| Tool name | Purpose |
|
|
| Tool name | Purpose |
|
|
|
|---|---|
|
|
|---|---|
|
|
@@ -273,8 +290,17 @@ When both `MCP_ENABLED=true` and `QDRANT_ENABLED=true`, the server mounts a **St
|
|
|
| `contacts_search` | Semantic search in contact/support pages |
|
|
| `contacts_search` | Semantic search in contact/support pages |
|
|
|
| `terms_search` | Semantic search in terms/policy pages |
|
|
| `terms_search` | Semantic search in terms/policy pages |
|
|
|
| `faq_search` | Semantic search in FAQ/help pages |
|
|
| `faq_search` | Semantic search in FAQ/help pages |
|
|
|
-
|
|
|
|
|
-All tools accept both `site_id` and `shop_id` (legacy alias) as the parameter name, mapped to the site's `custom_id`. The four search tools additionally take `query` (required) and `limit` (optional, 1–20, default 10). If a site does not exist or does not have Qdrant enabled, tools return `"Search not available for this site"` rather than erroring.
|
|
|
|
|
|
|
+| `services_search` | Semantic search in services pages |
|
|
|
|
|
+| `about_search` | Semantic search in about pages |
|
|
|
|
|
+| `team_search` | Semantic search in team/staff pages |
|
|
|
|
|
+| `blog_search` | Semantic search in blog/article pages |
|
|
|
|
|
+| `pricing_search` | Semantic search in pricing/plans pages |
|
|
|
|
|
+| `testimonials_search` | Semantic search in testimonial/review pages |
|
|
|
|
|
+| `gallery_search` | Semantic search in gallery/portfolio pages |
|
|
|
|
|
+| `landing_search` | Semantic search in landing/home pages |
|
|
|
|
|
+| `other_search` | Semantic search in uncategorized pages |
|
|
|
|
|
+
|
|
|
|
|
+All tools accept both `site_id` and `shop_id` (legacy alias) as the parameter name, mapped to the site's `custom_id`. The 13 search tools additionally take `query` (required) and `limit` (optional, 1–20, default 10). If a site does not exist or does not have Qdrant enabled, tools return `"Search not available for this site"` rather than erroring.
|
|
|
|
|
|
|
|
Tool schemas are declared in `src/mcp/tools/*.ts` and exposed to MCP clients via the standard `tools/list` request.
|
|
Tool schemas are declared in `src/mcp/tools/*.ts` and exposed to MCP clients via the standard `tools/list` request.
|
|
|
|
|
|