Skip to main content
Glama

swit-message-create

Send messages to Swit channels with text content, attachments, and formatting options to communicate within team workspaces.

Instructions

Send message to channel

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
channel_idYes
contentNo
body_typeNoplain
assetsNo
attachmentsNo
external_asset_typeNo

Implementation Reference

  • The main handler function for 'swit-message-create' tool. Validates input arguments using MessageCreateArgsSchema and delegates to SwitClient.createMessage.
    export const handleMessageCreate = async (switClient: SwitClient, args: any) => { const validatedArgs = MessageCreateArgsSchema.parse(args); return await switClient.createMessage(validatedArgs); };
  • Zod schema defining the input arguments for the message create tool.
    export const MessageCreateArgsSchema = z.object({ channel_id: z.string(), content: z.string().optional(), body_type: z.enum(['plain', 'markdown']).default('plain').optional(), assets: z.array(z.any()).optional(), attachments: z.record(z.any()).optional(), external_asset_type: z.string().optional(), });
  • MCP tool definition including name, description, and input schema derived from MessageCreateArgsSchema.
    { name: 'swit-message-create', description: 'Send message to channel', inputSchema: zodToJsonSchema(MessageCreateArgsSchema), },
  • Factory function that registers the 'swit-message-create' handler along with other core handlers.
    export const coreHandlers = (switClient: SwitClient) => ({ 'swit-workspace-list': (args: any) => handleWorkspaceList(switClient, args), 'swit-channel-list': (args: any) => handleChannelList(switClient, args), 'swit-message-create': (args: any) => handleMessageCreate(switClient, args), 'swit-message-comment-create': (args: any) => handleMessageCommentCreate(switClient, args), 'swit-message-comment-list': (args: any) => handleMessageCommentList(switClient, args), 'swit-project-list': (args: any) => handleProjectList(switClient, args), });
  • src/index.ts:109-109 (registration)
    Final registration of coreHandlers (including swit-message-create) into the MCP toolHandlers dictionary.
    toolHandlers = { ...oauthHandlers(oauthWebServer), ...coreHandlers(switClient) };

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/TykanN/swit-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server