list_gatherings
Retrieve a list of all social events tracked by the Gatherings MCP Server to monitor expenses and calculate reimbursements among participants.
Instructions
List all gatherings
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.ts:176-183 (registration)MCP tool registration including name 'list_gatherings', description, and empty input schema.{ name: 'list_gatherings', description: 'List all gatherings', inputSchema: { type: 'object', properties: {}, }, },
- src/index.ts:337-339 (handler)MCP CallToolRequest handler case for 'list_gatherings' that constructs command to execute 'python3 gatherings.py --json list'.case 'list_gatherings': command += ' list'; break;
- gatherings.py:284-315 (handler)CLI handler function for 'list' command: retrieves gatherings via service, formats and prints JSON or human-readable list.def handle_list(service, args): """Handle the list command.""" try: gatherings = service.list_gatherings() result = { "success": True, "gatherings": [ { "id": g.id, "status": g.status.value } for g in gatherings ] if gatherings else [] } if args.json: print(json.dumps(result)) else: if not gatherings: print("No gatherings found") else: print(f"Found {len(gatherings)} gatherings:") for gathering in gatherings: print(f" {gathering.id} - 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
- services.py:160-168 (helper)GatheringService.list_gatherings() method that delegates to DatabaseManager.list_gatherings().def list_gatherings(self) -> List[Gathering]: """ List all gatherings. Returns: A list of all Gathering objects """ return self.db_manager.list_gatherings()
- models.py:617-631 (helper)DatabaseManager.list_gatherings() method that queries all Gathering records from the database.def list_gatherings(self) -> List[Gathering]: """ List all gatherings. Returns: A list of all Gathering objects """ session = self.Session() try: # Get all gatherings gatherings = session.query(Gathering).all() return gatherings finally: session.close()