tools

package
v2.5.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 29, 2026 License: Apache-2.0 Imports: 29 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var GetDataDirectoryInternal = getDataDirectory

GetDataDirectoryInternal is the internal function that can be overridden in tests

Functions

func EnsureDataDirectory

func EnsureDataDirectory() error

EnsureDataDirectory creates the data directory if it doesn't exist

func NewJSONSchemaForAccessMode

func NewJSONSchemaForAccessMode[T any](accessMode string) *jsonschema.Schema

NewJSONSchemaForAccessMode creates a JSONSchema from a Go struct, filtering fields based on access mode

Access tag examples:

  • access:"local" - only available for local access mode
  • access:"remote" - only available for remote access mode
  • access:"local,remote" - available for both local and remote access modes
  • no access tag - available in all access modes

The function uses comma-separated parsing, so you can specify multiple access modes.

func RunBeforeHook

func RunBeforeHook(mcpCtx *MCPToolContext, toolName string, args any) error

RunBeforeHook is a no-op when no before-hook is registered for toolName. Otherwise it POSTs to the calling plugin and returns an error if the hook rejects or fails (fail-closed). args is the validated, decoded resolver argument struct; the hook receives its JSON form.

Types

type AIBotInfo

type AIBotInfo struct {
	ID          string `json:"id"`
	DisplayName string `json:"displayName"`
	Username    string `json:"username"`
}

AIBotInfo mirrors the api.AIBotInfo type for the fields we need.

type AIBotsResponse

type AIBotsResponse struct {
	Bots []AIBotInfo `json:"bots"`
}

AIBotsResponse mirrors the api.AIBotsResponse type.

type AIPromptActionConfig

type AIPromptActionConfig struct {
	SystemPrompt string                `json:"system_prompt,omitempty"`
	Prompt       string                `json:"prompt"`
	ProviderType string                `json:"provider_type"`
	ProviderID   string                `json:"provider_id"`
	AllowedTools []string              `json:"allowed_tools,omitempty"`
	Guardrails   *AutomationGuardrails `json:"guardrails,omitempty"`
	// RequestAs selects which user the AI completion request is attributed to.
	// Allowed values: "" or "triggerer" (default — the user who triggered the
	// automation, falling back to the flow creator when the trigger has no
	// associated user) or "creator" (always the flow creator).
	RequestAs string `json:"request_as,omitempty"`
}

AIPromptActionConfig holds config for the ai_prompt action type.

type AccessMode

type AccessMode string

AccessMode represents the security access level for MCP operations

const (
	// AccessModeLocal indicates the mode has local filesystem access and can execute local operations
	AccessModeLocal AccessMode = "local"
	// AccessModeRemote indicates the mode operates over network and has security restrictions
	AccessModeRemote AccessMode = "remote"
)

type AcknowledgePostArgs

type AcknowledgePostArgs struct {
	PostID string `json:"post_id" jsonschema:"The ID of the post to acknowledge,minLength=26,maxLength=26"`
}

AcknowledgePostArgs represents arguments for the acknowledge_post tool.

type AddChannelMemberArgs

type AddChannelMemberArgs struct {
	UserID    string `json:"user_id" jsonschema:"ID of the user to add,minLength=26,maxLength=26"`
	ChannelID string `json:"channel_id" jsonschema:"ID of the channel to add user to,minLength=26,maxLength=26"`
}

AddChannelMemberArgs represents arguments for the add_channel_member tool

type AddChannelMembersArgs

type AddChannelMembersArgs struct {
	ChannelID string   `json:"channel_id" jsonschema:"The channel to add users to,minLength=26,maxLength=26"`
	UserIDs   []string `json:"user_ids" jsonschema:"The user IDs to add"`
}

AddChannelMembersArgs represents arguments for the add_channel_members tool.

type AddReactionArgs

type AddReactionArgs struct {
	PostID    string `json:"post_id" jsonschema:"The ID of the post to react to,minLength=26,maxLength=26"`
	EmojiName string `json:"emoji_name" jsonschema:"The emoji name without colons (e.g. thumbsup),minLength=1"`
}

AddReactionArgs represents arguments for the add_reaction tool.

type AddTeamMemberArgs

type AddTeamMemberArgs struct {
	UserID string `json:"user_id" jsonschema:"ID of the user to add,minLength=26,maxLength=26"`
	TeamID string `json:"team_id" jsonschema:"ID of the team to add user to,minLength=26,maxLength=26"`
}

AddTeamMemberArgs represents arguments for the add_team_member tool

type AddTeamMembersArgs

type AddTeamMembersArgs struct {
	TeamID  string   `json:"team_id" jsonschema:"The team to add users to,minLength=26,maxLength=26"`
	UserIDs []string `json:"user_ids" jsonschema:"The user IDs to add"`
}

AddTeamMembersArgs represents arguments for the add_team_members tool.

type ArchiveChannelArgs

type ArchiveChannelArgs struct {
	ChannelID string `json:"channel_id" jsonschema:"The channel to archive,minLength=26,maxLength=26"`
}

ArchiveChannelArgs represents arguments for the archive_channel tool.

type Automation

type Automation struct {
	ID        string             `json:"id,omitempty"`
	Name      string             `json:"name"`
	Enabled   bool               `json:"enabled"`
	Trigger   AutomationTrigger  `json:"trigger"`
	Actions   []AutomationAction `json:"actions"`
	CreatedAt int64              `json:"created_at,omitempty"`
	UpdatedAt int64              `json:"updated_at,omitempty"`
	CreatedBy string             `json:"created_by,omitempty"`
}

Automation mirrors the channel-automation plugin's Automation model.

type AutomationAction

type AutomationAction struct {
	ID          string                   `json:"id"`
	SendMessage *SendMessageActionConfig `json:"send_message,omitempty"`
	AIPrompt    *AIPromptActionConfig    `json:"ai_prompt,omitempty"`
	SendDM      *SendDMActionConfig      `json:"send_dm,omitempty"`
}

AutomationAction defines a single step in an automation. Exactly one config pointer should be set.

type AutomationGuardrails

type AutomationGuardrails struct {
	ChannelIDs []string `json:"channel_ids,omitempty"`
}

AutomationGuardrails mirrors channel-automation guardrails that constrain where an automation may operate.

type AutomationTrigger

type AutomationTrigger struct {
	MessagePosted     *MessagePostedConfig     `json:"message_posted,omitempty"`
	Schedule          *ScheduleConfig          `json:"schedule,omitempty"`
	MembershipChanged *MembershipChangedConfig `json:"membership_changed,omitempty"`
	ChannelCreated    *ChannelCreatedConfig    `json:"channel_created,omitempty"`
	UserJoinedTeam    *UserJoinedTeamConfig    `json:"user_joined_team,omitempty"`
}

AutomationTrigger defines when an automation fires. Exactly one config pointer should be set.

type ChannelCreatedConfig

type ChannelCreatedConfig struct {
	TeamID string `json:"team_id"`
}

ChannelCreatedConfig holds trigger config for the channel_created trigger type.

type CombinedSearchArgs

type CombinedSearchArgs struct {
	Query          string `json:"query" jsonschema:"The search query,minLength=1,maxLength=4000"`
	TeamID         string `json:"team_id,omitempty" jsonschema:"Optional team ID to limit search scope,minLength=26,maxLength=26"`
	ChannelID      string `json:"channel_id,omitempty" jsonschema:"Optional channel ID to limit search to a specific channel,minLength=26,maxLength=26"`
	From           string `json:"from,omitempty" jsonschema:"Optional username — only posts from this user (keyword search only),maxLength=64"`
	In             string `` /* 126-byte string literal not displayed */
	Before         string `json:"before,omitempty" jsonschema:"Optional date YYYY-MM-DD — only posts before this date (keyword search only)"`
	After          string `json:"after,omitempty" jsonschema:"Optional date YYYY-MM-DD — only posts after this date (keyword search only)"`
	SemanticLimit  int    `json:"semantic_limit,omitempty" jsonschema:"Max results from semantic search (default 10; max 50),minimum=1,maximum=50"`
	SemanticOffset int    `json:"semantic_offset,omitempty" jsonschema:"Offset for semantic search pagination,minimum=0"`
	KeywordLimit   int    `json:"keyword_limit,omitempty" jsonschema:"Max results from keyword search (default 10; max 100),minimum=1,maximum=100"`
	KeywordOffset  int    `json:"keyword_offset,omitempty" jsonschema:"Offset for keyword search pagination,minimum=0"`
}

