Skip to main content

旅行特工队 - 工具层(travel-agent-tools)

华为 ICT 创新赛参赛作品 · 智果(AgentArts)平台 MCP 工具集

面向年轻群体的智能旅行规划系统 工具层,通过 MCP(Model Context Protocol)协议对外提供 7 大类共 30 个工具,可直接接入智果(AgentArts)智能体平台。

工具清单

模块 工具
地图 MCP search_poi planning_route geocode_address reverse_geocode search_around
空间计算 MCP calculate_distance estimate_commute_time optimize_route_order find_enroute_attractions get_pois_center split_pois_by_day
数据采集 fetch_reviews clean_reviews analyze_rating prioritize_pois summarize_reviews
HTML 生成 generate_travel_guide_html generate_checklist_html generate_photo_spots_html generate_share_card_html
PDF 生成 generate_checklist_pdf generate_itinerary_pdf generate_photo_guide_pdf
接口跳转 generate_booking_links generate_countdown aggregate_booking_status generate_calendar_reminder
抢票步骤 generate_ticket_steps generate_recommended_platform generate_ticket_tips

未配置 AMAP_API_KEY 时,地图类工具自动降级为示例数据,服务仍可启动与联调。

本地部署

# 1. 安装依赖(Python 3.10+)
pip install -r requirements.txt

# 2. 配置环境变量
copy .env.example .env
# 编辑 .env,填入高德地图 API Key(https://lbs.amap.com/ 申请)

# 3. 验证
python server.py --list
python server.py --test "search_poi:keyword=故宫,city=北京"

# 4. 启动
python server.py --http --port 8000   # HTTP 模式(测试)
python server.py                      # stdio 模式(MCP 标准,智果平台用)

HTTP 模式端点:GET /(健康检查)、GET /tools(工具列表)、POST /tools/call(调用工具)。

智果(AgentArts)平台部署

  1. 登录 https://www.huaweicloud.com/product/agentarts.html 智果平台控制台(需完成认证)
  2. 「连接器管理」→「新建连接器」:类型 MCP Server,运行环境 Python 3.10+
  3. 上传 travel-agent-tools.zip 代码包,启动命令:python server.py
  4. 环境变量:AMAP_API_KEY(必填)、MCP_SERVER_NAME=travel-agent-tools、LOG_LEVEL=INFO
  5. 资源规格:开发测试 0.5核1GB 即可(本项目为轻量 CPU 应用)
  6. 部署 → 测试连接 → 在智能体中绑定连接器并勾选工具

扩展开发

  1. 在 tools/<模块>/ 实现新函数
  2. 在 tools/__init__.py 的 HANDLERS 与 TOOLS 中注册
  3. 重新打包部署到智果平台

技术栈

Python 3.10+ · MCP(JSON-RPC over stdio) · 高德地图 API · Jinja2 · ReportLab · BeautifulSoup4 · Haversine · Loguru


版本 v1.0.0 · 华为 ICT 创新赛 - 旅行特工队

Metadata

Release files for travel-agent-tools 1.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for travel-agent-tools 1.0.2
File Size Uploaded Provenance Actions
travel_agent_tools-1.0.2.tar.gz 34.2 kB Without provenance Details for travel_agent_tools-1.0.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for travel-agent-tools 1.0.2
File Interpreter ABI Platform Actions
travel_agent_tools-1.0.2-py3-none-any.whl Python 3 none any Details for travel_agent_tools-1.0.2-py3-none-any.whl

Total release size: 74.1 kB

Release files / travel_agent_tools-1.0.2.tar.gz

Download URL travel_agent_tools-1.0.2.tar.gz
Size 34.2 kB
Tags Source
SHA-256 checksum
How to use checksums
ed0fcfb6fec46fc4a08447f88c8e0eb70af21782841cb27259e63ce76255508d
BLAKE2b-256 checksum
How to use checksums
7c5cf6b00b54cd689a86e44bde5a1e43c39757484c44741ccd6a2688682e1b8c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.10

Release files / travel_agent_tools-1.0.2-py3-none-any.whl

Download URL travel_agent_tools-1.0.2-py3-none-any.whl
Size 39.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6ab12172935a128543f605c6443e2c9c0ceabbf0d4c9f483d5e7ecf4757c78ee
BLAKE2b-256 checksum
How to use checksums
b8c1a74f65f81bf7562e28f22d1ebc15e4976627a1ea2bb7e1b4e6630adc110d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.10

Security for travel-agent-tools 1.0.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page