提供菲律宾标准地理编码(PSGC)API访问的模型上下文协议(MCP)服务器,包含完整的菲律宾地理层级数据。
此 Skill 必须配置 API 密钥才能使用。
.env 中没有 XBY_APIKEY, 必须使用 AskUserQuestion 工具向用户询问 API 密钥scripts.config.set_api_key(api_key) 保存,然后继续处理你(大模型)是路由层,负责理解用户意图、选择工具、提取参数。代码只负责调用API。
text
用户输入 → 你选择工具 → 提取该工具需要的参数 → 调用 scripts.tools 中的函数 → 返回结果给用户
scripts.config.settings.api_key 为空,使用 AskUserQuestion 询问用户,拿到后调用 scripts.config.set_api_key(key) 保存scripts.tools 中的函数,例如 scripts.tools.search_schools(score='520', province='北京', category='综合')raw 数据整理后展示给用户根据用户意图选择对应的工具函数:
用户意图工具函数List all island groups in the Philippinesscripts.tools.get_island_groupsGet specific island group by codescripts.tools.get_island_groupGet all regions within a specific island groupscripts.tools.get_island_group_regionsGet all provinces within a specific island groupscripts.tools.get_island_group_provincesGet all cities within a specific island groupscripts.tools.get_island_group_citiesGet all municipalities within a specific island groupscripts.tools.get_island_group_municipalitiesGet all barangays within a specific island groupscripts.tools.get_island_group_barangaysList all regions in the Philippinesscripts.tools.get_regionsGet specific region by codescripts.tools.get_regionGet all provinces within a specific regionscripts.tools.get_region_provincesGet all districts within a specific regionscripts.tools.get_region_districtsGet all cities within a specific regionscripts.tools.get_region_citiesGet all municipalities within a specific regionscripts.tools.get_region_municipalitiesGet all cities and municipalities within a specific regionscripts.tools.get_region_cities_municipalitiesGet all sub-municipalities within a specific regionscripts.tools.get_region_sub_municipalitiesGet all barangays within a specific regionscripts.tools.get_region_barangaysList all provinces in the Philippinesscripts.tools.get_provincesGet specific province by codescripts.tools.get_provinceGet all cities within a specific provincescripts.tools.get_province_citiesGet all municipalities within a specific provincescripts.tools.get_province_municipalitiesGet all cities and municipalities within a specific provincescripts.tools.get_province_cities_municipalitiesGet all sub-municipalities within a specific provincescripts.tools.get_province_sub_municipalitiesGet all barangays within a specific provincescripts.tools.get_province_barangaysList all cities in the Philippinesscripts.tools.get_citiesGet specific city by codescripts.tools.get_cityGet all barangays within a specific cityscripts.tools.get_city_barangaysList all municipalities in the Philippinesscripts.tools.get_municipalitiesGet specific municipality by codescripts.tools.get_municipalityGet all barangays within a specific municipalityscripts.tools.get_municipality_barangaysList all barangays in the Philippinesscripts.tools.get_barangaysGet specific barangay by codescripts.tools.get_barangayList all districts in the Philippinesscripts.tools.get_districtsGet specific district by codescripts.tools.get_districtGet all cities within a specific districtscripts.tools.get_district_citiesGet all municipalities within a specific districtscripts.tools.get_district_municipalitiesGet all cities and municipalities within a specific districtscripts.tools.get_district_cities_municipalitiesGet all sub-municipalities within a specific districtscripts.tools.get_district_sub_municipalitiesGet all barangays within a specific districtscripts.tools.get_district_barangaysSearch for geographic entities by name across all levels (regions, provinces, cities, municipalities, barangays)scripts.tools.search_by_nameGet complete geographic hierarchy for a specific code (shows parent entities)scripts.tools.get_hierarchyValidate if a geographic code exists and return its typescripts.tools.validate_code
如果参数不完整,使用 AskUserQuestion 向用户询问缺失的参数。
工具描述:List all island groups in the Philippines
参数名称参数类型是否必填默认值描述
工具描述:Get specific island group by code
参数名称参数类型是否必填默认值描述codestringtruenull
工具描述:Get all regions within a specific island group
参数名称参数类型是否必填默认值描述islandGroupCodestringtruenull
工具描述:Get all provinces within a specific island group
参数名称参数类型是否必填默认值描述islandGroupCodestringtruenull
工具描述:Get all cities within a specific island group
参数名称参数类型是否必填默认值描述islandGroupCodestringtruenull
工具描述:Get all municipalities within a specific island group
参数名称参数类型是否必填默认值描述islandGroupCodestringtruenull
工具描述:Get all barangays within a specific island group
参数名称参数类型是否必填默认值描述islandGroupCodestringtruenull
工具描述:List all regions in the Philippines
参数名称参数类型是否必填默认值描述
工具描述:Get specific region by code
参数名称参数类型是否必填默认值描述codestringtruenull
工具描述:Get all provinces within a specific region
参数名称参数类型是否必填默认值描述regionCodestringtruenull
工具描述:Get all districts within a specific region
参数名称参数类型是否必填默认值描述regionCodestringtruenull
工具描述:Get all cities within a specific region
参数名称参数类型是否必填默认值描述regionCodestringtruenull
工具描述:Get all municipalities within a specific region
参数名称参数类型是否必填默认值描述regionCodestringtruenull
工具描述:Get all cities and municipalities within a specific region
参数名称参数类型是否必填默认值描述regionCodestringtruenull
工具描述:Get all sub-municipalities within a specific region
参数名称参数类型是否必填默认值描述regionCodestringtruenull
工具描述:Get all barangays within a specific region
参数名称参数类型是否必填默认值描述regionCodestringtruenull
工具描述:List all provinces in the Philippines
参数名称参数类型是否必填默认值描述
工具描述:Get specific province by code
参数名称参数类型是否必填默认值描述codestringtruenull
工具描述:Get all cities within a specific province
参数名称参数类型是否必填默认值描述provinceCodestringtruenull
工具描述:Get all municipalities within a specific province
参数名称参数类型是否必填默认值描述provinceCodestringtruenull
工具描述:Get all cities and municipalities within a specific province
参数名称参数类型是否必填默认值描述provinceCodestringtruenull
工具描述:Get all sub-municipalities within a specific province
参数名称参数类型是否必填默认值描述provinceCodestringtruenull
工具描述:Get all barangays within a specific province
参数名称参数类型是否必填默认值描述provinceCodestringtruenull
工具描述:List all cities in the Philippines
参数名称参数类型是否必填默认值描述
工具描述:Get specific city by code
参数名称参数类型是否必填默认值描述codestringtruenull
工具描述:Get all barangays within a specific city
参数名称参数类型是否必填默认值描述cityCodestringtruenull
工具描述:List all municipalities in the Philippines
参数名称参数类型是否必填默认值描述
工具描述:Get specific municipality by code
参数名称参数类型是否必填默认值描述codestringtruenull
工具描述:Get all barangays within a specific municipality
参数名称参数类型是否必填默认值描述municipalityCodestringtruenull
工具描述:List all barangays in the Philippines
参数名称参数类型是否必填默认值描述
工具描述:Get specific barangay by code
参数名称参数类型是否必填默认值描述codestringtruenull
工具描述:List all districts in the Philippines
参数名称参数类型是否必填默认值描述
工具描述:Get specific district by code
参数名称参数类型是否必填默认值描述codestringtruenull
工具描述:Get all cities within a specific district
参数名称参数类型是否必填默认值描述districtCodestringtruenull
工具描述:Get all municipalities within a specific district
参数名称参数类型是否必填默认值描述districtCodestringtruenull
工具描述:Get all cities and municipalities within a specific district
参数名称参数类型是否必填默认值描述districtCodestringtruenull
工具描述:Get all sub-municipalities within a specific district
参数名称参数类型是否必填默认值描述districtCodestringtruenull
工具描述:Get all barangays within a specific district
参数名称参数类型是否必填默认值描述districtCodestringtruenull
工具描述:Search for geographic entities by name across all levels (regions, provinces, cities, municipalities, barangays)
参数名称参数类型是否必填默认值描述namestringtruenulltypestringfalsenulllimitintegerfalse10.0null
工具描述:Get complete geographic hierarchy for a specific code (shows parent entities)
参数名称参数类型是否必填默认值描述codestringtruenull
工具描述:Validate if a geographic code exists and return its type
参数名称参数类型是否必填默认值描述codestringtruenull
工具函数返回 dict 对象:
result["raw"] - API 原始返回数据(JSON), 直接将此数据整理后展示给用户result["success"] - 是否成功(True/False)result["message"] - 状态消息text
xiaobenyang_gaokao_skill/
├── scripts/
│ ├── __init__.py
│ ├── config.py # 配置管理 + set_api_key()
│ ├── call_api.py # API 客户端 + call_api()
│ └── tools.py # 工具函数(直接调用)
├── requirements.txt
└── SKILL.md