CombinedSearchArgs represents arguments for search_posts when both semantic and keyword search are available.

type ConvertChannelPrivacyArgs

type ConvertChannelPrivacyArgs struct {
	ChannelID string `json:"channel_id" jsonschema:"The channel to convert,minLength=26,maxLength=26"`
	Privacy   string `json:"privacy" jsonschema:"Target privacy,enum=O,enum=P"`
}

ConvertChannelPrivacyArgs represents arguments for the convert_channel_privacy tool.

type CreateAutomationArgs

type CreateAutomationArgs struct {
	Name    string             `json:"name" jsonschema:"The name of the automation,minLength=1"`
	Enabled bool               `json:"enabled" jsonschema:"Whether the automation is enabled"`
	Trigger AutomationTrigger  `json:"trigger" jsonschema:"Set exactly one trigger type"`
	Actions []AutomationAction `json:"actions" jsonschema:"Ordered list of actions to perform when triggered"`
}

CreateAutomationArgs represents arguments for the create_automation tool.

type CreateChannelArgs

type CreateChannelArgs struct {
	Name        string `json:"name" jsonschema:"The channel name (URL-friendly),minLength=1,maxLength=64"`
	DisplayName string `json:"display_name" jsonschema:"The channel display name,minLength=1,maxLength=64"`
	Type        string `json:"type" jsonschema:"Channel type,enum=O,enum=P"`
	TeamID      string `json:"team_id" jsonschema:"The team ID where the channel will be created,minLength=26,maxLength=26"`
	Purpose     string `json:"purpose" jsonschema:"Optional channel purpose,maxLength=250"`
	Header      string `json:"header" jsonschema:"Optional channel header,maxLength=1024"`
}

CreateChannelArgs represents arguments for the create_channel tool

type CreateChannelBookmarkArgs

type CreateChannelBookmarkArgs struct {
	ChannelID   string `json:"channel_id" jsonschema:"The channel to add the bookmark to,minLength=26,maxLength=26"`
	DisplayName string `json:"display_name" jsonschema:"The bookmark display name,minLength=1"`
	LinkURL     string `json:"link_url,omitempty" jsonschema:"The bookmark link URL (for a link bookmark)"`
	FileID      string `json:"file_id,omitempty" jsonschema:"The file ID (for a file bookmark); provide link_url OR file_id,maxLength=26"`
	Emoji       string `json:"emoji,omitempty" jsonschema:"Optional emoji name for the bookmark"`
}

CreateChannelBookmarkArgs represents arguments for the create_channel_bookmark tool.

type CreatePostArgs

type CreatePostArgs struct {
	ChannelID          string   `json:"channel_id" jsonschema:"The ID of the channel to post in,minLength=26,maxLength=26"`
	ChannelDisplayName string   `json:"channel_display_name" jsonschema:"The display name of the channel (for context verification),minLength=1"`
	TeamDisplayName    string   `json:"team_display_name" jsonschema:"The display name of the team (for context verification),minLength=1"`
	Message            string   `json:"message" jsonschema:"The message content,minLength=1"`
	RootID             string   `json:"root_id,omitempty" jsonschema:"Optional root post ID for replies,minLength=26,maxLength=26"`
	Attachments        []string `json:"attachments,omitempty" access:"local" jsonschema:"Optional list of file paths or URLs to attach to the post"`
}

CreatePostArgs represents arguments for the create_post tool

type CreatePostAsUserArgs

type CreatePostAsUserArgs struct {
	Username    string   `json:"username" jsonschema:"Username to login as"`
	Password    string   `json:"password" jsonschema:"Password to login with"`
	ChannelID   string   `json:"channel_id" jsonschema:"The ID of the channel to post in,minLength=26,maxLength=26"`
	Message     string   `json:"message" jsonschema:"The message content"`
	RootID      string   `json:"root_id,omitempty" jsonschema:"Optional root post ID for replies,maxLength=26"`
	Props       string   `json:"props" jsonschema:"Optional post properties (JSON string)"`
	Attachments []string `json:"attachments,omitempty" access:"local" jsonschema:"Optional list of file paths or URLs to attach to the post"`
}

CreatePostAsUserArgs represents arguments for the create_post_as_user tool (dev mode only)

type CreateScheduledPostArgs

type CreateScheduledPostArgs struct {
	ChannelID   string `json:"channel_id" jsonschema:"The ID of the channel to post in,minLength=26,maxLength=26"`
	Message     string `json:"message" jsonschema:"The message content,minLength=1"`
	ScheduledAt string `` /* 128-byte string literal not displayed */
	RootID      string `json:"root_id,omitempty" jsonschema:"Optional root post ID to schedule a thread reply,maxLength=26"`
}

CreateScheduledPostArgs represents arguments for the create_scheduled_post tool.

type CreateTeamArgs

type CreateTeamArgs struct {
	Name        string `json:"name" jsonschema:"URL name for the team,minLength=1,maxLength=64"`
	DisplayName string `json:"display_name" jsonschema:"Display name for the team,minLength=1,maxLength=64"`
	Type        string `json:"type" jsonschema:"Team type,enum=O,enum=I"`
	Description string `json:"description" jsonschema:"Team description,maxLength=255"`
	TeamIcon    string `` /* 126-byte string literal not displayed */
}

CreateTeamArgs represents arguments for the create_team tool (dev mode only)

type CreateUserArgs

type CreateUserArgs struct {
	Username     string `json:"username" jsonschema:"Username for the new user"`
	Email        string `json:"email" jsonschema:"Email address for the new user"`
	Password     string `json:"password" jsonschema:"Password for the new user"`
	FirstName    string `json:"first_name" jsonschema:"First name of the user"`
	LastName     string `json:"last_name" jsonschema:"Last name of the user"`
	Nickname     string `json:"nickname" jsonschema:"Nickname for the user"`
	ProfileImage string `` /* 136-byte string literal not displayed */
}

CreateUserArgs represents arguments for the create_user tool (dev mode only)

type DMArgs

type DMArgs struct {
	Username    string   `json:"username,omitempty" jsonschema:"Target username. If omitted the message is sent to yourself."`
	Message     string   `json:"message" jsonschema:"The message content to send,minLength=1"`
	Attachments []string `json:"attachments,omitempty" access:"local" jsonschema:"Optional list of file paths or URLs to attach"`
}

DMArgs represents arguments for the dm tool

type DeleteAutomationArgs

type DeleteAutomationArgs struct {
	AutomationID string `json:"automation_id" jsonschema:"The ID of the automation to delete,minLength=26,maxLength=26"`
}

DeleteAutomationArgs represents arguments for the delete_automation tool.

type DeleteChannelBookmarkArgs

type DeleteChannelBookmarkArgs struct {
	ChannelID  string `json:"channel_id" jsonschema:"The channel the bookmark belongs to,minLength=26,maxLength=26"`
	BookmarkID string `json:"bookmark_id" jsonschema:"The bookmark to remove,minLength=26,maxLength=26"`
}

DeleteChannelBookmarkArgs represents arguments for the delete_channel_bookmark tool.

type DeletePostArgs

type DeletePostArgs struct {
	PostID string `json:"post_id" jsonschema:"The ID of the post to delete,minLength=26,maxLength=26"`
}

DeletePostArgs represents arguments for the delete_post tool.

type DeleteScheduledPostArgs

type DeleteScheduledPostArgs struct {
	ScheduledPostID string `json:"scheduled_post_id" jsonschema:"The ID of the pending scheduled post to cancel,minLength=26,maxLength=26"`
}

DeleteScheduledPostArgs represents arguments for the delete_scheduled_post tool.

type FileContentService

type FileContentService interface {
	GetContent(ctx context.Context, userID, fileID string, offset, limit int) (files.Content, error)
}

FileContentService reads the text contents of Mattermost file attachments on behalf of a user, enforcing that user's channel permissions. *files.Service implements it directly for embedded servers; HTTPFileContentService calls back to the plugin endpoint for external servers.

type GetBotArgs

type GetBotArgs struct {
	BotUserID string `json:"bot_user_id" jsonschema:"The bot account's user ID,minLength=26,maxLength=26"`
}

GetBotArgs represents arguments for the get_bot tool.

type GetBulkReactionsArgs

type GetBulkReactionsArgs struct {
	PostIDs []string `json:"post_ids" jsonschema:"The IDs of the posts to fetch reactions for"`
}

GetBulkReactionsArgs represents arguments for the get_bulk_reactions tool.

type GetChannelGroupsArgs

type GetChannelGroupsArgs struct {
	ChannelID string `json:"channel_id" jsonschema:"The channel,minLength=26,maxLength=26"`
	Page      int    `json:"page,omitempty" jsonschema:"Page number for pagination (default: 0),minimum=0"`
	PerPage   int    `json:"per_page,omitempty" jsonschema:"Groups per page (default: 60, max: 200),minimum=1,maximum=200"`
}

GetChannelGroupsArgs represents arguments for the get_channel_groups tool.

type GetChannelInfoArgs

type GetChannelInfoArgs struct {
	ChannelID   string `json:"channel_id,omitempty" jsonschema:"The exact channel ID (fastest, most reliable method),maxLength=26"`
	ChannelName string `` /* 178-byte string literal not displayed */
	TeamID      string `` /* 153-byte string literal not displayed */
}

GetChannelInfoArgs represents arguments for the get_channel_info tool

type GetChannelMemberArgs

type GetChannelMemberArgs struct {
	ChannelID string `json:"channel_id" jsonschema:"The channel,minLength=26,maxLength=26"`
	UserID    string `json:"user_id,omitempty" jsonschema:"The user; omit for your own membership,maxLength=26"`
}

GetChannelMemberArgs represents arguments for the get_channel_member tool.

type GetChannelMemberCountsArgs

type GetChannelMemberCountsArgs struct {
	ChannelIDs []string `json:"channel_ids" jsonschema:"The channel IDs to get member counts for"`
}

GetChannelMemberCountsArgs represents arguments for the get_channel_member_counts tool.

type GetChannelMembersArgs

type GetChannelMembersArgs struct {
	ChannelID   string `json:"channel_id" jsonschema:"ID of the channel to get members for,minLength=26,maxLength=26"`
	Limit       int    `json:"limit,omitempty" jsonschema:"Number of members to return (default: 50, max: 200),minimum=1,maximum=200"`
	Page        int    `json:"page,omitempty" jsonschema:"Page number for pagination (default: 0),minimum=0"`
	ExcludeBots *bool  `json:"exclude_bots,omitempty" jsonschema:"Exclude bot accounts from results (default: true)"`
}

GetChannelMembersArgs represents arguments for the get_channel_members tool

type GetChannelMembersByIDsArgs

type GetChannelMembersByIDsArgs struct {
	ChannelID string   `json:"channel_id" jsonschema:"The channel,minLength=26,maxLength=26"`
	UserIDs   []string `json:"user_ids" jsonschema:"The user IDs whose membership records to fetch"`
}

GetChannelMembersByIDsArgs represents arguments for the get_channel_members_by_ids tool.

type GetChannelMembersByStatusArgs

type GetChannelMembersByStatusArgs struct {
	ChannelID   string `json:"channel_id" jsonschema:"The channel,minLength=26,maxLength=26"`
	Page        int    `json:"page,omitempty" jsonschema:"Page number for pagination (default: 0),minimum=0"`
	PerPage     int    `json:"per_page,omitempty" jsonschema:"Members per page (default: 50, max: 200),minimum=1,maximum=200"`
	ExcludeBots *bool  `json:"exclude_bots,omitempty" jsonschema:"Exclude bot accounts (default: true)"`
}

GetChannelMembersByStatusArgs represents arguments for the get_channel_members_by_status tool.

type GetChannelModerationsArgs

type GetChannelModerationsArgs struct {
	ChannelID string `json:"channel_id" jsonschema:"The channel,minLength=26,maxLength=26"`
}

GetChannelModerationsArgs represents arguments for the get_channel_moderations tool.

type GetChannelStatsArgs

type GetChannelStatsArgs struct {
	ChannelID string `json:"channel_id" jsonschema:"The channel to get statistics for,minLength=26,maxLength=26"`
}

GetChannelStatsArgs represents arguments for the get_channel_stats tool.

type GetChannelUnreadArgs

type GetChannelUnreadArgs struct {
	ChannelID string `json:"channel_id" jsonschema:"The channel to read unread counts for,minLength=26,maxLength=26"`
}

GetChannelUnreadArgs represents arguments for the get_channel_unread tool.

type GetDMCommonTeamsArgs

type GetDMCommonTeamsArgs struct {
	ChannelID string `json:"channel_id" jsonschema:"The direct message or group message channel,minLength=26,maxLength=26"`
}

GetDMCommonTeamsArgs represents arguments for the get_dm_common_teams tool.

type GetFileInfoArgs

type GetFileInfoArgs struct {
	FileID string `json:"file_id" jsonschema:"The file/attachment ID,minLength=26,maxLength=26"`
}

GetFileInfoArgs represents arguments for the get_file_info tool.

type GetFileLinkArgs

type GetFileLinkArgs struct {
	FileID string `json:"file_id" jsonschema:"The file to get a public permalink for,minLength=26,maxLength=26"`
}

GetFileLinkArgs represents arguments for the get_file_link tool.

type GetGroupInfoArgs

type GetGroupInfoArgs struct {
	GroupID string `json:"group_id" jsonschema:"The group ID,minLength=26,maxLength=26"`
}

GetGroupInfoArgs represents arguments for the get_group_info tool.

type GetMeArgs

type GetMeArgs struct{}

GetMeArgs represents arguments for the get_me tool.

type GetMentionsArgs

type GetMentionsArgs struct {
	TeamID string `json:"team_id,omitempty" jsonschema:"Optional team ID to limit the search scope,maxLength=26"`
}

GetMentionsArgs represents arguments for the get_mentions tool.

type GetNewUsersInTeamArgs

type GetNewUsersInTeamArgs struct {
	TeamID  string `json:"team_id" jsonschema:"The team,minLength=26,maxLength=26"`
	Page    int    `json:"page,omitempty" jsonschema:"Page number for pagination (default: 0),minimum=0"`
	PerPage int    `json:"per_page,omitempty" jsonschema:"Users per page (default: 50, max: 200),minimum=1,maximum=200"`
}

GetNewUsersInTeamArgs represents arguments for the get_new_users_in_team tool.

type GetPostFilesArgs

type GetPostFilesArgs struct {
	PostID string `json:"post_id" jsonschema:"The post whose file attachments to list,minLength=26,maxLength=26"`
}

GetPostFilesArgs represents arguments for the get_post_files tool.

type GetPostInfoArgs

type GetPostInfoArgs struct {
	PostID string `json:"post_id" jsonschema:"The ID of the post,minLength=26,maxLength=26"`
}

GetPostInfoArgs represents arguments for the get_post_info tool.

type GetPostReactionsArgs

type GetPostReactionsArgs struct {
	PostID string `json:"post_id" jsonschema:"The ID of the post,minLength=26,maxLength=26"`
}

GetPostReactionsArgs represents arguments for the get_post_reactions tool.

type GetPostsAroundUnreadArgs

type GetPostsAroundUnreadArgs struct {
	ChannelID string `json:"channel_id" jsonschema:"The channel to read around the last-read line,minLength=26,maxLength=26"`
	Limit     int    `` /* 129-byte string literal not displayed */
}

GetPostsAroundUnreadArgs represents arguments for the get_posts_around_unread tool.

type GetRoleArgs

type GetRoleArgs struct {
	RoleID   string `json:"role_id,omitempty" jsonschema:"The role ID (provide role_id or role_name),maxLength=26"`
	RoleName string `json:"role_name,omitempty" jsonschema:"The role name (e.g. channel_admin); provide role_id or role_name"`
}

GetRoleArgs represents arguments for the get_role tool.

type GetTeamGroupsArgs

type GetTeamGroupsArgs struct {
	TeamID  string `json:"team_id" jsonschema:"The team,minLength=26,maxLength=26"`
	Page    int    `json:"page,omitempty" jsonschema:"Page number for pagination (default: 0),minimum=0"`
	PerPage int    `json:"per_page,omitempty" jsonschema:"Groups per page (default: 60, max: 200),minimum=1,maximum=200"`
}

GetTeamGroupsArgs represents arguments for the get_team_groups tool.

type GetTeamInfoArgs

type GetTeamInfoArgs struct {
	TeamID   string `json:"team_id,omitempty" jsonschema:"The exact team ID (fastest, most reliable method),maxLength=26"`
	TeamName string `` /* 159-byte string literal not displayed */
}

GetTeamInfoArgs represents arguments for the get_team_info tool

type GetTeamMemberArgs

type GetTeamMemberArgs struct {
	TeamID string `json:"team_id" jsonschema:"The team,minLength=26,maxLength=26"`
	UserID string `json:"user_id,omitempty" jsonschema:"The user; omit for yourself,maxLength=26"`
}

GetTeamMemberArgs represents arguments for the get_team_member tool.

type GetTeamMembersArgs

type GetTeamMembersArgs struct {
	TeamID      string `json:"team_id" jsonschema:"ID of the team to get members for,minLength=26,maxLength=26"`
	Limit       int    `json:"limit,omitempty" jsonschema:"Number of members to return (default: 50, max: 200),minimum=1,maximum=200"`
	Page        int    `json:"page,omitempty" jsonschema:"Page number for pagination (default: 0),minimum=0"`
	ExcludeBots *bool  `json:"exclude_bots,omitempty" jsonschema:"Exclude bot accounts from results (default: true)"`
}

GetTeamMembersArgs represents arguments for the get_team_members tool

type GetTeamStatsArgs

type GetTeamStatsArgs struct {
	TeamID string `json:"team_id" jsonschema:"The team,minLength=26,maxLength=26"`
}

GetTeamStatsArgs represents arguments for the get_team_stats tool.

type GetThreadsArgs

type GetThreadsArgs struct {
	TeamID     string `json:"team_id" jsonschema:"The team whose threads inbox to read,minLength=26,maxLength=26"`
	UnreadOnly bool   `json:"unread_only,omitempty" jsonschema:"Only return unread threads (default: false)"`
	Limit      int    `json:"limit,omitempty" jsonschema:"Number of threads to return (default: 30, max: 100),minimum=1,maximum=100"`
}

GetThreadsArgs represents arguments for the get_threads tool.

type GetUnreadCountsArgs

type GetUnreadCountsArgs struct {
	TeamID string `json:"team_id,omitempty" jsonschema:"Optional team ID; omit for unread counts across all teams,maxLength=26"`
}

GetUnreadCountsArgs represents arguments for the get_unread_counts tool.

type GetUserArgs

type GetUserArgs struct {
	UserID string `json:"user_id" jsonschema:"The ID of the user,minLength=26,maxLength=26"`
}

GetUserArgs represents arguments for the get_user tool.

type GetUserByEmailArgs

type GetUserByEmailArgs struct {
	Email string `json:"email" jsonschema:"The user's email address,minLength=1"`
}

GetUserByEmailArgs represents arguments for the get_user_by_email tool.

type GetUserByUsernameArgs

type GetUserByUsernameArgs struct {
	Username string `json:"username" jsonschema:"The username (without @),minLength=1"`
}

GetUserByUsernameArgs represents arguments for the get_user_by_username tool.

type GetUserCPAValuesArgs

type GetUserCPAValuesArgs struct {
	UserID string `json:"user_id" jsonschema:"The user whose custom profile attribute (CPA) values to fetch,minLength=26,maxLength=26"`
}

GetUserCPAValuesArgs represents arguments for the get_user_cpa_values tool.

type GetUserChannelMembershipsArgs

type GetUserChannelMembershipsArgs struct {
	UserID string `json:"user_id,omitempty" jsonschema:"The user; omit for yourself,maxLength=26"`
	TeamID string `json:"team_id" jsonschema:"The team to scope channel memberships to,minLength=26,maxLength=26"`
}

GetUserChannelMembershipsArgs represents arguments for the get_user_channel_memberships tool.

type GetUserChannelsArgs

type GetUserChannelsArgs struct {
	TeamID  string `json:"team_id,omitempty" jsonschema:"Optional team ID to filter channels by team,maxLength=26"`
	Page    int    `json:"page,omitempty" jsonschema:"Page number for pagination (default: 0),minimum=0"`
	PerPage int    `json:"per_page,omitempty" jsonschema:"Number of channels per page (default: 60, max: 200),minimum=1,maximum=200"`
}

GetUserChannelsArgs represents arguments for the get_user_channels tool

type GetUserCustomStatusArgs

type GetUserCustomStatusArgs struct {
	UserID string `json:"user_id" jsonschema:"The user whose custom status to fetch,minLength=26,maxLength=26"`
}

GetUserCustomStatusArgs represents arguments for the get_user_custom_status tool.

type GetUserGroupsArgs

type GetUserGroupsArgs struct {
	UserID string `json:"user_id,omitempty" jsonschema:"The user; omit for yourself,maxLength=26"`
}

GetUserGroupsArgs represents arguments for the get_user_groups tool.

type GetUserStatsArgs

type GetUserStatsArgs struct{}

GetUserStatsArgs represents arguments for the get_user_stats tool.

type GetUserStatusArgs

type GetUserStatusArgs struct {
	UserID string `json:"user_id" jsonschema:"The user whose presence to fetch,minLength=26,maxLength=26"`
}

GetUserStatusArgs represents arguments for the get_user_status tool.

type GetUserTeamsArgs

type GetUserTeamsArgs struct {
	UserID string `json:"user_id,omitempty" jsonschema:"The user; omit for yourself,maxLength=26"`
}

GetUserTeamsArgs represents arguments for the get_user_teams tool.

type GetUsersByIDsArgs

type GetUsersByIDsArgs struct {
	UserIDs []string `json:"user_ids" jsonschema:"The user IDs to fetch"`
}

GetUsersByIDsArgs represents arguments for the get_users_by_ids tool.

type GetUsersByUsernamesArgs

type GetUsersByUsernamesArgs struct {
	Usernames []string `json:"usernames" jsonschema:"The usernames (without @) to fetch"`
}

GetUsersByUsernamesArgs represents arguments for the get_users_by_usernames tool.

type GetUsersInGroupChannelsArgs

type GetUsersInGroupChannelsArgs struct {
	ChannelIDs []string `json:"channel_ids" jsonschema:"The group-message (GM) channel IDs"`
}

GetUsersInGroupChannelsArgs represents arguments for the get_users_in_group_channels tool.

type GetUsersInTeamArgs

type GetUsersInTeamArgs struct {
	TeamID  string `json:"team_id" jsonschema:"The team,minLength=26,maxLength=26"`
	Page    int    `json:"page,omitempty" jsonschema:"Page number for pagination (default: 0),minimum=0"`
	PerPage int    `json:"per_page,omitempty" jsonschema:"Users per page (default: 50, max: 200),minimum=1,maximum=200"`
}

GetUsersInTeamArgs represents arguments for the get_users_in_team tool.

type GetUsersNotInChannelArgs

type GetUsersNotInChannelArgs struct {
	TeamID    string `json:"team_id" jsonschema:"The team,minLength=26,maxLength=26"`
	ChannelID string `json:"channel_id" jsonschema:"The channel,minLength=26,maxLength=26"`
	Page      int    `json:"page,omitempty" jsonschema:"Page number for pagination (default: 0),minimum=0"`
	PerPage   int    `json:"per_page,omitempty" jsonschema:"Users per page (default: 50, max: 200),minimum=1,maximum=200"`
}

GetUsersNotInChannelArgs represents arguments for the get_users_not_in_channel tool.

type GetUsersNotInTeamArgs

type GetUsersNotInTeamArgs struct {
	TeamID  string `json:"team_id" jsonschema:"The team,minLength=26,maxLength=26"`
	Page    int    `json:"page,omitempty" jsonschema:"Page number for pagination (default: 0),minimum=0"`
	PerPage int    `json:"per_page,omitempty" jsonschema:"Users per page (default: 50, max: 200),minimum=1,maximum=200"`
}

GetUsersNotInTeamArgs represents arguments for the get_users_not_in_team tool.

type GetUsersStatusesArgs

type GetUsersStatusesArgs struct {
	UserIDs []string `json:"user_ids" jsonschema:"The user IDs whose presence to fetch"`
}

GetUsersStatusesArgs represents arguments for the get_users_statuses tool.

type GroupMessageArgs

type GroupMessageArgs struct {
	Usernames   []string `json:"usernames" jsonschema:"Target usernames (must be at least 2)."`
	Message     string   `json:"message" jsonschema:"The message content to send,minLength=1"`
	Attachments []string `json:"attachments,omitempty" access:"local" jsonschema:"Optional list of file paths or URLs to attach"`
}

GroupMessageArgs represents arguments for the group_message tool

type HTTPFileContentService

type HTTPFileContentService struct {
	// contains filtered or unexported fields
}

HTTPFileContentService reads file contents by calling back to the plugin API. This allows external MCP servers (HTTP, Stdio) to read attachments while the permission check and admin-API extraction stay inside the plugin.

func NewHTTPFileContentService

func NewHTTPFileContentService(pluginURL string) *HTTPFileContentService

NewHTTPFileContentService creates a new HTTP-based file content service. pluginURL should be the base URL to the plugin, e.g., "https://mattermost.example.com/plugins/mattermost-ai"

func (*HTTPFileContentService) GetContent

func (s *HTTPFileContentService) GetContent(ctx context.Context, userID, fileID string, offset, limit int) (files.Content, error)

GetContent reads a ranged slice of a file's text via the plugin's endpoint.

type HTTPSemanticSearchService

type HTTPSemanticSearchService struct {
	// contains filtered or unexported fields
}

HTTPSemanticSearchService provides semantic search by calling back to the plugin API. This allows external MCP servers (HTTP, Stdio) to access semantic search capabilities.

func NewHTTPSemanticSearchService

func NewHTTPSemanticSearchService(pluginURL string) *HTTPSemanticSearchService

NewHTTPSemanticSearchService creates a new HTTP-based semantic search service. pluginURL should be the base URL to the plugin, e.g., "https://mattermost.example.com/plugins/mattermost-ai"

func (*HTTPSemanticSearchService) Enabled

func (s *HTTPSemanticSearchService) Enabled() bool

Enabled returns true since this service is always available when created. The actual availability check happens at the plugin endpoint.

func (*HTTPSemanticSearchService) Search

Search performs a semantic search by calling the plugin's MCP semantic search endpoint

type InviteUsersToTeamAndChannelsArgs

type InviteUsersToTeamAndChannelsArgs struct {
	TeamID     string   `json:"team_id" jsonschema:"The team to invite users to,minLength=26,maxLength=26"`
	Emails     []string `json:"emails" jsonschema:"The email addresses to invite"`
	ChannelIDs []string `json:"channel_ids" jsonschema:"The channel IDs to add the invited users to"`
	Message    string   `json:"message,omitempty" jsonschema:"Optional custom invite message"`
}

InviteUsersToTeamAndChannelsArgs represents arguments for the invite_users_to_team_and_channels tool.

type InviteUsersToTeamArgs

type InviteUsersToTeamArgs struct {
	TeamID string   `json:"team_id" jsonschema:"The team to invite users to,minLength=26,maxLength=26"`
	Emails []string `json:"emails" jsonschema:"The email addresses to invite"`
}

InviteUsersToTeamArgs represents arguments for the invite_users_to_team tool.

type KeywordOnlySearchArgs

type KeywordOnlySearchArgs struct {
	Query         string `json:"query" jsonschema:"The search query,minLength=1,maxLength=4000"`
	TeamID        string `json:"team_id,omitempty" jsonschema:"Optional team ID to limit search scope,minLength=26,maxLength=26"`
	ChannelID     string `json:"channel_id,omitempty" jsonschema:"Optional channel ID to limit search to a specific channel,minLength=26,maxLength=26"`
	From          string `json:"from,omitempty" jsonschema:"Optional username — only posts from this user,maxLength=64"`
	In            string `json:"in,omitempty" jsonschema:"Optional channel name or ID — only posts in this channel,maxLength=64"`
	Before        string `json:"before,omitempty" jsonschema:"Optional date YYYY-MM-DD — only posts before this date"`
	After         string `json:"after,omitempty" jsonschema:"Optional date YYYY-MM-DD — only posts after this date"`
	KeywordLimit  int    `json:"keyword_limit,omitempty" jsonschema:"Max results from keyword search (default 10; max 100),minimum=1,maximum=100"`
	KeywordOffset int    `json:"keyword_offset,omitempty" jsonschema:"Offset for keyword search pagination,minimum=0"`
}

KeywordOnlySearchArgs represents arguments for search_posts when only keyword search is available.

type ListAgentsArgs

type ListAgentsArgs struct{}

ListAgentsArgs represents arguments for the list_agents tool.

type ListArchivedChannelsArgs

type ListArchivedChannelsArgs struct {
	TeamID  string `json:"team_id" jsonschema:"The team whose archived channels to list,minLength=26,maxLength=26"`
	Page    int    `json:"page,omitempty" jsonschema:"Page number for pagination (default: 0),minimum=0"`
	PerPage int    `json:"per_page,omitempty" jsonschema:"Number of channels per page (default: 60, max: 200),minimum=1,maximum=200"`
}

ListArchivedChannelsArgs represents arguments for the list_archived_channels tool.

type ListAutomationsArgs

type ListAutomationsArgs struct {
	AutomationID string `json:"automation_id,omitempty" jsonschema:"The ID of a specific automation to retrieve,maxLength=26"`
	ChannelID    string `json:"channel_id,omitempty" jsonschema:"Filter automations by trigger channel ID,maxLength=26"`
}

ListAutomationsArgs represents arguments for the list_automations tool.

type ListBotsArgs

type ListBotsArgs struct {
	Page    int `json:"page,omitempty" jsonschema:"Page number for pagination (default: 0),minimum=0"`
	PerPage int `json:"per_page,omitempty" jsonschema:"Bots per page (default: 50, max: 200),minimum=1,maximum=200"`
}

ListBotsArgs represents arguments for the list_bots tool.

type ListCPAFieldsArgs

type ListCPAFieldsArgs struct{}

ListCPAFieldsArgs represents arguments for the list_cpa_fields tool.

type ListChannelBookmarksArgs

type ListChannelBookmarksArgs struct {
	ChannelID string `json:"channel_id" jsonschema:"The channel whose bookmarks to list,minLength=26,maxLength=26"`
}

ListChannelBookmarksArgs represents arguments for the list_channel_bookmarks tool.

type ListCustomEmojiArgs

type ListCustomEmojiArgs struct {
	Page    int `json:"page,omitempty" jsonschema:"Page number for pagination (default: 0),minimum=0"`
	PerPage int `json:"per_page,omitempty" jsonschema:"Number of emoji per page (default: 50, max: 200),minimum=1,maximum=200"`
}

ListCustomEmojiArgs represents arguments for the list_custom_emoji tool.

type ListGroupsArgs

