Skip to content

feat(mcp): expose get_competitor_comparison tool (with share of voice) + REST endpoint #98

Closed

Description

@gkhngyk

What

Add an MCP tool get_competitor_comparison (+ /api/mcp/competitor-comparison REST) returning competitor benchmarks and share of voice for a brand.

Why

Competitors / SOV is a core surface not on MCP. Lets clients / the assistant (#94) answer "who's gaining share of voice?" and "how do I compare to competitor X?".

Data source

tracking.ts already has getCompetitorComparison and getShareOfVoiceData. Reuse them.

Where to change (existing MCP pattern)

  • data.ts: getCompetitorComparisonFor(auth, { brandId, ... }) — ownership check, reuse the two functions.
  • server.ts: register get_competitor_comparison.
  • web/src/app/api/mcp/competitor-comparison/route.ts: GET, same data fn.

Acceptance criteria

  • Returns competitor benchmark + share-of-voice for the brand/range.
  • Org-ownership enforced — wrong-org → 404.
  • MCP tool and REST route share the same data function.

Out of scope

UI.

Activity

  1. added
    enhancement
    good first issue
    help wanted
    on May 25, 2026
  2. added a commit that references this issue on May 28, 2026
    3ced376
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 issuehelp wanted

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions