Skip to content

Feature/mcp prompt suggestions 918 - #1157

Merged
gkhngyk merged 9 commits into
ansvisor:mainfrom
knockknock10:feature/mcp-prompt-suggestions-918
Oct 18, 2026
Merged

gkhngyk merged 9 commits into
ansvisor:mainfrom
knockknock10:feature/mcp-prompt-suggestions-918

Conversation

@knockknock10

Copy link
Copy Markdown
Contributor

Summary

Adds three MCP tools for managing existing prompt suggestions:

  • list_prompt_suggestions — Lists pending suggestions with topic, source, relevance, estimated volume, expiry, and a stale indicator. Does not generate new suggestions.
  • accept_prompt_suggestion — Creates a tracked prompt from a pending suggestion, applying the brand's default engines and plan/location limits, then marks the suggestion as added.
  • dismiss_prompt_suggestion — Dismisses a pending suggestion.

All operations are scoped to the authenticated organization. Acceptance and dismissal require a specific pending suggestion, and the implementation includes handling for concurrent acceptance to avoid leaving duplicate prompts. Adds tests for suggestion expiry and plan-based engine filtering, and updates the MCP documentation.

Related issue

Related to #918

Type of change

  • feat — New feature
  • fix — Bug fix
  • chore — Maintenance / dependencies
  • docs — Documentation only
  • refactor — Code change that neither fixes a bug nor adds a feature
  • test — Adding or updating tests

Checklist

  • Branch follows the naming convention (feature/, fix/, chore/, docs/)
  • Commits follow Conventional Commits
  • yarn lint passes (run from web/)
  • yarn typecheck passes (run from web/)
  • yarn format:check passes (run from web/)
  • Changes are focused — one concern per PR

Copilot AI balanced review requested due to automatic review settings October 18, 2026 10:07

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

The read-only competitor and report tools (ansvisor#1156) landed in the same spot
of server.ts; both sets are kept, prompt suggestions after the topic
suggestion tools. The guide's count is 36: 30 before, three from each PR.

Claude-Session: https://claude.ai/code/session_0121amRjX7UFrgmGELAtkc7A

@gkhngyk gkhngyk left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @knockknock10. Checked:

  • Accepting follows the dashboard's addPromptToSet: the same target set and defaults, plan engine filter, Shopping rule, starting location, location quota and topic match.
  • org_prompt_location_usage filters by organization itself, so calling it with the service role counts this org only.
  • On a concurrent accept, the loser deletes only the prompt it inserted.
  • "Stale" matches the server's list route.

I pushed a merge commit with main: both PRs had added their tools at the same spot in server.ts, so both sets are kept, and the guide now says 36 tools. Typecheck, lint, format and the MCP tests (46) pass on the merged tree.

filterPromptSuggestionEngines duplicates filterByPlan in lib/actions/prompt.ts; a later change can point both at the one helper.

@gkhngyk
gkhngyk merged commit 0b1fe7f into ansvisor:main Oct 18, 2026
5 checks passed
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.

3 participants