Skip to main content
Glama
abutbul

Gatherings MCP Server

by abutbul

create_gathering

Initiate a new gathering by providing a unique ID and member count, enabling expense tracking and reimbursement calculations for social events on the Gatherings MCP Server.

Instructions

Create a new gathering

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
gathering_idYesUnique ID for the gathering (format: yyyy-mm-dd-type)
membersYesNumber of members in the gathering

Implementation Reference

  • MCP tool handler for 'create_gathering': validates input using type guard and constructs CLI command to execute the Python backend via subprocess.
    case 'create_gathering': if (!isCreateGatheringArgs(args)) { throw new McpError(ErrorCode.InvalidParams, 'Invalid create_gathering arguments'); } command += ` create "${args.gathering_id}" --members ${args.members}`; break;
  • src/index.ts:65-81 (registration)
    Registration of the 'create_gathering' tool in the MCP server's ListTools response, including schema definition.
    name: 'create_gathering', description: 'Create a new gathering', inputSchema: { type: 'object', properties: { gathering_id: { type: 'string', description: 'Unique ID for the gathering (format: yyyy-mm-dd-type)', }, members: { type: 'number', description: 'Number of members in the gathering', }, }, required: ['gathering_id', 'members'], }, },
  • Type guard helper to validate 'create_gathering' tool arguments before execution.
    const isCreateGatheringArgs = (args: any): args is { gathering_id: string; members: number } => typeof args === 'object' && args !== null && typeof args.gathering_id === 'string' && typeof args.members === 'number';
  • CLI handler invoked by MCP server for 'create' command: calls GatheringService.create_gathering and formats output as JSON or text.
    def handle_create(service, args): """Handle the create command.""" try: gathering = service.create_gathering(args.gathering_id, args.members) result = { "success": True, "gathering": { "id": gathering.id, "total_members": gathering.total_members, "status": gathering.status.value } } if args.json: print(json.dumps(result)) else: print(f"Created gathering: {gathering.id}") print(f"Total members: {gathering.total_members}") 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 method implementing the core create_gathering logic by delegating to DatabaseManager.
    def create_gathering(self, gathering_id: str, total_members: int) -> Gathering: """Creates a new gathering with the specified number of members.""" gathering = self.db_manager.create_gathering(gathering_id, total_members) return gathering

Other Tools

Related 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