一个提供英国警察数据查询的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 数据整理后展示给用户根据用户意图选择对应的工具函数:
用户意图工具函数Retrieve street-level crimes by lat/lng or custom polygon areascripts.tools.get_street_level_crimesRetrieve outcomes by lat/lng, custom polygon, or location IDscripts.tools.get_street_level_outcomesRetrieve crimes at a specific location by ID or nearest to lat/lngscripts.tools.get_crimes_at_locationRetrieve crimes that could not be mapped to a locationscripts.tools.get_crimes_no_locationRetrieve valid crime categories for a given datescripts.tools.get_crime_categoriesRetrieve the date when crime data was last updatedscripts.tools.get_last_updatedRetrieve outcomes for a specific crime by persistent IDscripts.tools.get_outcomes_for_crimeRetrieve a list of all police forcesscripts.tools.get_list_of_forcesRetrieve details for a specific police forcescripts.tools.get_force_detailsRetrieve senior officers for a specific police forcescripts.tools.get_senior_officersRetrieve a list of neighbourhoods for a specific police forcescripts.tools.get_neighbourhoodsRetrieve details for a specific neighbourhood within a forcescripts.tools.get_neighbourhood_detailsRetrieve the boundary coordinates for a specific neighbourhoodscripts.tools.get_neighbourhood_boundaryRetrieve the team members for a specific neighbourhoodscripts.tools.get_neighbourhood_teamRetrieve events scheduled for a specific neighbourhoodscripts.tools.get_neighbourhood_eventsRetrieve policing priorities for a specific neighbourhoodscripts.tools.get_neighbourhood_prioritiesFind the neighbourhood policing team for a given latitude and longitudescripts.tools.locate_neighbourhoodRetrieve stop and searches within a 1-mile radius or custom areascripts.tools.get_stop_searches_by_areaRetrieve stop and searches at a specific location by IDscripts.tools.get_stop_searches_by_locationRetrieve stop and searches that could not be mapped to a locationscripts.tools.get_stop_searches_no_locationRetrieve stop and searches reported by a specific forcescripts.tools.get_stop_searches_by_force
如果参数不完整,使用 AskUserQuestion 向用户询问缺失的参数。
工具描述:Retrieve street-level crimes by lat/lng or custom polygon area
参数名称参数类型是否必填默认值描述latnumberfalseLatitude of the requested crime arealngnumberfalseLongitude of the requested crime areapolystringfalseThe lat/lng pairs defining the boundary of the custom areadatestringfalseLimit results to a specific month (YYYY-MM)categorystringfalse"all-crime"The crime category
工具描述:Retrieve outcomes by lat/lng, custom polygon, or location ID
参数名称参数类型是否必填默认值描述latnumberfalseLatitude of the requested arealngnumberfalseLongitude of the requested areapolystringfalseThe lat/lng pairs defining the boundary of the custom arealocation_idnumberfalseThe ID of the locationdatestringfalseLimit results to a specific month (YYYY-MM)
工具描述:Retrieve crimes at a specific location by ID or nearest to lat/lng
参数名称参数类型是否必填默认值描述latnumberfalseLatitude of the requested crime arealngnumberfalseLongitude of the requested crime arealocation_idnumberfalseThe ID of the locationdatestringfalseLimit results to a specific month (YYYY-MM)
工具描述:Retrieve crimes that could not be mapped to a location
参数名称参数类型是否必填默认值描述categorystringtrueThe category of the crimesforcestringtrueSpecific police forcedatestringfalseLimit results to a specific month (YYYY-MM)
工具描述:Retrieve valid crime categories for a given date
参数名称参数类型是否必填默认值描述datestringfalseSpecific month (YYYY-MM)
工具描述:Retrieve the date when crime data was last updated
参数名称参数类型是否必填默认值描述
工具描述:Retrieve outcomes for a specific crime by persistent ID
参数名称参数类型是否必填默认值描述persistent_idstringtrueThe 64-character unique identifier for the crime
工具描述:Retrieve a list of all police forces
参数名称参数类型是否必填默认值描述
工具描述:Retrieve details for a specific police force
参数名称参数类型是否必填默认值描述force_idstringtrueThe unique identifier for the force
工具描述:Retrieve senior officers for a specific police force
参数名称参数类型是否必填默认值描述force_idstringtrueThe unique identifier for the force
工具描述:Retrieve a list of neighbourhoods for a specific police force
参数名称参数类型是否必填默认值描述force_idstringtrueThe unique identifier for the force
工具描述:Retrieve details for a specific neighbourhood within a force
参数名称参数类型是否必填默认值描述force_idstringtrueThe unique identifier for the forceneighbourhood_idstringtrueThe unique identifier for the neighbourhood
工具描述:Retrieve the boundary coordinates for a specific neighbourhood
参数名称参数类型是否必填默认值描述force_idstringtrueThe unique identifier for the forceneighbourhood_idstringtrueThe unique identifier for the neighbourhood
工具描述:Retrieve the team members for a specific neighbourhood
参数名称参数类型是否必填默认值描述force_idstringtrueThe unique identifier for the forceneighbourhood_idstringtrueThe unique identifier for the neighbourhood
工具描述:Retrieve events scheduled for a specific neighbourhood
参数名称参数类型是否必填默认值描述force_idstringtrueThe unique identifier for the forceneighbourhood_idstringtrueThe unique identifier for the neighbourhood
工具描述:Retrieve policing priorities for a specific neighbourhood
参数名称参数类型是否必填默认值描述force_idstringtrueThe unique identifier for the forceneighbourhood_idstringtrueThe unique identifier for the neighbourhood
工具描述:Find the neighbourhood policing team for a given latitude and longitude
参数名称参数类型是否必填默认值描述latnumbertrueLatitude of the locationlngnumbertrueLongitude of the location
工具描述:Retrieve stop and searches within a 1-mile radius or custom area
参数名称参数类型是否必填默认值描述latnumberfalseLatitude of the centre pointlngnumberfalseLongitude of the centre pointpolystringfalseLat/lng pairs defining a polygondatestringfalseSpecific month (YYYY-MM)
工具描述:Retrieve stop and searches at a specific location by ID
参数名称参数类型是否必填默认值描述location_idnumbertrueThe ID of the locationdatestringfalseSpecific month (YYYY-MM)
工具描述:Retrieve stop and searches that could not be mapped to a location
参数名称参数类型是否必填默认值描述force_idstringtrueThe unique identifier for the forcedatestringfalseSpecific month (YYYY-MM)
工具描述:Retrieve stop and searches reported by a specific force
参数名称参数类型是否必填默认值描述force_idstringtrueThe unique identifier for the forcedatestringfalseSpecific month (YYYY-MM)
工具函数返回 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