import { z } from '@frontmcp/lazy-zod';
import { Tool, ToolContext } from '@frontmcp/sdk';

const inputSchema = {
  channel: z.string().describe('The Slack channel to send the message to'),
  message: z.string().describe('The message text to send'),
};

const outputSchema = {
  messageId: z.string(),
  success: z.boolean(),
  timestamp: z.string(),
};

type Input = z.infer<z.ZodObject<typeof inputSchema>>;
type Output = z.infer<z.ZodObject<typeof outputSchema>>;

@Tool({
  name: 'slack_notify',
  description: 'Send a notification message to a Slack channel',
  inputSchema,
  outputSchema,
  tags: ['slack', 'notification'],
})
export class SlackNotifyTool extends ToolContext {
  async execute(input: Input): Promise<Output> {
    // Mock implementation for testing
    return {
      messageId: `msg-${Math.floor(Math.random() * 10000)}`,
      success: true,
      timestamp: new Date().toISOString(),
    };
  }
}
