schemas.ts•3.15 kB
import { z } from 'zod';
/**
* Schema for conversations_history tool
* Retrieves message history from a Slack channel, DM, or thread
*/
export const ConversationsHistorySchema = z.object({
accessToken: z.string().describe("Slack OAuth token (xoxp-... or xoxb-...)"),
channel_id: z.string().describe("Channel ID (e.g., C1234567890), channel name (#general), or DM (@username)"),
limit: z.union([z.string(), z.number()]).optional().describe("Time range (1d, 7d, 1m, 90d) or message count (e.g., 100)"),
cursor: z.string().optional().describe("Pagination cursor from previous response"),
include_activity_messages: z.boolean().optional().describe("Include join/leave system messages (default: false)")
});
/**
* Schema for conversations_replies tool
* Fetches thread messages by channel and thread timestamp
*/
export const ConversationsRepliesSchema = z.object({
accessToken: z.string().describe("Slack OAuth token (xoxp-... or xoxb-...)"),
channel_id: z.string().describe("Channel ID (e.g., C1234567890), channel name (#general), or DM (@username)"),
thread_ts: z.string().describe("Message timestamp in format 1234567890.123456"),
limit: z.union([z.string(), z.number()]).optional().describe("Time range (1d, 7d, 1m, 90d) or message count (e.g., 100)"),
cursor: z.string().optional().describe("Pagination cursor from previous response"),
include_activity_messages: z.boolean().optional().describe("Include join/leave system messages (default: false)")
});
/**
* Schema for conversations_add_message tool
* Posts messages to channels, threads, or DMs
* Note: Disabled by default for safety - requires configuration to enable
*/
export const ConversationsAddMessageSchema = z.object({
accessToken: z.string().describe("Slack OAuth token (xoxp-... or xoxb-...) with chat:write scope"),
channel_id: z.string().describe("Target channel ID, name (#general), or DM (@username)"),
thread_ts: z.string().optional().describe("Thread timestamp; omit to post to channel directly"),
payload: z.string().describe("Message content to post"),
content_type: z.enum(['text/markdown', 'text/plain']).optional().describe("Content format (default: text/markdown)")
});
/**
* Schema for channels_list tool
* Lists workspace channels with optional sorting
*/
export const ChannelsListSchema = z.object({
accessToken: z.string().describe("Slack OAuth token (xoxp-... or xoxb-...)"),
channel_types: z.string().describe("Comma-separated channel types: mpim, im, public_channel, private_channel"),
sort: z.enum(['popularity']).optional().describe("Sort by member count (popularity)"),
limit: z.number().optional().describe("Number of results (max: 999, default: 100)"),
cursor: z.string().optional().describe("Pagination cursor from previous response")
});
// Type exports for TypeScript
export type ConversationsHistoryInput = z.infer<typeof ConversationsHistorySchema>;
export type ConversationsRepliesInput = z.infer<typeof ConversationsRepliesSchema>;
export type ConversationsAddMessageInput = z.infer<typeof ConversationsAddMessageSchema>;
export type ChannelsListInput = z.infer<typeof ChannelsListSchema>;