Skip to content

IDSC-1440: Add site activity logs support to enterprise tool#85

Merged
viratatwebflow merged 1 commit intosaifrom
idsc-1440
Mar 17, 2026
Merged

IDSC-1440: Add site activity logs support to enterprise tool#85
viratatwebflow merged 1 commit intosaifrom
idsc-1440

Conversation

@viratatwebflow
Copy link
Copy Markdown
Collaborator

Summary

  • Add list_site_activity_logs action to data_enterprise_tool for retrieving site activity logs (GET /v2/sites/{site_id}/activity_logs)
  • Implement per-action error handling so non-Enterprise site failures don't block results from Enterprise sites in the same batch
  • Pin zod to 3.25.76 to fix zod/v3 subpath runtime resolution required by @modelcontextprotocol/sdk@1.25.2

Details

Activity logs are an Enterprise-only Webflow API. Workspaces commonly contain a mix of Enterprise and non-Enterprise sites. When an LLM requests logs for multiple sites in one batch, non-Enterprise sites return a 403 with body.code: "not_enterprise_plan_site". Without per-action error handling, the first 403 would abort the entire batch.

Changes in src/tools/enterprise.ts

  • New listSiteActivityLogs helper calling getClient().sites.activityLogs.list()
  • New list_site_activity_logs schema with site_id, optional limit, optional offset
  • Per-action try/catch (documented with comment explaining the deviation from other tools)
  • 403 detection using Webflow SDK's WebflowError.statusCode and body.code
  • Generic errors delegated to existing formatErrorResponse utility
  • MCP isError flag set when any action fails

Changes in package.json

  • zod pinned to 3.25.76 (was ^3.24.2) — required for zod/v3 subpath to resolve at runtime

Testing performed

  1. Buildnpx tsup src/index.ts succeeds

  2. Runtimezod/v3 resolves correctly with zod@3.25.76

  3. Mixed workspace — Tested against workspace with 10 sites (2 Enterprise, 8 non-Enterprise):

    • Enterprise sites returned activity log data (e.g., backup_created events)
    • Non-Enterprise sites returned {"error":true,"message":"This site does not have an Enterprise hosting plan. This action requires an Enterprise site plan."}
    • Enterprise results were not blocked by non-Enterprise failures
  4. MCP protocol — Confirmed isError: true set on response when any action fails

  5. Error shape verification — Confirmed Webflow API returns statusCode: 403 with body.code: "not_enterprise_plan_site" (not not_enterprise_plan_workspace)

  6. Code review — Two rounds of 4-dimensional review (security, architecture, readability, simplicity), all blockers resolved

…th new functionality

- Added missing commas in function calls to ensure proper syntax.
- Introduced `listSiteActivityLogs` function to the enterprise tools for improved site activity tracking.
- Enhanced descriptions in the schema for better clarity and consistency.
@viratatwebflow viratatwebflow requested a review from a team as a code owner March 17, 2026 16:27
@viratatwebflow viratatwebflow requested review from KeithRyanWong and memo-pineda and removed request for a team and KeithRyanWong March 17, 2026 16:27
@viratatwebflow viratatwebflow merged commit bef4438 into sai Mar 17, 2026
6 checks passed
@viratatwebflow viratatwebflow deleted the idsc-1440 branch March 17, 2026 16:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants