Skip to main content
Glama
abutbul

Gatherings MCP Server

by abutbul

close_gathering

End a social event tracking session to finalize expense calculations and settle balances between participants.

Instructions

Close a gathering

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
gathering_idYesID of the gathering to close

Implementation Reference

  • MCP tool schema definition including input schema for close_gathering
    {
      name: 'close_gathering',
      description: 'Close a gathering',
      inputSchema: {
        type: 'object',
        properties: {
          gathering_id: {
            type: 'string',
            description: 'ID of the gathering to close',
          },
        },
        required: ['gathering_id'],
      },
    },
  • MCP CallToolRequest handler for close_gathering: validates arguments and constructs CLI command to execute gatherings.py close
    case 'close_gathering':
      if (!isGatheringIdArg(args)) {
        throw new McpError(ErrorCode.InvalidParams, 'Invalid close_gathering arguments');
      }
      command += ` close "${args.gathering_id}"`;
      break;
  • CLI handler function for 'close' subcommand invoked by MCP server, calls service.close_gathering and formats output
    def handle_close(service, args):
        """Handle the close command."""
        try:
            gathering = service.close_gathering(args.gathering_id)
            result = {
                "success": True,
                "gathering": {
                    "id": gathering.id,
                    "status": gathering.status.value
                }
            }
            if args.json:
                print(json.dumps(result))
            else:
                print(f"Closed gathering: {gathering.id}")
                print(f"Status: {gathering.status.value}")
            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
  • GatheringService wrapper method that delegates close_gathering to DatabaseManager
    def close_gathering(self, gathering_id: str) -> Gathering:
        """
        Close a gathering.
        
        Args:
            gathering_id: The ID of the gathering
            
        Returns:
            The updated Gathering object
            
        Raises:
            ValueError: If the gathering doesn't exist or is already closed
        """
        return self.db_manager.close_gathering(gathering_id)
  • Core DatabaseManager implementation: fetches gathering, validates, updates status to CLOSED, commits transaction.
    def close_gathering(self, gathering_id: str) -> Gathering:
        """
        Close a gathering.
        
        Args:
            gathering_id: The ID of the gathering
            
        Returns:
            The updated Gathering object
            
        Raises:
            ValueError: If the gathering doesn't exist or is already closed
        """
        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 already closed
            if gathering.status == GatheringStatus.CLOSED:
                raise ValueError(f"Gathering '{gathering_id}' is already closed")
            
            # Close the gathering
            gathering.status = GatheringStatus.CLOSED
            
            session.commit()
            
            # Return a fresh copy of the gathering
            return self.get_gathering(gathering_id)
            
        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?

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the action ('close') but doesn't explain what 'close' entails (e.g., is it reversible, does it affect related data like expenses or members, are there permission requirements, or what the response looks like). This is a significant gap for a mutation tool with zero annotation coverage.

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 ('Close a gathering') with zero waste. It's appropriately sized for a simple tool and front-loaded with the core action, making it easy 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 of a mutation tool (closing a gathering) with no annotations and no output schema, the description is incomplete. It doesn't explain the behavior, consequences, or return values, leaving critical gaps for an agent to use the tool correctly in context with siblings like 'delete_gathering'.

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

Parameters4/5

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

Schema description coverage is 100%, so the input schema fully documents the 'gathering_id' parameter. The description doesn't add any parameter details beyond the schema, but with only one parameter and high coverage, the baseline is 3. It earns a 4 because the description is concise and doesn't create confusion, though it doesn't compensate for any gaps.

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

Purpose3/5

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

The description 'Close a gathering' states a clear verb ('close') and resource ('gathering'), but it's vague about what 'close' means operationally (e.g., finalizing, ending, archiving) and doesn't differentiate from siblings like 'delete_gathering' or 'show_gathering'. It avoids tautology by not restating the name/title, but lacks specificity.

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 such as 'delete_gathering' or 'show_gathering'. The description implies usage for closing gatherings but doesn't specify contexts, prerequisites, or exclusions, leaving the agent to infer based on sibling names alone.

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