Skip to content

feat(agent): use Site Audit from the in-product assistant #271

Closed

Description

@gkhngyk

What

Let the in-product AI assistant (/dashboard/agent) run and read Site Audits in chat — e.g. "audit my homepage" → it triggers an audit, then summarizes the score, weak categories, and the top AI-written fixes.

Why

The Agent is already "grounded in the MCP read tools"; Site Audit + its AI fix recommendations are the most actionable surface to expose there. A user shouldn't have to leave the chat to audit a page.

Approach

The Agent keeps its own tool registry in web/src/lib/agent/tools.ts (buildAgentTools(auth)) that wraps the shared data functions in web/src/lib/mcp/data.ts, with names matching the MCP tool ids. So:

Quota is enforced server-side (shared pool with the dashboard), so a credit-exhausted run surfaces the limit message to the user.

Acceptance

  • Asking the assistant to audit a URL triggers an audit for the active/owned brand and reports the result (score, weak categories, top fixes)
  • run_site_audit only fires on explicit user intent; the assistant doesn't audit unprompted
  • A credit-exhausted run is reported to the user as the limit/upgrade message
  • Reads (get_site_audit, list_site_audits) work without consuming credits

Pairs with #270; inline rendering of the result is tracked separately.

Activity

  1. added
    enhancement
    on Jun 17, 2026
  2. added a commit that references this issue on Jun 27, 2026
    757d9ed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions