Skip to main content
Glama
grammy-mcp
by louietyj

banChatMember

Destructive

Bans a user from a group, supergroup, or channel and blocks them from rejoining via invite links until unbanned. Requires the bot to be an administrator with ban rights.

Instructions

Use this method to ban a user in a group, a supergroup or a channel. In the case of supergroups and channels, the user will not be able to return to the chat on their own using invite links, etc., unless unbanned first. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns True on success.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "chat_id": "<chat_id>",
      "user_id": "<user_id>"
    },
    "name": "banChatMember"
  }
}

Input Schema

NameRequiredDescriptionDefault
chat_idYesUnique identifier for the target group or username of the target supergroup or channel in the format `@username`
user_idYesUnique identifier of the target user
until_dateNoDate when the user will be unbanned; Unix time. If user is banned for more than 366 days or less than 30 seconds from the current time they are considered to be banned forever. Applied for supergroups and channels only.
revoke_messagesNoPass True to delete all messages from the chat for the user that is being removed. If False, the user will be able to see messages in the group that were sent before the user was removed. Always True for supergroups and channels.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.8/5.0
Behavior4/5

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

The annotations already declare destructive=true and openWorld=true, but the description adds useful behavioral context beyond them: the user cannot rejoin via invite links unless unbanned, admin rights are required, and the call returns True on success. It does not detail the interaction between until_date and revoke_messages, but the schema covers those parameters.

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

Conciseness5/5

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

The description is three sentences and front-loads the core action. Each sentence contributes useful information: scope, persistence behavior, authorization requirement, and return value. There is no unnecessary wording.

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

Completeness4/5

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

For a four-parameter destructive administrative action with rich annotations and full schema coverage, the description covers the essential behavioral and authorization context. The main remaining gap is explicit routing guidance versus sibling moderation tools, which is more of a usage-guideline issue.

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?

Schema description coverage is 100%, so the schema already documents all four parameters, including the special until_date and revoke_messages semantics. The description adds no additional parameter-level meaning beyond what the schema provides, making the baseline score appropriate.

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

Purpose4/5

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

The description states a specific verb and resource: ban a user in a group, supergroup, or channel. It does not explicitly distinguish this from related sibling tools like kickChatMember, unbanChatMember, or banChatSenderChat, so it falls short of a 5.

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

Usage Guidelines3/5

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

It gives an important prerequisite—the bot must be an administrator with appropriate rights—and notes that the ban persists unless the user is unbanned first. However, it does not explain when to choose this tool over alternatives such as kickChatMember, restrictChatMember, or unbanChatMember.

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

Deploy Server

Other Tools