Skip to content

feat(mcp): list_site_audits + get_site_audit_quota read tools #270

Closed

Description

@gkhngyk

What

Two read-only MCP tools that complement run_site_audit / get_site_audit (#269):

  • list_site_audits — input brand_id. Returns the brand's recent audits (id, url, status, total score, created_at) — so an agent can find a past audit by URL/date instead of needing the id.
  • get_site_audit_quota — returns the org's monthly Site Audit allowance ({ used, limit, remaining }; limit: -1 = unlimited) so an agent can check remaining credits before calling run_site_audit.

Why

Lets an assistant see audit history and how many runs remain before spending a credit — same courtesy the dashboard hub gives (recent list + "X/Y audits left").

Approach

Pure reads, no quota charge — mirror the existing read tools (e.g. list_prompts, get_visibility_summary):

  • Data fns in web/src/lib/mcp/data.ts: listSiteAuditsFor(auth, brandId) (ownership check, then query site_audits) and getSiteAuditQuotaFor(auth) (reuses the server's getSiteAuditQuotaStatus via the existing GET /api/audits/quota route or a CRON_SECRET internal call).
  • Register both in web/src/lib/mcp/server.ts.
  • REST parity: GET /api/mcp/site-audits?brandId= and GET /api/mcp/site-audits/quota.

Acceptance

  • list_site_audits returns recent audits for an owned brand; foreign brand → not found
  • get_site_audit_quota returns used/limit/remaining (unlimited reported as -1)
  • Neither tool charges the quota
  • REST endpoints behave identically

Depends on / pairs with #269.

Activity

  1. added
    enhancement
    good first issue
    on Jun 17, 2026
  2. gkhngyk commented on Jun 26, 2026

    @gkhngyk
    ContributorAuthor

    Picking this up alongside #269/#305 — adding the two read tools (list_site_audits + get_site_audit_quota), no quota charge. Clearing it from the backlog since it's had no contributor claim. PR will stack on #305.

  3. added 2 commits that reference this issue on Jun 26, 2026
    0ac973a
    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

    enhancementgood first issue

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions