Football Pilgrimage Guide
Generate an emotionally resonant football pilgrimage guide. Input: a team name (+ optional travel dates). Output: a narrative-driven travel guide where every spot tells a story, enhanced with "On This Day" historic events, automatic match detection during your trip, and the team's official crest.
Language rule: Match the user's language. If the user writes in Chinese, output the entire guide in Chinese. If in English, output in English. Always mirror the user's input language — including the pre-check prompts, phase titles, spot stories, On This Day narratives, and all other text.
Dependencies
- - ESPN API (primary): Team info (team_id, name, crest URL) and match schedule — via ESPN's public REST API, no API key needed
- Wikipedia (via Web Search): Team history, stadium info, founding story, legends, honors — search
"{team_name} wikipedia history stadium legends" to get Wikipedia content through search results, since web_fetch on Wikipedia may timeout - Web Search: Stadium tours, museums, fan pubs, landmarks, spot backstories, historic events (On This Day)
- flyai (optional): Flight and hotel booking if user provides departure city
ESPN API Reference
See references/espn-api.md for full API documentation including base URL, league slugs, endpoints, response formats, team lookup guide, and common team IDs.
Quick Start
User: "Generate an AC Milan football pilgrimage guide, departing April 15"
- 1. ESPN API: search teams in
ita.1 → find AC Milan (teamid=103), get crest URL (see ESPN API Reference) - Web search
"AC Milan wikipedia history stadium legends" → founding story, stadium (San Siro), legends, honors - ESPN API: fetch schedule for team 103 → check for matches between April 15-19, extract stadium name
- Web search for stadium tour, football museum, fan pubs — and the story behind each spot
- Web search
"AC Milan history on this day April memorable moments" → find historic events for the trip - Generate the pilgrimage guide with emotional narrative, spot stories, On This Day section, and match alert if applicable
Commands
generate_pilgrimage
Main command — generates a complete pilgrimage guide for a team.
- -
team (str, required): Team name (e.g., "AC Milan", "Liverpool", "Barcelona") - INLINECODE6 (str, optional): User's departure city for travel planning (triggers flyai search)
- INLINECODE7 (str, optional): Travel date (YYYY-MM-DD) — also used for On This Day matching
- INLINECODE8 (str, optional): Trip duration in days (default: 3)
Pre-check — if no team specified:
If the user triggers a pilgrimage request without specifying a team (e.g., "I want a football pilgrimage guide", "plan a stadium trip for me"), do NOT guess. Instead:
- 1. Ask the user: "Which team is your heart's home? Tell me your club and I'll craft the perfect pilgrimage."
- If the user is unsure or says "recommend one", suggest 3–5 iconic pilgrimage destinations based on popularity and experience richness:
- 🏟️
Liverpool — Anfield, The Kop, Shankly Gates, "You'll Never Walk Alone"
- 🏟️
Barcelona — Camp Nou (under renovation → Spotify Camp Nou), La Masia, Les Corts
- 🏟️
AC Milan / Inter Milan — San Siro, shared cathedral of two rival faiths
- 🏟️
Real Madrid — Santiago Bernabéu, the newly renovated galáctico temple
- 🏟️
Bayern Munich — Allianz Arena, FC Bayern Museum, Säbener Straße
- 3. Wait for the user to choose before proceeding with the workflow.
Pre-check — if no departure date specified:
If the user provides a team but no departure date, recommend the best travel date within the next 30 days by combining match schedule and On This Day events:
- 1. Fetch the team's upcoming fixtures via ESPN API (see Get team schedule)
- Filter for home matches within the next 30 days — a home match is the #1 factor for choosing a date
- Search On This Day events for dates around those home matches:
"{team_name} on this day {month} {day}" — find dates with rich historical significance - Recommend the best departure date with reasoning, e.g.:
- 🔥 "I recommend departing
April 15 — on April 17, {team} has a home match vs {opponent}, AND on April 16, back in {year}, {historic_event}. This gives you the perfect combination of live football and historical resonance!"
- If no home match in the next 30 days: "No home matches in the next 30 days, but I recommend
{date} — on this day in {year}, {historic_event}. You can still enjoy the stadium tour and city pilgrimage!"
- 5. Ask the user to confirm or adjust the recommended date before generating the full guide.
Workflow:
⚡ Concurrency strategy: Steps 1 is sequential (needed by later steps). Steps 2–5 should run in parallel to minimize latency. Within each step, all searches should also be parallel.
- 1. Discover team info via ESPN API + Wikipedia (sequential — needed by all later steps):
- Determine the ESPN league slug (e.g.,
ita.1 for Serie A) — see
League Slugs. If unsure, try the most likely league for the team name
- Search the teams list to find team
id and crest URL — see Search team
- ⚠️ The team profile endpoint does NOT return venue info. Stadium name comes from the schedule endpoint — see step 2 and ESPN API notes
- Search Wikipedia for team background: Web search "{team_name} wikipedia history stadium legends honors" — extract founding year, stadium name, city, honors, legendary players, club motto, and key historical moments from search results. Do NOT use web_fetch on Wikipedia (it times out). This is the primary source for storytelling content in the guide
- Extract: team_id, crest URL, city from ESPN; founding story, legends, stadium history from Wikipedia
- If team name is ambiguous (e.g., "Inter" could be Inter Milan or Inter Miami), try multiple league slugs or confirm with the user
── After step 1 completes, launch steps 2–5 in parallel ──
- 2. Check schedule + get stadium info via ESPN API 🔀 (see ESPN API Reference for curl commands and response format):
- Fetch past results and upcoming fixtures via the schedule endpoints
- Extract stadium: From any home match, get venue.fullName and venue.address.city
- Check for trip matches (if departure_date and duration provided): Filter events where date falls within trip dates
- For each match found, extract: opponent name, home/away, kickoff time
- If home match found: 🔥 This is the highlight of the pilgrimage! Adjust the itinerary to make this the "Stadium Day". Use flyai to search match tickets and recommend to user
- If away match found: Still worth noting — user might want to watch at a fan pub
- If no match found: Note it and suggest checking for schedule updates closer to the trip
- 3. Research pilgrimage spots with stories 🔀 — launch 3 web_search calls in one batch (merged queries for speed):
- web_search: "{stadium_name} history legends stadium tour" — stadium origin, iconic moments, tour info
- web_search: "{city} {team_name} fan pubs landmarks statues monuments" — pubs, landmarks, statues and their stories
- web_search: "{city} {team_name} football museum shops merchandise" — museum exhibits, shops, memorabilia
- ⚠️ Do NOT search for ticket prices, flight prices, or hotel prices via Web Search. Use flyai for all ticket/pricing queries
- After spots are identified, use flyai to search attraction tickets (stadium tour, museum, etc.) and include ticket info in the guide
- 4. Research On This Day events 🔀 — only 1 web_search call for the entire trip:
- web_search: "{team_name} history on this day {month} memorable moments" (use the departure month)
- From the search results, pick events whose dates fall within the trip dates. Assign each matching event to the corresponding trip day
- If no events match the trip dates, that's fine — simply omit On This Day sections from the guide
- ⚠️ Anti-fabrication rules:
- ONLY use events that appear in Web Search results — never generate events from memory or training data
- If no events found for a specific day, skip that day entirely — do NOT output any On This Day section for that day. No placeholder text, no filler quotes. Simply omit
- Prefer well-documented events (league matches, cup finals, official transfers) over vague anecdotes
- 5. Ticket search via flyai 🔀:
- Match tickets (if home match found in step 2): flyai search-tickets --event "{team_name} vs {opponent}" --date "{match_date}" --city "{city}"
- Attraction tickets: flyai search-tickets --attraction "{stadium_name} tour" --date "{date}" --city "{city}" (stadium tour, museum, etc.)
── After all parallel steps complete, generate the guide ──
- 6. Generate the guide with emotional narrative structure (see Guide Structure reference)
- 7. Ask about flights & hotels — after the guide is generated, ask the user:
- "Need me to search for flights and hotels? Just tell me your departure city and I'll find the best options for you! ✈️🏨"
- If user says yes and provides departure city, use flyai:
- flyai search-flight --origin "{departure_city}" --destination "{city}" --dep-date "{date}"
- flyai search-hotels --city "{city}" --check-in "{date}" --nights {duration}
- If user already provided departure_city in the initial request, still ask to confirm before searching
getstadiuminfo
Get detailed stadium information for pilgrimage planning.
- -
team (str, required): Team name
Returns: stadium name, capacity, address, tour availability, ticket prices, visiting hours, plus the stadium's origin story and legendary moments.
getpilgrimagespots
Get a curated list of pilgrimage spots for a team's city. Each spot includes a backstory.
- -
team (str, required): Team name - INLINECODE25 (str, optional): Filter by type — "museum", "pub", "landmark", "shop", "all"
Returns: list of spots with name, description, address, significance, story (historical background, legendary events, famous anecdotes tied to this spot).
getonthis_day
Get historic football events that match the user's trip dates.
- -
team (str, required): Team name - INLINECODE27 (str, required): Trip start date (YYYY-MM-DD)
- INLINECODE28 (int, optional): Trip duration in days (default: 3)
Workflow:
- 1. Web search
"{team_name} history on this day {month} memorable moments" (use the departure month) — only 1 search - From results, filter events whose calendar date (month + day) falls within the trip dates
- Assign each matching event to the corresponding trip day
- For days with no matching event, simply omit — do NOT invent an event
⚠️ Critical: Every event in the output MUST come from a Web Search result. If you cannot point to a specific search result that contains the event, do not include it.
gettripmatches
Check if the team has any matches during the user's trip dates.
- -
team (str, required): Team name - INLINECODE31 (str, required): Trip start date (YYYY-MM-DD)
- INLINECODE32 (int, optional): Trip duration in days (default: 3)
Workflow:
- 1. Determine ESPN league slug and teamid (see Finding a Team)
- Fetch past results and upcoming fixtures via schedule endpoints (see ESPN API Reference)
- Merge both results, filter events where date falls within [departure
date, departure_date + duration - 1]
For each match found, extract: home/away, opponent, kickoff time, statusReturn matches sorted by date, with home matches highlighted
Output guidance:
- - 🔥 Home match: "Lucky you! During your trip, {team} will face {opponent} at {stadium}!" + flyai ticket search results
- ⚽ Away match: "During your trip, {team} has an away match (vs {opponent}) — you can watch the live broadcast at a local fan pub!"
- 😢 No match: "Match schedule during your trip — please check the team's official website before departure"
gettravelplan
Generate travel plan (flights + hotels) for the pilgrimage.
- -
team (str, required): Team name - INLINECODE34 (str, required): Departure city
- INLINECODE35 (str, required): Travel date (YYYY-MM-DD)
- INLINECODE36 (int, optional): Number of nights (default: 3)
Team Crest (Logo)
The team's official crest is obtained from ESPN API responses:
- 1. Primary source — ESPN teams list or team profile →
team.logos[0].href returns a URL like INLINECODE38 - Direct construction — If you know the team_id, the crest URL follows a predictable pattern: INLINECODE39
- Fallback — If crest URL is missing, search
"{team_name} official logo png" via Web Search
- - Usage: Display in the guide header and anywhere the team identity is shown
- Rendering: Use
 in Markdown - Fallback: If crest URL is missing, use a text-based team badge with team colors
