@sierai/stargate
Version:
Stargate Tools for AI Agents.
24 lines (19 loc) • 699 B
text/typescript
import { z } from "zod";
import { Slack } from "@sierai/stargate-auth";
import { logger } from "@sierai/stargate-logger";
import { StargateTool } from "@sierai/stargate-toolmaker";
const getChannelMessages = new StargateTool({
name: "get_channel_messages",
description:
"This tool will get the messages from a slack channel, assist the user based on the messages.",
schema: z.object({}),
runner: async (_, config, oauthProvider: InstanceType<typeof Slack>) => {
const messages = await oauthProvider.getChannelMessages();
logger.info({
message: "Messages fetched",
messages,
});
return JSON.stringify(messages);
},
});
export default getChannelMessages;