Skip to content

feat(mcp): expose get_prompt_volumes tool (search volume + competition) + REST endpoint #100

Closed

Description

@gkhngyk

What

Add an MCP tool get_prompt_volumes (+ /api/mcp/prompt-volumes REST) returning per-prompt search volume + competition for a brand.

Why

Prompt volumes (incl. the competition meter from #44) aren't on MCP. Lets clients / the assistant (#94) answer "which prompts have the most demand / the least competition?".

Data source

The prompt_volumes table — read directly via supabaseAdmin, scoped brand → prompt_sets → prompts → prompt_volumes. Fields: keywords, google_volumes, total_google_volume, est_ai_volume, ai_volume_multiplier, competition_index, competition.

Where to change (existing MCP pattern)

  • data.ts: getPromptVolumesFor(auth, { brandId }) — org-ownership check on the brand first, then read the brand's prompt_volumes.
  • server.ts: register get_prompt_volumes.
  • web/src/app/api/mcp/prompt-volumes/route.ts: GET, same data fn.

Acceptance criteria

  • Returns prompt_volumes rows (with competition) for the brand's prompts.
  • Org-ownership enforced — wrong-org → 404.
  • MCP tool and REST route share the same data function.

Out of scope

Triggering volume analysis (that's the aeo-server / paid DataForSEO call); UI.

Activity

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