Skip to main content
Glama

MCP Evolution API

by aiteks-ltda
index.ts2.07 kB
import type { ToolRegistration } from "@/types"; import { evolutionApi } from "@/utils/evolutionApi"; import { makeJsonSchema } from "@/utils/makeJsonSchema"; import { setEvolutionSettingsSchema, type SetEvolutionSettingsSchema } from "./schema"; export async function setEvolutionSettings(args: SetEvolutionSettingsSchema) { const { instanceName, rejectCall, msgCall, groupsIgnore, alwaysOnline, readMessages, syncFullHistory, readStatus } = args; const result = await evolutionApi.setSettings(instanceName, { rejectCall, msgCall, groupsIgnore, alwaysOnline, readMessages, syncFullHistory, readStatus }); return result; } export const setEvolutionSettingsTool: ToolRegistration<SetEvolutionSettingsSchema> = { name: "set_evolution_settings", description: "Configure behavior settings for a WhatsApp instance such as call handling, message receipts, and online status", inputSchema: makeJsonSchema(setEvolutionSettingsSchema), handler: async (args: SetEvolutionSettingsSchema) => { try { const result = await setEvolutionSettings(args); return { content: [ { type: "text", text: `✅ Settings for ${args.instanceName} have been updated: • ${args.alwaysOnline ? '✓' : '✗'} Always online • ${args.readMessages ? '✓' : '✗'} Read receipts • ${args.readStatus ? '✓' : '✗'} Read status • ${args.rejectCall ? '✓' : '✗'} Auto-reject calls • ${args.groupsIgnore ? '✓' : '✗'} Ignore groups • ${args.syncFullHistory ? '✓' : '✗'} Sync full history ${args.msgCall ? '• Call rejection message: "' + args.msgCall + '"' : ''}` } ] }; } catch (error) { console.error("Error in setEvolutionSettingsTool handler:", error); return { content: [ { type: "text", text: `❌ Failed to set settings: ${error instanceof Error ? error.message : String(error)}` } ] }; } }, };

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/aiteks-ltda/mcp-evolution-whatsapp-api'

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