Class KudosMcpTool

java.lang.Object
io.meeds.kudos.mcp.KudosMcpTool
All Implemented Interfaces:
io.meeds.mcp.server.plugin.McpToolPlugin

@Service @Profile("mcp-server") public class KudosMcpTool extends Object implements io.meeds.mcp.server.plugin.McpToolPlugin
MCP tools exposing the Kudos add-on to the AI agent (EVA). Every method acts as the current user, so allowance, self-send bans and space redactor rights are enforced by KudosService.
  • Field Summary

    Fields inherited from interface io.meeds.mcp.server.plugin.McpToolPlugin

    DEFAULT_LIMIT, DEFAULT_OFFSET
  • Constructor Summary

    Constructors
    Constructor
    Description
    KudosMcpTool(KudosService kudosService, org.exoplatform.social.core.space.spi.SpaceService spaceService, org.exoplatform.social.core.manager.IdentityManager identityManager, org.exoplatform.social.core.manager.ActivityManager activityManager)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    cancelKudos(Long kudosId)
    Cancels (deletes) a kudos previously sent by the current user.
    Returns the current user's remaining kudos allowance for the running period.
    Lists the kudos attached to an activity (or its comments), enforcing the current user's right to view that activity.
    listReceivedKudos(Long identityId, String periodType, Integer limit)
    Lists the kudos received by a user or space during the current period.
    listSentKudos(Long identityId, String periodType, Integer limit)
    Lists the kudos sent by the current user during the current period.
    sendKudos(String receiverType, String receiverId, String message, String spacePrettyName)
    Sends a kudos from the current user to a user or a space, optionally published in a given space's activity stream.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface io.meeds.mcp.server.plugin.McpToolPlugin

    getCurrentUserAclIdentity, getCurrentUserLocale, getCurrentUserLocale, getCurrentUserName, getLocale
  • Constructor Details

    • KudosMcpTool

      public KudosMcpTool(KudosService kudosService, org.exoplatform.social.core.space.spi.SpaceService spaceService, org.exoplatform.social.core.manager.IdentityManager identityManager, org.exoplatform.social.core.manager.ActivityManager activityManager)
  • Method Details

    • sendKudos

      public KudosResultModel sendKudos(String receiverType, String receiverId, String message, String spacePrettyName) throws IllegalAccessException
      Sends a kudos from the current user to a user or a space, optionally published in a given space's activity stream. ObjectNotFoundException is not declared: KudosService.createKudos is @SneakyThrows and declares only IllegalAccessException, so the compiler cannot see the one it raises when the target space disappears between its resolution here and the write. It still propagates at runtime and still maps to a 404.
      Throws:
      IllegalAccessException
    • cancelKudos

      public String cancelKudos(Long kudosId) throws org.exoplatform.commons.exception.ObjectNotFoundException
      Cancels (deletes) a kudos previously sent by the current user.
      Throws:
      org.exoplatform.commons.exception.ObjectNotFoundException
    • getMyKudosAllowance

      public KudosAllowanceModel getMyKudosAllowance()
      Returns the current user's remaining kudos allowance for the running period.
    • listReceivedKudos

      public KudosList listReceivedKudos(Long identityId, String periodType, Integer limit)
      Lists the kudos received by a user or space during the current period. Defaults to the current user when no identity id is provided.
    • listSentKudos

      public KudosList listSentKudos(Long identityId, String periodType, Integer limit)
      Lists the kudos sent by the current user during the current period. Sent history defaults to the current user and should not be used to enumerate other users.
    • listKudosOnActivity

      public List<Kudos> listKudosOnActivity(String activityId) throws IllegalAccessException
      Lists the kudos attached to an activity (or its comments), enforcing the current user's right to view that activity.
      Throws:
      IllegalAccessException