type ListGroupsArgs struct {
	Query   string `json:"query,omitempty" jsonschema:"Optional search term to filter groups by name"`
	Page    int    `json:"page,omitempty" jsonschema:"Page number for pagination (default: 0),minimum=0"`
	PerPage int    `json:"per_page,omitempty" jsonschema:"Groups per page (default: 60, max: 200),minimum=1,maximum=200"`
}

ListGroupsArgs represents arguments for the list_groups tool.

type ListIncomingWebhooksArgs

type ListIncomingWebhooksArgs struct {
	Page    int `json:"page,omitempty" jsonschema:"Page number for pagination (default: 0),minimum=0"`
	PerPage int `json:"per_page,omitempty" jsonschema:"Webhooks per page (default: 50, max: 200),minimum=1,maximum=200"`
}

ListIncomingWebhooksArgs represents arguments for the list_incoming_webhooks tool.

type ListOutgoingWebhooksArgs

type ListOutgoingWebhooksArgs struct {
	TeamID    string `json:"team_id,omitempty" jsonschema:"Optional team ID to scope the webhooks,maxLength=26"`
	ChannelID string `json:"channel_id,omitempty" jsonschema:"Optional channel ID to scope the webhooks,maxLength=26"`
	Page      int    `json:"page,omitempty" jsonschema:"Page number for pagination (default: 0),minimum=0"`
	PerPage   int    `json:"per_page,omitempty" jsonschema:"Webhooks per page (default: 50, max: 200),minimum=1,maximum=200"`
}

ListOutgoingWebhooksArgs represents arguments for the list_outgoing_webhooks tool.

type ListPinnedPostsArgs

type ListPinnedPostsArgs struct {
	ChannelID string `json:"channel_id" jsonschema:"The ID of the channel,minLength=26,maxLength=26"`
}

ListPinnedPostsArgs represents arguments for the list_pinned_posts tool.

type ListSavedPostsArgs

type ListSavedPostsArgs struct {
	ChannelID string `json:"channel_id,omitempty" jsonschema:"Optional channel ID to scope saved posts to one channel,maxLength=26"`
	TeamID    string `json:"team_id,omitempty" jsonschema:"Optional team ID to scope saved posts to one team,maxLength=26"`
	Page      int    `json:"page,omitempty" jsonschema:"Page number for pagination (default: 0),minimum=0"`
	PerPage   int    `json:"per_page,omitempty" jsonschema:"Number of posts per page (default: 30, max: 100),minimum=1,maximum=100"`
}

ListSavedPostsArgs represents arguments for the list_saved_posts tool.

type ListScheduledPostsArgs

type ListScheduledPostsArgs struct {
	TeamID string `json:"team_id" jsonschema:"The team whose pending scheduled posts to list,minLength=26,maxLength=26"`
}

ListScheduledPostsArgs represents arguments for the list_scheduled_posts tool.

type ListSidebarCategoriesArgs

type ListSidebarCategoriesArgs struct {
	TeamID string `json:"team_id" jsonschema:"The team whose sidebar categories to list,minLength=26,maxLength=26"`
}

ListSidebarCategoriesArgs represents arguments for the list_sidebar_categories tool.

type ListTeamChannelsArgs

type ListTeamChannelsArgs struct {
	TeamID  string `json:"team_id" jsonschema:"The team whose channels to list,minLength=26,maxLength=26"`
	Page    int    `json:"page,omitempty" jsonschema:"Page number for pagination (default: 0),minimum=0"`
	PerPage int    `json:"per_page,omitempty" jsonschema:"Number of channels per page (default: 60, max: 200),minimum=1,maximum=200"`
}

ListTeamChannelsArgs represents arguments for the list_team_channels tool.

type MCPTool

type MCPTool struct {
	Name        string
	Description string
	Schema      *jsonschema.Schema
	Resolver    MCPToolResolver

	// Available, when set, gates the tool's visibility: it is evaluated on each
	// tools/list request and the tool is hidden when it returns false. Nil means
	// always available.
	Available func() bool
}

MCPTool represents a tool specifically for MCP use with our custom context

type MCPToolContext

type MCPToolContext struct {
	Ctx        context.Context
	Client     *model.Client4
	AccessMode AccessMode
	BotUserID  string // User ID for AI-generated content tracking: Bot ID (embedded) or authenticated user ID (external servers)

	// UserID is the Mattermost user ID of the user the Client is authenticated as.
	// Empty when the auth provider cannot resolve an authenticated user.
	UserID string

	// MMServerURL is the Mattermost server base URL (same as API Client4 origin) for resolving hook keys and firing callbacks.
	MMServerURL        string
	BeforeHookResolver auth.BeforeHookResolver
	ToolHooks          map[string]ToolHookConfig
}

MCPToolContext provides MCP-specific functionality with the authenticated client.

type MCPToolResolver

type MCPToolResolver func(*MCPToolContext, llm.ToolArgumentGetter) (string, error)

MCPToolResolver defines the signature for MCP tool resolvers

type MarkChannelReadArgs

type MarkChannelReadArgs struct {
	ChannelID string `json:"channel_id" jsonschema:"The channel to mark viewed/read,minLength=26,maxLength=26"`
}

MarkChannelReadArgs represents arguments for the mark_channel_read tool.

type MarkChannelsViewedArgs

type MarkChannelsViewedArgs struct {
	ChannelIDs []string `json:"channel_ids" jsonschema:"The channels to mark viewed (bulk)"`
}

MarkChannelsViewedArgs represents arguments for the mark_channels_viewed tool.

type MarkPostUnreadArgs

type MarkPostUnreadArgs struct {
	PostID string `json:"post_id" jsonschema:"Mark the channel unread starting at this post,minLength=26,maxLength=26"`
}

MarkPostUnreadArgs represents arguments for the mark_post_unread tool.

type MattermostToolProvider

type MattermostToolProvider struct {
	// contains filtered or unexported fields
}

MattermostToolProvider provides Mattermost tools following the mmtools pattern

func NewMattermostToolProvider

func NewMattermostToolProvider(authProvider auth.AuthenticationProvider, logger logger.Logger, config types.ServerConfig, accessMode AccessMode, searchService SemanticSearchService, fileContentService FileContentService) *MattermostToolProvider

NewMattermostToolProvider creates a new tool provider Now accepts a ServerConfig interface to avoid circular dependencies searchService is optional and can be nil if semantic search is not available

func (*MattermostToolProvider) ProvideTools

func (p *MattermostToolProvider) ProvideTools(mcpServer *mcp.Server)

ProvideTools registers all available MCP tools with the server.

func (*MattermostToolProvider) ToolNames

func (p *MattermostToolProvider) ToolNames() []string

ToolNames returns the names of the tools this provider will register.

type MembershipChangedConfig

type MembershipChangedConfig struct {
	ChannelID string `json:"channel_id"`
	Action    string `json:"action,omitempty"`
}

MembershipChangedConfig holds trigger config for the membership_changed trigger type.

type MessagePostedConfig

type MessagePostedConfig struct {
	ChannelID            string `json:"channel_id"`
	IncludeThreadReplies bool   `json:"include_thread_replies,omitempty"`
}

MessagePostedConfig holds trigger config for the message_posted trigger type.

type PinPostArgs

type PinPostArgs struct {
	PostID string `json:"post_id" jsonschema:"The ID of the post to pin,minLength=26,maxLength=26"`
}

PinPostArgs represents arguments for the pin_post tool.

type ReadChannelArgs

type ReadChannelArgs struct {
	ChannelID string `json:"channel_id" jsonschema:"The ID of the channel to read from,minLength=26,maxLength=26"`
	Limit     int    `json:"limit,omitempty" jsonschema:"Number of posts to retrieve (default: 20, max: 100),minimum=1,maximum=100"`
	Since     string `json:"since,omitempty" jsonschema:"Only get posts since this timestamp (ISO 8601 format),format=date-time"`
	Before    string `` /* 165-byte string literal not displayed */
	After     string `` /* 164-byte string literal not displayed */
	Page      int    `json:"page,omitempty" jsonschema:"Page number for pagination (default: 0),minimum=0"`
}

