yeepay_yop_api_detail
Retrieve detailed API specifications for Yeepay's YOP platform, including parameters, examples, error codes, and sample code in markdown format.
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
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| api_uri | Yes |
Implementation Reference
- yop_mcp/main.py:66-129 (handler)Core handler function implementing the yeepay_yop_api_detail tool logic. Processes api_uri in various formats (direct URI, full MD/HTML links), constructs appropriate documentation URLs, downloads markdown content via HttpUtils.download_content with multiple fallbacks.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
- yop_mcp/main.py:65-65 (registration)The @mcp.tool() decorator registers the yeepay_yop_api_detail function as a tool on the FastMCP server instance 'mcp'.@mcp.tool()
- yop_mcp/main.py:67-79 (schema)Input/output schema defined in the function docstring with parameter description, examples, and return type. Reinforced by type hints: api_uri: str -> str (markdown).""" 通过此工具,获取易宝支付开放平台(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格式)