Skip to main content
Glama
grok.ts972 B
import { GrokChatSchema, AuthConfig } from '../types.js'; import { TwitterClient } from '../twitter-client.js'; import { validateInput } from '../utils/validators.js'; // Define type for the validated parameters type GrokChatParams = { message: string; conversationId?: string; returnSearchResults: boolean; returnCitations: boolean; }; export class GrokTools { private client: TwitterClient; constructor() { this.client = new TwitterClient(); } /** * Chat with Grok */ async grokChat(authConfig: AuthConfig, args: unknown) { const params = validateInput<GrokChatParams>(GrokChatSchema, args); const response = await this.client.grokChat( authConfig, params.message, params.conversationId, params.returnSearchResults, params.returnCitations ); return { response: response.message, conversationId: response.conversationId, webResults: response.webResults }; } }

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/ryanmac/agent-twitter-client-mcp'

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