ReadChannelArgs represents arguments for the read_channel tool

type ReadFileArgs

type ReadFileArgs struct {
	FileID string `` /* 133-byte string literal not displayed */
	Offset int    `` /* 167-byte string literal not displayed */
	Limit  int    `json:"limit,omitempty" jsonschema:"Maximum number of characters to return (default 6000, capped at 20000)."`
}

ReadFileArgs represents arguments for the read_file tool.

type ReadPostArgs

type ReadPostArgs struct {
	PostID        string `json:"post_id" jsonschema:"The ID of the post to read,minLength=26,maxLength=26"`
	IncludeThread *bool  `` /* 139-byte string literal not displayed */
}

ReadPostArgs represents arguments for the read_post tool

type RemoveChannelMemberArgs

type RemoveChannelMemberArgs struct {
	ChannelID string `json:"channel_id" jsonschema:"The channel,minLength=26,maxLength=26"`
	UserID    string `json:"user_id" jsonschema:"The user to remove,minLength=26,maxLength=26"`
}

RemoveChannelMemberArgs represents arguments for the remove_channel_member tool.

type RemoveReactionArgs

type RemoveReactionArgs struct {
	PostID    string `json:"post_id" jsonschema:"The ID of the post to remove your reaction from,minLength=26,maxLength=26"`
	EmojiName string `json:"emoji_name" jsonschema:"The emoji name without colons (e.g. thumbsup),minLength=1"`
}

RemoveReactionArgs represents arguments for the remove_reaction tool.

type RemoveTeamMemberArgs

type RemoveTeamMemberArgs struct {
	TeamID string `json:"team_id" jsonschema:"The team,minLength=26,maxLength=26"`
	UserID string `json:"user_id" jsonschema:"The user to remove,minLength=26,maxLength=26"`
}

RemoveTeamMemberArgs represents arguments for the remove_team_member tool.

type RestoreChannelArgs

type RestoreChannelArgs struct {
	ChannelID string `json:"channel_id" jsonschema:"The archived channel to restore,minLength=26,maxLength=26"`
}

RestoreChannelArgs represents arguments for the restore_channel tool.

type SavePostArgs

type SavePostArgs struct {
	PostID string `json:"post_id" jsonschema:"The ID of the post to save (flag) for yourself,minLength=26,maxLength=26"`
}

SavePostArgs represents arguments for the save_post tool.

type ScheduleConfig

type ScheduleConfig struct {
	ChannelID string `json:"channel_id"`
	Interval  string `json:"interval" jsonschema:"Go duration string, minimum 5m. Examples: 1h (hourly) 24h (daily) 168h (weekly)"`
	StartAt   int64  `` /* 160-byte string literal not displayed */
}

ScheduleConfig holds trigger config for the schedule trigger type.

type SearchChannelsArgs

type SearchChannelsArgs struct {
	Term     string `json:"term" jsonschema:"Search term to match against channel names,minLength=1,maxLength=64"`
	TeamID   string `json:"team_id,omitempty" jsonschema:"Optional team ID; if provided, search is scoped to that team,maxLength=26"`
	Public   bool   `json:"public,omitempty" jsonschema:"Only public channels (team-scoped search only)"`
	Private  bool   `json:"private,omitempty" jsonschema:"Only private channels (team-scoped search only)"`
	Archived bool   `json:"archived,omitempty" jsonschema:"Only archived channels (team-scoped search only)"`
}

SearchChannelsArgs represents arguments for the search_channels tool.

type SearchCustomEmojiArgs

type SearchCustomEmojiArgs struct {
	Term string `json:"term" jsonschema:"Search term to match against custom emoji names,minLength=1,maxLength=64"`
}

SearchCustomEmojiArgs represents arguments for the search_custom_emoji tool.

type SearchFilesArgs

type SearchFilesArgs struct {
	Terms  string `json:"terms" jsonschema:"Search terms to match against file names/content,minLength=1,maxLength=4000"`
	TeamID string `json:"team_id" jsonschema:"The team to search within,minLength=26,maxLength=26"`
}

SearchFilesArgs represents arguments for the search_files tool.

type SearchTeamsArgs

type SearchTeamsArgs struct {
	Term string `json:"term" jsonschema:"Search term to match team name or display name,minLength=1,maxLength=64"`
}

SearchTeamsArgs represents arguments for the search_teams tool.

type SearchUsersArgs

type SearchUsersArgs struct {
	Term  string `json:"term" jsonschema:"Search term (username, email, first name, or last name),minLength=1,maxLength=64"`
	Limit int    `json:"limit,omitempty" jsonschema:"Maximum number of results to return (default: 20, max: 100),minimum=1,maximum=100"`
}

SearchUsersArgs represents arguments for the search_users tool.

type SearchUsersInChannelArgs

type SearchUsersInChannelArgs struct {
	Term      string `json:"term" jsonschema:"Search term,minLength=1,maxLength=64"`
	ChannelID string `json:"channel_id" jsonschema:"The channel,minLength=26,maxLength=26"`
	NotIn     bool   `json:"not_in,omitempty" jsonschema:"If true, search users NOT in the channel instead of in it"`
	TeamID    string `json:"team_id,omitempty" jsonschema:"Team ID (required when not_in is true to scope candidates),maxLength=26"`
}

SearchUsersInChannelArgs represents arguments for the search_users_in_channel tool.

type SearchUsersInTeamArgs

type SearchUsersInTeamArgs struct {
	Term   string `json:"term" jsonschema:"Search term,minLength=1,maxLength=64"`
	TeamID string `json:"team_id" jsonschema:"The team,minLength=26,maxLength=26"`
	NotIn  bool   `json:"not_in,omitempty" jsonschema:"If true, search users NOT in the team instead of in it"`
}

SearchUsersInTeamArgs represents arguments for the search_users_in_team tool.

type SemanticSearchService

type SemanticSearchService interface {
	Enabled() bool
	Search(ctx context.Context, query string, opts search.Options) ([]search.RAGResult, error)
}

SemanticSearchService provides semantic search capabilities for the MCP server. *search.Search implements this interface directly for embedded servers. HTTPSemanticSearchService implements it for external servers via HTTP callbacks.

type SendDMActionConfig

type SendDMActionConfig struct {
	UserID  string `json:"user_id"`
	Body    string `json:"body"`
	AsBotID string `json:"as_bot_id"`
}

SendDMActionConfig holds config for the send_dm action type.

type SendMessageActionConfig

type SendMessageActionConfig struct {
	ChannelID     string `json:"channel_id"`
	ReplyToPostID string `json:"reply_to_post_id,omitempty"`
	AsBotID       string `json:"as_bot_id,omitempty"`
	Body          string `json:"body"`
}

SendMessageActionConfig holds config for the send_message action type.

type SetChannelFavoriteArgs

type SetChannelFavoriteArgs struct {
	ChannelID string `json:"channel_id" jsonschema:"The channel,minLength=26,maxLength=26"`
	Favorite  bool   `json:"favorite" jsonschema:"true to favorite the channel, false to unfavorite"`
}

SetChannelFavoriteArgs represents arguments for the set_channel_favorite tool.

type SetChannelMuteArgs

type SetChannelMuteArgs struct {
	ChannelID string `json:"channel_id" jsonschema:"The channel,minLength=26,maxLength=26"`
	Muted     bool   `json:"muted" jsonschema:"true to mute the channel for yourself, false to unmute"`
}

SetChannelMuteArgs represents arguments for the set_channel_mute tool.

type SetDndArgs

type SetDndArgs struct {
	EndTime string `` /* 140-byte string literal not displayed */
}

SetDndArgs represents arguments for the set_dnd tool.

type SetPostReminderArgs

type SetPostReminderArgs struct {
	PostID   string `json:"post_id" jsonschema:"The ID of the post to be reminded about,minLength=26,maxLength=26"`
	RemindAt string `json:"remind_at" jsonschema:"When to be reminded (ISO 8601 / RFC3339 timestamp, must be in the future),format=date-time"`
}

