Class TranscriptExcerptMcpTool

java.lang.Object
org.exoplatform.documents.mcp.TranscriptExcerptMcpTool
All Implemented Interfaces:
io.meeds.mcp.server.plugin.McpToolPlugin

@Service @Profile("mcp-server") public class TranscriptExcerptMcpTool extends Object implements io.meeds.mcp.server.plugin.McpToolPlugin
The MCP tool reading one part of a recording's transcript (EXO-92130), so an assistant reads the chapter or the few minutes a question is about instead of the whole meeting. Each line keeps the moment it was said and who said it. It acts as the current user, so the file's ACL applies, as for the whole transcript.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final long
    The longest part of a transcript one call reads, in seconds.

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

    DEFAULT_LIMIT, DEFAULT_OFFSET
  • Constructor Summary

    Constructors
    Constructor
    Description
    TranscriptExcerptMcpTool(org.exoplatform.documents.service.DocumentFileService documentFileService, org.exoplatform.social.core.manager.IdentityManager identityManager)
    Builds the tool.
  • Method Summary

    Modifier and Type
    Method
    Description
    getTranscriptExcerpt(String documentId, Integer chapter, String from, String to)
    Reads one part of a recording's transcript, read with the user's rights: one chapter, or the lines said between two moments; with neither, lists the chapters with their numbers instead.

    Methods inherited from class 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
  • Field Details

    • MAX_RANGE_SECONDS

      public static final long MAX_RANGE_SECONDS
      The longest part of a transcript one call reads, in seconds.
      See Also:
  • Constructor Details

    • TranscriptExcerptMcpTool

      public TranscriptExcerptMcpTool(org.exoplatform.documents.service.DocumentFileService documentFileService, org.exoplatform.social.core.manager.IdentityManager identityManager)
      Builds the tool.
      Parameters:
      documentFileService - the Documents service storing the transcripts
      identityManager - the service resolving the users who speak
  • Method Details

    • getTranscriptExcerpt

      public String getTranscriptExcerpt(String documentId, Integer chapter, String from, String to) throws IllegalAccessException, org.exoplatform.commons.exception.ObjectNotFoundException
      Reads one part of a recording's transcript, read with the user's rights: one chapter, or the lines said between two moments; with neither, lists the chapters with their numbers instead. Every line overlapping the part is given, each as [mm:ss ยท Ns] Name: text. A chapter runs from its start to the next chapter's, the last one to the end of the recording; chapters are numbered from 1 among those with a title and a start, in the order they are stored, as the outlines of the transcript and of the recordings list number them. A part longer than MAX_RANGE_SECONDS is read up to that length, and the answer says where to go on from.
      Parameters:
      documentId - the recording's UUID
      chapter - the chapter's number, from 1; null to read a time range, or, with from and to blank as well, to list the chapters
      from - the first moment of a time range, mm:ss, h:mm:ss or seconds; blank to read a chapter
      to - the last moment of a time range, in the same forms; blank to read a chapter
      Returns:
      the lines, under a heading naming the file and the part; the numbered chapters when neither a chapter nor a range is given
      Throws:
      IllegalAccessException - when the user may not read the file
      org.exoplatform.commons.exception.ObjectNotFoundException - when the file does not exist, or the user cannot see it
      IllegalArgumentException - when the document id is missing, both a chapter and a range are given, a moment is not one, the range ends before it starts, or the chapter does not exist
      IllegalStateException - when the transcript has no timed lines