Skip to main content
Glama
billyfranklim1

mcp-evolution

Set Settings

set_settings

Update WhatsApp instance settings: control call rejection, group messages, online status, and message read preferences.

Instructions

Update settings for the pinned WhatsApp instance.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
rejectCallNoAutomatically reject incoming calls
msgCallNoAuto-reply message when rejecting calls
groupsIgnoreNoIgnore messages from groups
alwaysOnlineNoAlways appear online
readMessagesNoAutomatically mark messages as read
syncFullHistoryNoSync full message history on connect
readStatusNoAutomatically read status updates

Implementation Reference

  • Main handler function for the 'set_settings' tool. Defines registerSetSettings which registers the tool with server, builds a payload from optional args (rejectCall, msgCall, groupsIgnore, alwaysOnline, readMessages, syncFullHistory, readStatus), and POSTs to /settings/set/{instanceName}. Returns the API response or an McpError on failure.
    export function registerSetSettings(server: McpServer, client: EvolutionClient): void {
      server.registerTool(
        "set_settings",
        {
          title: "Set Settings",
          description: "Update settings for the pinned WhatsApp instance.",
          inputSchema: schema,
        },
        async (args) => {
          try {
            const payload: Record<string, unknown> = {};
            if (args.rejectCall !== undefined) payload["rejectCall"] = args.rejectCall;
            if (args.msgCall !== undefined) payload["msgCall"] = args.msgCall;
            if (args.groupsIgnore !== undefined) payload["groupsIgnore"] = args.groupsIgnore;
            if (args.alwaysOnline !== undefined) payload["alwaysOnline"] = args.alwaysOnline;
            if (args.readMessages !== undefined) payload["readMessages"] = args.readMessages;
            if (args.syncFullHistory !== undefined) payload["syncFullHistory"] = args.syncFullHistory;
            if (args.readStatus !== undefined) payload["readStatus"] = args.readStatus;
            const data = await client.post(`/settings/set/${client.instanceName}`, payload);
            return { content: [{ type: "text" as const, text: JSON.stringify(data, null, 2) }] };
          } catch (e) {
            if (e instanceof McpError) return { isError: true, content: [{ type: "text" as const, text: e.message }] };
            throw e;
          }
        }
      );
    }
  • Input schema for the 'set_settings' tool using Zod. Defines 7 optional fields: rejectCall (boolean), msgCall (string), groupsIgnore (boolean), alwaysOnline (boolean), readMessages (boolean), syncFullHistory (boolean), readStatus (boolean).
    const schema = {
      rejectCall: z.boolean().optional().describe("Automatically reject incoming calls"),
      msgCall: z.string().optional().describe("Auto-reply message when rejecting calls"),
      groupsIgnore: z.boolean().optional().describe("Ignore messages from groups"),
      alwaysOnline: z.boolean().optional().describe("Always appear online"),
      readMessages: z.boolean().optional().describe("Automatically mark messages as read"),
      syncFullHistory: z.boolean().optional().describe("Sync full message history on connect"),
      readStatus: z.boolean().optional().describe("Automatically read status updates"),
    };
  • Import of registerSetSettings from './set-settings.js' in the tools index file.
    import { registerSetSettings } from "./set-settings.js";
  • Registration call to registerSetSettings(server, client) inside registerAllTools, wiring the tool to the MCP server.
    registerSetSettings(server, client);
  • EvolutionClient helper class used internally by the set_settings handler. Provides the post() method (line 24) that sends HTTP requests with API key, and the instanceName getter (line 16) used to construct the endpoint URL.
    import { McpError, ErrorCode } from "@modelcontextprotocol/sdk/types.js";
    import type { Config } from "./config.js";
    
    export class EvolutionClient {
      private readonly baseUrl: string;
      private readonly apiKey: string;
      private readonly instance: string;
    
      constructor(config: Config) {
        // Strip trailing slash to keep URL building consistent
        this.baseUrl = config.EVOLUTION_API_URL.replace(/\/$/, "");
        this.apiKey = config.EVOLUTION_API_KEY;
        this.instance = config.EVOLUTION_INSTANCE;
      }
    
      get instanceName(): string {
        return this.instance;
      }
    
      async get<T = unknown>(path: string): Promise<T> {
        return this.request<T>("GET", path);
      }
    
      async post<T = unknown>(path: string, body: unknown): Promise<T> {
        return this.request<T>("POST", path, body);
      }
    
      async delete<T = unknown>(path: string, body?: unknown): Promise<T> {
        return this.request<T>("DELETE", path, body);
      }
    
      private async request<T>(method: string, path: string, body?: unknown): Promise<T> {
        const url = `${this.baseUrl}${path}`;
        const headers: Record<string, string> = {
          apikey: this.apiKey,
          "Content-Type": "application/json",
        };
    
        const res = await fetch(url, {
          method,
          headers,
          body: body !== undefined ? JSON.stringify(body) : undefined,
        });
    
        const text = await res.text();
    
        if (!res.ok) {
          throw new McpError(
            ErrorCode.InternalError,
            `Evolution API error ${res.status}: ${text}`
          );
        }
    
        try {
          return JSON.parse(text) as T;
        } catch {
          return text as unknown as T;
        }
      }
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries full burden for behavioral disclosure. It only states 'Update settings' implying mutation, but lacks details on side effects, authorization needs, or whether changes are immediate. Many behavioral traits are missing.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single short sentence, making it concise and front-loaded. However, it could be slightly expanded to add context without losing conciseness.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool has 7 parameters and modifies settings, the description is too brief. It does not explain the scope of changes, persistence, or expected behavior, making it incomplete for effective use.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 100% coverage with descriptions for all 7 parameters. The description adds no additional meaning beyond the schema, so baseline score of 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool updates settings for the pinned WhatsApp instance, using a specific verb and resource. It is distinguishable from the sibling get_settings tool, which reads settings.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus alternatives. For instance, there is no mention of using get_settings for reading or any context on prerequisites or when not to use.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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/billyfranklim1/mcp-evolution'

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