Guide Structure (Emotional Arc)
See references/guide-structure.md for the full 5-phase narrative arc (Pre-departure → Arrival → Stadium Day → Deep Experience → Departure), spot storytelling format, match day itinerary, and optional travel & stay section.
Data Sources
| Source | What it provides |
|---|
| ESPN API | Team ID, name, crest URL, match schedule, stadium info (from schedule endpoint). See ESPN API Reference |
| Wikipedia (via Web Search) |
Team history, founding story, legends, honors, stadium background |
| Web Search | Stadium tours, museums, fan pubs, landmarks,
spot backstories,
On This Day events |
| flyai | Flights, hotels,
and match tickets (when departure city provided or user asks for pricing) |
Examples
See references/examples.md for 3 complete examples: basic pilgrimage, pilgrimage with travel + On This Day + match detection, and standalone On This Day query.
Error Handling
- - If no team specified: Ask the user which team they support. If they're unsure, recommend 3–5 iconic pilgrimage destinations and wait for their choice. Never guess or pick a team on their behalf
- If ESPN API returns no matching team or the team name is ambiguous (e.g., "Inter" could be Inter Milan or Inter Miami), try multiple league slugs or ask user to clarify
- If stadium tour info is unavailable, note it and suggest checking the official website
- If flyai returns no flights, suggest alternative dates or nearby airports
- If no On This Day events found for a specific day, try broadening the search (league-level, city-level). If still nothing, omit the On This Day section for that day entirely — no placeholder text, no filler. Never fabricate events to fill gaps
- If crest URL is missing, use a text-based badge with team colors as fallback
- If ESPN API returns an error or is unreachable, fall back to Web Search for team info and skip match detection with a note to the user
- Never surface raw errors to the user — provide clean, human-readable messages
Common Mistakes
- - Don't confuse team names — always confirm with search results
- Don't hallucinate stadium tour details — only use verified info from search
- Don't skip the emotional narrative — this is not a dry travel guide, it's a pilgrimage
- Don't list spots without stories — every spot must have its backstory. If you can't find a story, search harder
- Don't fabricate On This Day events — this is the #1 risk of this skill. Rules:
- Every event MUST come from a Web Search result — never from LLM memory or training data
- If search returns nothing for a day,
omit the On This Day section for that day entirely — a gap is better than a lie
- Don't "improve" search results — if the search says "Milan beat Juventus 2-1", don't change the score or add details not in the source
- Prefer official match records (scores, dates, competitions) over vague anecdotes that can't be verified
- When in doubt, do a verification search:
"{team} {opponent} {date} {year}" to confirm the event
- - Don't only search one day for On This Day — search every day of the trip (departuredate through departuredate + duration - 1), so each Phase has its own historic event
- Don't forget the team crest — it should appear in the guide header
- Don't forget to check for matches — when departure_date and duration are provided, always query ESPN schedule API to check for matches during the trip. A home match is the ultimate pilgrimage moment
- Don't assume match day = tour day — stadium tours are usually closed on match days. If there's a match, schedule the tour for the day before
足球朝圣指南
生成一份情感共鸣的足球朝圣指南。输入:球队名称(+ 可选旅行日期)。输出:一份叙事驱动的旅行指南,其中每个地点都讲述一个故事,并配有历史上的今天历史事件、旅行期间的自动比赛检测以及球队官方队徽。
语言规则:匹配用户的语言。如果用户用中文书写,则整份指南用中文输出。如果用户用英文书写,则用英文输出。始终镜像用户的输入语言——包括预检查提示、阶段标题、地点故事、历史上的今天叙述以及所有其他文本。
依赖项
- - ESPN API(主要):球队信息(teamid、名称、队徽URL)和比赛日程——通过ESPN的公共REST API,无需API密钥
- 维基百科(通过网页搜索):球队历史、球场信息、成立故事、传奇人物、荣誉——搜索{teamname} wikipedia history stadium legends通过搜索结果获取维基百科内容,因为web_fetch在维基百科上可能会超时
- 网页搜索:球场参观、博物馆、球迷酒吧、地标、地点背景故事、历史事件(历史上的今天)
- flyai(可选):如果用户提供出发城市,则提供航班和酒店预订
ESPN API 参考
完整API文档请参见 references/espn-api.md,包括基础URL、联赛slug、端点、响应格式、球队查找指南和常用球队ID。
快速开始
用户:生成一份AC米兰足球朝圣指南,4月15日出发
- 1. ESPN API:在ita.1中搜索球队→找到AC米兰(teamid=103),获取队徽URL(参见 ESPN API 参考)
- 网页搜索AC Milan wikipedia history stadium legends→成立故事、球场(圣西罗)、传奇人物、荣誉
- ESPN API:获取球队103的赛程→检查4月15日至19日之间的比赛,提取球场名称
- 网页搜索球场参观、足球博物馆、球迷酒吧——以及每个地点背后的故事
- 网页搜索AC Milan history on this day April memorable moments→查找旅行期间的历史事件
- 生成带有情感叙事、地点故事、历史上的今天部分以及比赛提醒(如适用)的朝圣指南
命令
generate_pilgrimage
主要命令——为球队生成完整的朝圣指南。
- - team(str,必需):球队名称(例如AC Milan、Liverpool、Barcelona)
- departurecity(str,可选):用户的出发城市,用于旅行规划(触发flyai搜索)
- departuredate(str,可选):旅行日期(YYYY-MM-DD)——也用于历史上的今天匹配
- duration(str,可选):旅行天数(默认:3)
预检查——如果未指定球队:
如果用户触发朝圣请求但未指定球队(例如我想要一份足球朝圣指南、为我规划一次球场之旅),不要猜测。而是:
- 1. 询问用户:哪支球队是你心中的家?告诉我你的俱乐部,我会为你打造完美的朝圣之旅。
- 如果用户不确定或说推荐一个,根据受欢迎程度和体验丰富度推荐3-5个标志性朝圣地:
- 🏟️
利物浦 — 安菲尔德、Kop看台、香克利大门、你永远不会独行
- 🏟️
巴塞罗那 — 诺坎普(翻新中→Spotify诺坎普)、拉玛西亚、莱斯科茨
- 🏟️
AC米兰 / 国际米兰 — 圣西罗,两个敌对信仰共享的大教堂
- 🏟️
皇家马德里 — 圣地亚哥·伯纳乌,新翻新的银河战舰殿堂
- 🏟️
拜仁慕尼黑 — 安联球场、拜仁慕尼黑博物馆、塞贝纳大街
- 3. 等待用户选择后再继续工作流程。
预检查——如果未指定出发日期:
如果用户提供了球队但未提供出发日期,通过结合比赛日程和历史上的今天事件,推荐未来30天内的最佳旅行日期:
- 1. 通过ESPN API获取球队即将到来的赛程(参见 获取球队赛程)
- 筛选未来30天内的主场比赛——主场比赛是选择日期的首要因素
- 搜索这些主场比赛日期附近的历史上的今天事件:{teamname} on this day {month} {day}——查找具有丰富历史意义的日期
- 推荐最佳出发日期并附上理由,例如:
- 🔥 我推荐
4月15日出发——4月17日,{team}有一场对阵{opponent}的主场比赛,而且在4月16日,{year}年,{historic_event}。这将为您带来现场足球和历史共鸣的完美结合!
- 如果未来30天内没有主场比赛:未来30天内没有主场比赛,但我推荐
{date}——在{year}年的这一天,{historic_event}。您仍然可以享受球场参观和城市朝圣!
- 5. 在生成完整指南前,请用户确认或调整推荐的日期。
工作流程:
⚡ 并发策略:步骤1是顺序的(后续步骤需要)。步骤2-5应并行运行以最小化延迟。在每个步骤中,所有搜索也应并行进行。
- 1. 发现球队信息通过ESPN API + 维基百科(顺序——所有后续步骤需要):
- 确定ESPN联赛slug(例如意甲为ita.1)——参见
联赛Slugs。如果不确定,尝试该球队名称最可能的联赛
- 搜索球队列表以找到team
id和队徽URL——参见 搜索球队
- ⚠️ 球队资料端点不返回场馆信息。球场名称来自赛程端点——参见步骤2和 ESPN API 说明
- 搜索维基百科获取球队背景:网页搜索{teamname} wikipedia history stadium legends honors——从搜索结果中提取成立年份、球场名称、城市、荣誉、传奇球员、俱乐部座右铭和关键历史时刻。不要使用webfetch访问维基百科(会超时)。这是指南中故事内容的主要来源
- 提取:来自ESPN的team_id、队徽URL、城市;来自维基百科的成立故事、传奇人物、球场历史
- 如果球队名称有歧义(例如Inter可能指国际米兰或迈阿密国际),尝试多个联赛slug或与用户确认
── 步骤1完成后,并行启动步骤2-5 ──
- 2. 检查赛程 + 获取球场信息通过ESPN API 🔀(参见 ESPN API 参考 获取curl命令和响应格式):
- 通过赛程端点获取过去结果和即将到来的赛程
- 提取球场:从任何主场比赛获取venue.fullName和venue.address.city
- 检查旅行期间比赛(如果提供了departure_date和duration):筛选日期在旅行日期内的事件
- 对于找到的每场比赛,提取:对手名称、主/客场、开球时间
- 如果找到主场比赛:🔥 这是朝圣的亮点!调整行程,使其成为球场日。使用flyai搜索比赛门票并推荐给用户
- 如果找到客场比赛:仍然值得注意——用户可能想在球迷酒吧观看
- 如果未找到比赛:记录并建议在旅行前查看赛程更新
- 3. 研究带有故事的朝圣地点 🔀 — 一次批量发起3个web_search调用(合并查询以提高速度):
- websearch:{stadiumname} history legends stadium tour — 球场起源、标志性时刻、参观信息
- websearch:{city} {teamname} fan pubs landmarks statues monuments — 酒吧、地标、雕像及其故事
- websearch:{city} {teamname} football museum shops merchandise — 博物馆展品、商店、纪念品
- ⚠️ 不要通过网页搜索搜索门票价格、航班价格或酒店价格。使用flyai处理所有门票/定价查询
- 确定地点后,使用flyai搜索景点门票(球场参观、博物馆等)并在指南中包含门票信息
- 4. 研究历史上的今天事件 🔀 — 整个旅行只需1次web_search调用:
- websearch:{teamname} history on this day {month} memorable moments(使用出发月份)
- 从搜索结果中,挑选日期在旅行日期