from mcp.server import FastMCP

mcp = FastMCP(
    name="accommodation-expenses",
    instructions="根据城市获取住宿费用标准的MCP服务"
)


def is_level_one_city(city_name: str) -> bool:
    level_one_cities = ["北京", "上海", "广州", "深圳"]
    return any(city in city_name for city in level_one_cities)


@mcp.tool()
def get_accommodation_expenses(city_name: str) -> int:
    """
    根据城市获取住宿费用标准（单位：元）

    Args:
        city_name: 城市名称

    Returns:
        住宿费用标准（元）
    """
    if not city_name:
        return 150
    elif is_level_one_city(city_name):
        return 450
    else:
        return 300


if __name__ == "__main__":
    mcp.run()