yeepay_yop_api_detail
Retrieve detailed API specifications from YeePay Open Platform (YOP), including request/response parameters, examples, error codes, and callback details in markdown format for integration and troubleshooting.
Instructions
通过此工具,获取易宝支付开放平台(YOP)的API接口的详细定义,包含基本信息、请求参数、请求示例、 响应参数、响应示例、错误码、回调、示例代码等信息,内容中包含链接时可以调用工具yeepay_yop_link_detail进一步获取其详细内容
Args: api_uri: str - API的URI路径, 例如:/rest/v1.0/aggpay/pre-pay, https://open.yeepay.com/docs-v3/api/post_rest_v1.0_aggpay_pre-pay.md, https://open.yeepay.com/docs-v2/apis/user-scan/post__rest__v1.0__aggpay__pre-pay/index.html
Returns: str: 易宝支付开放平台(YOP)的API接口的详细定义,包含基本信息、请求参数、请求示例、 响应参数、响应示例、错误码、回调、示例代码等信息(markdown格式)
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| api_uri | Yes |
Implementation Reference
- yop_mcp/main.py:65-129 (handler)The handler function for the 'yeepay_yop_api_detail' tool. It processes various API URI formats (direct URI, MD links, HTML links) to fetch detailed API documentation from Yeepay YOP platform using HttpUtils.download_content, falling back through multiple URL construction strategies, and returns markdown content. The @mcp.tool() decorator registers it as an MCP tool. The function signature and docstring define the input schema (api_uri: str) and output (str).@mcp.tool() def yeepay_yop_api_detail(api_uri: str) -> str: """ 通过此工具,获取易宝支付开放平台(YOP)的API接口的详细定义,包含基本信息、请求参数、请求示例、 响应参数、响应示例、错误码、回调、示例代码等信息,内容中包含链接时可以调用工具yeepay_yop_link_detail进一步获取其详细内容 Args: api_uri: str - API的URI路径, 例如:/rest/v1.0/aggpay/pre-pay, https://open.yeepay.com/docs-v3/api/post_rest_v1.0_aggpay_pre-pay.md, https://open.yeepay.com/docs-v2/apis/user-scan/post__rest__v1.0__aggpay__pre-pay/index.html Returns: str: 易宝支付开放平台(YOP)的API接口的详细定义,包含基本信息、请求参数、请求示例、 响应参数、响应示例、错误码、回调、示例代码等信息(markdown格式) """ api_uri = api_uri.strip() response = "HTTP请求失败" if api_uri.startswith("http"): if api_uri.endswith(".md"): response = HttpUtils.download_content(api_uri) elif ( api_uri.endswith(".html") or "/docs/apis/" in api_uri or "/docs-v2/apis/" in api_uri ): url_parts = api_uri.split("/") for part in url_parts: if ( part.startswith("post__") or part.startswith("get__") or part.startswith("options__") ): api_id = part.replace("__", "_") response = HttpUtils.download_content( "https://open.yeepay.com/docs-v3/api/" + api_id + ".md" ) break if response.startswith("HTTP请求失败") and "_" in api_uri: response = HttpUtils.download_content( "https://open.yeepay.com/docs-v3/api/" + api_uri + ".md" ) formatted_api_uri = api_uri.replace("/", "_") if response.startswith("HTTP请求失败"): response = HttpUtils.download_content( "https://open.yeepay.com/docs-v3/api/" + formatted_api_uri + ".md" ) if response.startswith("HTTP请求失败"): response = HttpUtils.download_content( "https://open.yeepay.com/docs-v3/api/post" + formatted_api_uri + ".md" ) if response.startswith("HTTP请求失败"): response = HttpUtils.download_content( "https://open.yeepay.com/docs-v3/api/get" + formatted_api_uri + ".md" ) if response.startswith("HTTP请求失败"): response = HttpUtils.download_content( "https://open.yeepay.com/docs-v3/api/options" + formatted_api_uri + ".md" ) return response