Skip to main content
Glama
typing.ts•884 B
import { z } from 'zod'; import type { ToolHandler } from '../tool-types.js'; import { Routes } from 'discord-api-types/v10'; import { REST } from '@discordjs/rest'; import { DiscordClient } from '../discord.js'; import { Policy } from '../policy.js'; export function triggerTypingTool(dc: DiscordClient, policy: Policy): ToolHandler { const input = z.object({ channel_id: z.string() }); return { name: 'discord_trigger_typing', description: 'Trigger typing indicator in a channel.', inputSchema: input, async *handler({ input }: { input: any }){ const { channel_id } = input as any; if (!policy.allowChannel(channel_id)) throw new Error('Channel not allowed by policy'); const rest = (dc as any)['rest'] as REST; await rest.post(Routes.channelTyping(channel_id), {}); yield { content: [{ type: 'text', text: 'ok' }] }; } }; }

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/GustyCube/discord-mcp'

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