一个提供文本转换、格式化和分析功能的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 数据整理后展示给用户根据用户意图选择对应的工具函数:
用户意图工具函数Convert text to camelCasescripts.tools.case_to_camelConvert text to PascalCasescripts.tools.case_to_pascalConvert text to snake_casescripts.tools.case_to_snakeConvert text to kebab-casescripts.tools.case_to_kebabConvert text to CONSTANT_CASEscripts.tools.case_to_constantConvert text to dot.casescripts.tools.case_to_dotConvert text to no casescripts.tools.case_to_noConvert text to Pascal_Snake_Casescripts.tools.case_to_pascal_snakeConvert text to path/casescripts.tools.case_to_pathConvert text to Sentence casescripts.tools.case_to_sentenceConvert text to Train-Casescripts.tools.case_to_trainConvert text to Capital Casescripts.tools.case_to_capitalEncode text to Base64scripts.tools.encode_base64Decode Base64 to textscripts.tools.decode_base64Encode text for URLsscripts.tools.encode_urlDecode URL-encoded textscripts.tools.decode_urlEncode HTML entitiesscripts.tools.encode_htmlDecode HTML entitiesscripts.tools.decode_htmlFormat and beautify JSONscripts.tools.format_jsonFormat and beautify XMLscripts.tools.format_xmlFormat and beautify SQLscripts.tools.format_sqlFormat and beautify HTMLscripts.tools.format_htmlCount characters in textscripts.tools.count_charactersCount words in textscripts.tools.count_wordsCount lines in textscripts.tools.count_linesCalculate readability metricsscripts.tools.analyze_readabilityTrim whitespace from textscripts.tools.string_trimExtract a substringscripts.tools.string_substringReplace textscripts.tools.string_replaceSplit text into an arrayscripts.tools.string_splitJoin an array into textscripts.tools.string_joinGenerate a UUIDscripts.tools.generate_uuidValidate a UUIDscripts.tools.validate_uuidGenerate MD5 hashscripts.tools.generate_md5Generate SHA-1 hashscripts.tools.generate_sha1Generate SHA-256 hashscripts.tools.generate_sha256Generate SHA-512 hashscripts.tools.generate_sha512Generate HMAC hashscripts.tools.generate_hmacGenerate lorem ipsum textscripts.tools.generate_lorem_ipsumTest a regex pattern against textscripts.tools.regex_testReplace text using a regex patternscripts.tools.regex_replaceExtract matches using a regex patternscripts.tools.regex_extractSplit text using a regex patternscripts.tools.regex_split
如果参数不完整,使用 AskUserQuestion 向用户询问缺失的参数。
工具描述:Convert text to camelCase
参数名称参数类型是否必填默认值描述textstringtrueThe text to transform to camelCasedelimiterstringfalseThe character to use between words (optional)localenullfalseLocale for case conversion (optional)mergeAmbiguousCharactersbooleanfalseWhether to merge ambiguous characters (optional)
工具描述:Convert text to PascalCase
参数名称参数类型是否必填默认值描述textstringtrueThe text to transform to PascalCasedelimiterstringfalseThe character to use between words (optional)localenullfalseLocale for case conversion (optional)mergeAmbiguousCharactersbooleanfalseWhether to merge ambiguous characters (optional)
工具描述:Convert text to snake_case
参数名称参数类型是否必填默认值描述textstringtrueThe text to transform to snake_casedelimiterstringfalseThe character to use between words (optional)localenullfalseLocale for case conversion (optional)mergeAmbiguousCharactersbooleanfalseWhether to merge ambiguous characters (optional)
工具描述:Convert text to kebab-case
参数名称参数类型是否必填默认值描述textstringtrueThe text to transform to kebab-casedelimiterstringfalseThe character to use between words (optional)localenullfalseLocale for case conversion (optional)mergeAmbiguousCharactersbooleanfalseWhether to merge ambiguous characters (optional)
工具描述:Convert text to CONSTANT_CASE
参数名称参数类型是否必填默认值描述textstringtrueThe text to transform to CONSTANT_CASEdelimiterstringfalseThe character to use between words (optional)localenullfalseLocale for case conversion (optional)mergeAmbiguousCharactersbooleanfalseWhether to merge ambiguous characters (optional)
工具描述:Convert text to dot.case
参数名称参数类型是否必填默认值描述textstringtrueThe text to transform to dot.casedelimiterstringfalseThe character to use between words (optional)localenullfalseLocale for case conversion (optional)mergeAmbiguousCharactersbooleanfalseWhether to merge ambiguous characters (optional)
工具描述:Convert text to no case
参数名称参数类型是否必填默认值描述textstringtrueThe text to transform to no casedelimiterstringfalseThe character to use between words (optional)localenullfalseLocale for case conversion (optional)mergeAmbiguousCharactersbooleanfalseWhether to merge ambiguous characters (optional)
工具描述:Convert text to Pascal_Snake_Case
参数名称参数类型是否必填默认值描述textstringtrueThe text to transform to Pascal_Snake_CasedelimiterstringfalseThe character to use between words (optional)localenullfalseLocale for case conversion (optional)mergeAmbiguousCharactersbooleanfalseWhether to merge ambiguous characters (optional)
工具描述:Convert text to path/case
参数名称参数类型是否必填默认值描述textstringtrueThe text to transform to path/casedelimiterstringfalseThe character to use between words (optional)localenullfalseLocale for case conversion (optional)mergeAmbiguousCharactersbooleanfalseWhether to merge ambiguous characters (optional)
工具描述:Convert text to Sentence case
参数名称参数类型是否必填默认值描述textstringtrueThe text to transform to Sentence casedelimiterstringfalseThe character to use between words (optional)localenullfalseLocale for case conversion (optional)mergeAmbiguousCharactersbooleanfalseWhether to merge ambiguous characters (optional)
工具描述:Convert text to Train-Case
参数名称参数类型是否必填默认值描述textstringtrueThe text to transform to Train-CasedelimiterstringfalseThe character to use between words (optional)localenullfalseLocale for case conversion (optional)mergeAmbiguousCharactersbooleanfalseWhether to merge ambiguous characters (optional)
工具描述:Convert text to Capital Case
参数名称参数类型是否必填默认值描述textstringtrueThe text to transform to Capital CasedelimiterstringfalseThe character to use between words (optional)localenullfalseLocale for case conversion (optional)mergeAmbiguousCharactersbooleanfalseWhether to merge ambiguous characters (optional)
工具描述:Encode text to Base64
参数名称参数类型是否必填默认值描述textstringtrueThe text to encode or decode
工具描述:Decode Base64 to text
参数名称参数类型是否必填默认值描述textstringtrueThe text to encode or decode
工具描述:Encode text for URLs
参数名称参数类型是否必填默认值描述textstringtrueThe text to encode or decode
工具描述:Decode URL-encoded text
参数名称参数类型是否必填默认值描述textstringtrueThe text to encode or decode
工具描述:Encode HTML entities
参数名称参数类型是否必填默认值描述textstringtrueThe text to encode or decode
工具描述:Decode HTML entities
参数名称参数类型是否必填默认值描述textstringtrueThe text to encode or decode
工具描述:Format and beautify JSON
参数名称参数类型是否必填默认值描述textstringtrueThe text to formatindent_sizeintegerfalse2.0Number of spaces for indentation (1-8)
工具描述:Format and beautify XML
参数名称参数类型是否必填默认值描述textstringtrueThe text to formatindent_sizeintegerfalse2.0Number of spaces for indentation (1-8)
工具描述:Format and beautify SQL
参数名称参数类型是否必填默认值描述textstringtrueThe text to formatindent_sizeintegerfalse2.0Number of spaces for indentation (1-8)
工具描述:Format and beautify HTML
参数名称参数类型是否必填默认值描述textstringtrueThe text to formatindent_sizeintegerfalse2.0Number of spaces for indentation (1-8)
工具描述:Count characters in text
参数名称参数类型是否必填默认值描述textstringtrueThe text to analyze
工具描述:Count words in text
参数名称参数类型是否必填默认值描述textstringtrueThe text to analyze
工具描述:Count lines in text
参数名称参数类型是否必填默认值描述textstringtrueThe text to analyze
工具描述:Calculate readability metrics
参数名称参数类型是否必填默认值描述textstringtrueThe text to analyze
工具描述:Trim whitespace from text
参数名称参数类型是否必填默认值描述textstringtrueThe text to trimtrim_typestringfalse"both"Type of trimming to perform
工具描述:Extract a substring
参数名称参数类型是否必填默认值描述textstringtrueThe text to extract a substring fromstartintegerfalse0.0Starting index (inclusive)endintegerfalseEnding index (exclusive, optional)
工具描述:Replace text
参数名称参数类型是否必填默认值描述textstringtrueThe text to perform replacements onsearchstringtrueThe string to search forreplacestringtrueThe string to replace withreplace_allbooleanfalsetrueWhether to replace all occurrences
工具描述:Split text into an array
参数名称参数类型是否必填默认值描述textstringtrueThe text to splitdelimiterstringfalse" "The delimiter to split bylimitintegerfalseMaximum number of splits (optional)
工具描述:Join an array into text
参数名称参数类型是否必填默认值描述partsarraytrueThe array of strings to joindelimiterstringfalse""The delimiter to join with
工具描述:Generate a UUID
参数名称参数类型是否必填默认值描述versionstringfalse"v4"UUID version to generatenamespacestringfalseNamespace for v5 UUID (required for v5)namestringfalseName for v5 UUID (required for v5)uppercasebooleanfalsefalseWhether to return the UUID in uppercase
工具描述:Validate a UUID
参数名称参数类型是否必填默认值描述uuidstringtrueThe UUID to validate
工具描述:Generate MD5 hash
参数名称参数类型是否必填默认值描述textstringtrueThe text to hash
工具描述:Generate SHA-1 hash
参数名称参数类型是否必填默认值描述textstringtrueThe text to hash
工具描述:Generate SHA-256 hash
参数名称参数类型是否必填默认值描述textstringtrueThe text to hash
工具描述:Generate SHA-512 hash
参数名称参数类型是否必填默认值描述textstringtrueThe text to hash
工具描述:Generate HMAC hash
参数名称参数类型是否必填默认值描述textstringtrueThe text to hashkeystringtrueThe secret key for HMACalgorithmstringfalse"SHA256"The hashing algorithm to use
工具描述:Generate lorem ipsum text
参数名称参数类型是否必填默认值描述countintegerfalse5.0Number of units to generateunitsstringfalse"sentences"Type of units to generateparagraphLowerBoundintegerfalse3.0Minimum sentences per paragraphparagraphUpperBoundintegerfalse7.0Maximum sentences per paragraphsentenceLowerBoundintegerfalse5.0Minimum words per sentencesentenceUpperBoundintegerfalse15.0Maximum words per sentenceformatstringfalse"plain"Output format
工具描述:Test a regex pattern against text
参数名称参数类型是否必填默认值描述textstringtrueThe text to test against the patternpatternstringtrueThe regex pattern to testflagsstringfalse"g"Regex flags (e.g., 'g', 'i', 'gi')
工具描述:Replace text using a regex pattern
参数名称参数类型是否必填默认值描述textstringtrueThe text to perform replacements onpatternstringtrueThe regex pattern to matchreplacementstringtrueThe replacement stringflagsstringfalse"g"Regex flags (e.g., 'g', 'i', 'gi')
工具描述:Extract matches using a regex pattern
参数名称参数类型是否必填默认值描述textstringtrueThe text to extract frompatternstringtrueThe regex pattern with capture groupsflagsstringfalse"g"Regex flags (e.g., 'g', 'i', 'gi')
工具描述:Split text using a regex pattern
参数名称参数类型是否必填默认值描述textstringtrueThe text to splitpatternstringtrueThe regex pattern to split byflagsstringfalse""Regex flags (e.g., 'i')
工具函数返回 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