SetPostReminderArgs represents arguments for the set_post_reminder tool.

type SetStatusArgs

type SetStatusArgs struct {
	Status string `json:"status" jsonschema:"Your presence status,enum=online,enum=away,enum=offline,enum=dnd"`
}

SetStatusArgs represents arguments for the set_status tool.

type SetThreadFollowArgs

type SetThreadFollowArgs struct {
	TeamID   string `json:"team_id" jsonschema:"The team the thread belongs to,minLength=26,maxLength=26"`
	ThreadID string `json:"thread_id" jsonschema:"The root post ID of the thread,minLength=26,maxLength=26"`
	Follow   bool   `json:"follow" jsonschema:"true to follow the thread, false to unfollow"`
}

SetThreadFollowArgs represents arguments for the set_thread_follow tool.

type ToolHookConfig

type ToolHookConfig struct {
	BeforeHookKey string `json:"before_hook_key,omitempty"`
}

ToolHookConfig holds an optional opaque before-hook key for a tool.

type ToolProvider

type ToolProvider interface {
	ProvideTools(*mcp.Server)
}

type UnpinPostArgs

type UnpinPostArgs struct {
	PostID string `json:"post_id" jsonschema:"The ID of the post to unpin,minLength=26,maxLength=26"`
}

UnpinPostArgs represents arguments for the unpin_post tool.

type UpdateAutomationArgs

type UpdateAutomationArgs struct {
	AutomationID string             `json:"automation_id" jsonschema:"The ID of the automation to update,minLength=26,maxLength=26"`
	Name         string             `json:"name" jsonschema:"The name of the automation,minLength=1"`
	Enabled      bool               `json:"enabled" jsonschema:"Whether the automation is enabled"`
	Trigger      AutomationTrigger  `json:"trigger" jsonschema:"Set exactly one trigger type"`
	Actions      []AutomationAction `json:"actions" jsonschema:"Ordered list of actions to perform when triggered"`
}

UpdateAutomationArgs represents arguments for the update_automation tool.

type UpdateChannelArgs

type UpdateChannelArgs struct {
	ChannelID   string  `json:"channel_id" jsonschema:"The channel to update,minLength=26,maxLength=26"`
	DisplayName *string `json:"display_name,omitempty" jsonschema:"New display name (optional)"`
	Name        *string `json:"name,omitempty" jsonschema:"New URL name (optional)"`
	Header      *string `json:"header,omitempty" jsonschema:"New channel header (optional)"`
	Purpose     *string `json:"purpose,omitempty" jsonschema:"New channel purpose (optional)"`
}

UpdateChannelArgs represents arguments for the update_channel tool.

type UpdateChannelBookmarkArgs

type UpdateChannelBookmarkArgs struct {
	ChannelID   string  `json:"channel_id" jsonschema:"The channel the bookmark belongs to,minLength=26,maxLength=26"`
	BookmarkID  string  `json:"bookmark_id" jsonschema:"The bookmark to update,minLength=26,maxLength=26"`
	DisplayName *string `json:"display_name,omitempty" jsonschema:"New display name (optional)"`
	LinkURL     *string `json:"link_url,omitempty" jsonschema:"New link URL (optional)"`
	Emoji       *string `json:"emoji,omitempty" jsonschema:"New emoji (optional)"`
}

UpdateChannelBookmarkArgs represents arguments for the update_channel_bookmark tool.

type UpdateChannelMemberRolesArgs

type UpdateChannelMemberRolesArgs struct {
	ChannelID string `json:"channel_id" jsonschema:"The channel,minLength=26,maxLength=26"`
	UserID    string `json:"user_id" jsonschema:"The member to promote/demote,minLength=26,maxLength=26"`
	Admin     bool   `json:"admin" jsonschema:"true to make the member a channel admin, false for a regular member"`
}

UpdateChannelMemberRolesArgs represents arguments for the update_channel_member_roles tool.

type UpdateChannelNotifyPropsArgs

type UpdateChannelNotifyPropsArgs struct {
	ChannelID  string `json:"channel_id" jsonschema:"The channel,minLength=26,maxLength=26"`
	Desktop    string `json:"desktop,omitempty" jsonschema:"Desktop notification level,enum=default,enum=all,enum=mention,enum=none"`
	Push       string `json:"push,omitempty" jsonschema:"Mobile push notification level,enum=default,enum=all,enum=mention,enum=none"`
	MarkUnread string `json:"mark_unread,omitempty" jsonschema:"Unread level,enum=all,enum=mention"`
}

UpdateChannelNotifyPropsArgs represents arguments for the update_channel_notify_props tool.

type UpdatePostArgs

type UpdatePostArgs struct {
	PostID  string `json:"post_id" jsonschema:"The ID of the post to edit,minLength=26,maxLength=26"`
	Message string `json:"message" jsonschema:"The new message content,minLength=1"`
}

UpdatePostArgs represents arguments for the update_post tool.

type UpdateScheduledPostArgs

type UpdateScheduledPostArgs struct {
	ScheduledPostID string `json:"scheduled_post_id" jsonschema:"The ID of the pending scheduled post,minLength=26,maxLength=26"`
	ChannelID       string `json:"channel_id" jsonschema:"The ID of the channel the scheduled post belongs to,minLength=26,maxLength=26"`
	Message         string `json:"message,omitempty" jsonschema:"New message content (optional)"`
	ScheduledAt     string `json:"scheduled_at,omitempty" jsonschema:"New send time (ISO 8601 / RFC3339 timestamp, optional),format=date-time"`
}

UpdateScheduledPostArgs represents arguments for the update_scheduled_post tool. root_id is intentionally absent: the server restores it from the existing record (RestoreNonUpdatableFields), so a scheduled post's thread cannot change.

type UpdateTeamArgs

type UpdateTeamArgs struct {
	TeamID          string  `json:"team_id" jsonschema:"The team to update,minLength=26,maxLength=26"`
	DisplayName     *string `json:"display_name,omitempty" jsonschema:"New display name (optional)"`
	Description     *string `json:"description,omitempty" jsonschema:"New description (optional)"`
	AllowOpenInvite *bool   `json:"allow_open_invite,omitempty" jsonschema:"Whether anyone can join without an invite (optional)"`
}

UpdateTeamArgs represents arguments for the update_team tool.

type UpdateTeamMemberRolesArgs

type UpdateTeamMemberRolesArgs struct {
	TeamID string `json:"team_id" jsonschema:"The team,minLength=26,maxLength=26"`
	UserID string `json:"user_id" jsonschema:"The member to promote/demote,minLength=26,maxLength=26"`
	Admin  bool   `json:"admin" jsonschema:"true to make the member a team admin, false for a regular member"`
}

UpdateTeamMemberRolesArgs represents arguments for the update_team_member_roles tool.

type UpdateUserArgs

type UpdateUserArgs struct {
	UserID    string  `json:"user_id,omitempty" jsonschema:"The user to update; omit for yourself,maxLength=26"`
	Nickname  *string `json:"nickname,omitempty" jsonschema:"New nickname (optional)"`
	FirstName *string `json:"first_name,omitempty" jsonschema:"New first name (optional)"`
	LastName  *string `json:"last_name,omitempty" jsonschema:"New last name (optional)"`
	Position  *string `json:"position,omitempty" jsonschema:"New position/title (optional)"`
}

UpdateUserArgs represents arguments for the update_user tool.

type UploadFileArgs

type UploadFileArgs struct {
	ChannelID string `json:"channel_id" jsonschema:"The channel to upload the file to,minLength=26,maxLength=26"`
	Path      string `json:"path" access:"local" jsonschema:"Local file path or URL to upload"`
}

UploadFileArgs represents arguments for the upload_file tool.

type UserJoinedTeamConfig

type UserJoinedTeamConfig struct {
	TeamID   string `json:"team_id"`
	UserType string `json:"user_type,omitempty"`
}

UserJoinedTeamConfig holds trigger config for the user_joined_team trigger type.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL