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.1

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.1
File Size Uploaded Provenance Actions
travel_agent_tools-1.0.1.tar.gz 30.6 kB Without provenance Details for travel_agent_tools-1.0.1.tar.gz

Built distribution (wheel)

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

Total release size: 66.7 kB

Release files / travel_agent_tools-1.0.1.tar.gz

Download URL travel_agent_tools-1.0.1.tar.gz
Size 30.6 kB
Tags Source
SHA-256 checksum
How to use checksums
27ac38126dde8ae85b9e3981f297a5431f4b61214ef7e3f248c77fe8d0d67be1
BLAKE2b-256 checksum
How to use checksums
4b44cec11ccd68c055a4d5516ac5c2899c0560c4295d7dd0cfab8fe859c4832f
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.1-py3-none-any.whl

Download URL travel_agent_tools-1.0.1-py3-none-any.whl
Size 36.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
dce7f2cc50817d225c16fbc4d53dc2ca8eb331bff3e32b76b03eb91cc656b906
BLAKE2b-256 checksum
How to use checksums
010357507b7e0373384884679c11ed12231e26745948a5bbf4a4add13778e6ff
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.1

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