Skip to main content
Glama
abutbul

Gatherings MCP Server

by abutbul

remove_member

Remove a member from a gathering to update participant lists and maintain accurate expense tracking for social events.

Instructions

Remove a member from a gathering

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
gathering_idYesID of the gathering
member_nameYesName of the member to remove

Implementation Reference

  • MCP tool handler for 'remove_member': validates input arguments and appends the corresponding CLI command to be executed via child_process.execAsync.
    case 'remove_member':
      if (!isMemberArgs(args)) {
        throw new McpError(ErrorCode.InvalidParams, 'Invalid remove_member arguments');
      }
      command += ` remove-member "${args.gathering_id}" "${args.member_name}"`;
      break;
  • Input schema and registration of the 'remove_member' tool in the MCP ListTools response.
    {
      name: 'remove_member',
      description: 'Remove a member from a gathering',
      inputSchema: {
        type: 'object',
        properties: {
          gathering_id: {
            type: 'string',
            description: 'ID of the gathering',
          },
          member_name: {
            type: 'string',
            description: 'Name of the member to remove',
          },
        },
        required: ['gathering_id', 'member_name'],
      },
    },
  • gatherings.py:440-440 (registration)
    Registers the handle_remove_member function for the 'remove-member' CLI subcommand in the handlers dictionary.
    "remove-member": handle_remove_member
  • CLI handler for 'remove-member': invokes service.remove_member and formats success/error output in JSON or human-readable format.
    def handle_remove_member(service, args):
        """Handle the remove-member command."""
        try:
            gathering = service.remove_member(args.gathering_id, args.member_name)
            result = {
                "success": True,
                "removed": {
                    "member_name": args.member_name,
                    "gathering_id": gathering.id,
                    "total_members": gathering.total_members
                }
            }
            if args.json:
                print(json.dumps(result))
            else:
                print(f"Removed member '{args.member_name}' from gathering '{gathering.id}'")
                print(f"Total members: {gathering.total_members}")
            return True
        except ValueError as e:
            error = {"success": False, "error": str(e)}
            if args.json:
                print(json.dumps(error))
            else:
                print(f"Error: {e}")
            return False
  • Core database implementation: validates gathering open status, member existence, no expenses/payments, then deletes member and decrements total_members.
    def remove_member(self, gathering_id: str, member_name: str) -> None:
        """
        Remove a member from a gathering.
        
        Args:
            gathering_id: The ID of the gathering
            member_name: The name of the member
            
        Raises:
            ValueError: If the gathering is closed, the member doesn't exist, 
                        or the member has expenses/payments
        """
        session = self.Session()
        try:
            # Get the gathering
            gathering = session.query(Gathering).filter_by(id=gathering_id).first()
            if not gathering:
                raise ValueError(f"Gathering '{gathering_id}' not found")
            
            # Check if gathering is open
            if gathering.status == GatheringStatus.CLOSED:
                raise ValueError(f"Cannot remove member from closed gathering '{gathering_id}'")
            
            # Get the member to remove
            member = session.query(Member).filter_by(gathering_id=gathering_id, name=member_name).first()
            if not member:
                raise ValueError(f"Member '{member_name}' not found in gathering '{gathering_id}'")
            
            # Check if member has expenses
            expenses_count = session.query(Expense).filter_by(member_id=member.id).count()
            if expenses_count > 0:
                raise ValueError(f"Cannot remove member '{member_name}' who has recorded expenses")
            
            # Check if member has payments
            payments_count = session.query(Payment).filter_by(member_id=member.id).count()
            if payments_count > 0:
                raise ValueError(f"Cannot remove member '{member_name}' who has recorded payments")
            
            # Delete the member
            session.delete(member)
            
            # Update the total members count
            gathering.total_members -= 1
            
            session.commit()
            
        except Exception as e:
            session.rollback()
            raise e
        finally:
            session.close()
Behavior2/5

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

No annotations are provided, so the description carries the full burden. It states the action ('Remove') but lacks critical behavioral details: whether this is reversible, if it requires specific permissions, what happens to associated data (e.g., expenses), or error conditions. For a mutation tool with zero annotation coverage, this is a significant gap.

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 a single, efficient sentence with zero waste—it directly states the tool's purpose without unnecessary words. It's appropriately sized and front-loaded, making it easy for an agent to parse quickly.

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 complexity (a mutation tool removing members), lack of annotations, and no output schema, the description is incomplete. It doesn't cover behavioral aspects like side effects, permissions, or return values, which are crucial for safe and effective use by an AI agent.

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%, with both parameters ('gathering_id' and 'member_name') clearly documented in the schema. The description adds no additional meaning beyond implying these parameters are needed, so it meets the baseline of 3 where the schema does the heavy lifting.

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 clearly states the action ('Remove') and target ('a member from a gathering'), providing a specific verb+resource combination. However, it doesn't differentiate from sibling tools like 'rename_member' or 'delete_gathering', which also involve member or gathering modifications, so it lacks sibling differentiation for a perfect score.

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?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., member must exist), exclusions, or compare to siblings like 'rename_member' or 'delete_gathering', leaving the agent without contextual usage cues.

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/abutbul/gatherings-mcp'

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