Skip to content

feat: Add MCP tools for polls (create, vote, results, list) - EXO-88347#196

Open
bmestrallet wants to merge 1 commit into
feature/ai-contributionfrom
feat/poll-mcp-tools
Open

feat: Add MCP tools for polls (create, vote, results, list) - EXO-88347#196
bmestrallet wants to merge 1 commit into
feature/ai-contributionfrom
feat/poll-mcp-tools

Conversation

@bmestrallet

Copy link
Copy Markdown

What

Exposes the Poll add-on to the AI agent (EVA) via 4 MCP tools in a new io.meeds.poll.mcp package (PollMcpTool + ai-tool-definitions.json) — no change to the mcp-server webapp; tools are auto-discovered through the kernel↔Spring bridge.

Tool R/W Description
create_poll(space_id, question, options, duration, message) W (approval) Create a poll and post it to a space stream. Requires redactor rights.
vote_in_poll(poll_option_id) W (approval) Cast the user's vote; enforces one-vote-per-user, open poll, membership.
get_poll_results(poll_id) R Question, options, per-option counts/percentages, totals, closed flag, did_vote.
list_space_polls(space_id, limit) R Discovery — list a space's polls with ids + option ids + results.

Why list_space_polls

A poll's id ≠ its activity id and activity tools don't expose the pollId template param, so EVA couldn't find a poll to read or vote on. This tool scans the space stream for poll-type activities and resolves each to its poll id + results.

Notes

  • Every tool acts as the current user — space membership and redactor permissions are enforced by PollService. Votes stay anonymous (only tallies exposed).
  • Adds the mcp-server-tools provided dependency and the -parameters compiler flag (required for MCP arg binding).
  • Tests: poll-services suite green (48 tests), module coverage gate (0.67) holds.
  • Deliberately omitted: who voted (breaks anonymity), close/delete poll (no such product capability today; would need core poll-api changes).

Board task: EXO-88347 · Docs note: https://community.exoplatform.com/portal/s/273/notes/47155

🤖 Generated with Claude Code

Expose the Poll add-on to the AI agent (EVA) via 4 MCP tools in a new
io.meeds.poll.mcp package (PollMcpTool + ai-tool-definitions.json):

- create_poll(space_id, question, options, duration, message) [approval]
- vote_in_poll(poll_option_id) [approval]
- get_poll_results(poll_id)
- list_space_polls(space_id, limit) — discovery, so a poll's id and
  option ids can be found from a space without guessing

Each tool acts as the current user, so space membership and redactor
permissions enforced by PollService apply. Adds the mcp-server-tools
provided dependency, the -parameters compiler flag and unit tests.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@bmestrallet bmestrallet requested a review from ahamdi July 3, 2026 17:34
@sonarqubecloud

sonarqubecloud Bot commented Jul 3, 2026

Copy link
Copy Markdown

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.

1 participant