Skip to main content
Glama

yeepay_yop_api_detail

Get complete API details from YOP for any URI, including parameters, examples, error codes, callbacks, and sample code.

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
NameRequiredDescriptionDefault
api_uriYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The main handler for the 'yeepay_yop_api_detail' tool. It takes an API URI string, processes various URL formats (direct .md URLs, .html documentation pages, raw URIs), constructs appropriate API documentation URLs, downloads content via HttpUtils, and returns the markdown result.
    @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
  • yop_mcp/main.py:65-65 (registration)
    The tool is registered via the @mcp.tool() decorator on the function definition, which is the MCP framework's standard registration mechanism.
    @mcp.tool()
  • The schema is defined through the function signature and docstring: input is a single string parameter 'api_uri' (the API URI path), output is a string (markdown format with API details). Type hints provide basic validation.
    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格式)
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries full burden. It implicitly indicates a read-only operation by stating it retrieves information ('获取...详细定义'), and does not suggest any modifications or side effects. This adequately discloses the non-destructive nature.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured with separate sections for Args and Returns, but it could be slightly more concise. The return part largely repeats the purpose. However, every sentence contributes value, and the formatting aids readability.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a single-parameter tool with no annotations but an output schema, the description comprehensively covers usage: explains the parameter in detail, describes the return format, and links to a sibling tool for extended content. No missing information.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 0% coverage, but the description provides detailed semantics for the only parameter 'api_uri', including its purpose and multiple examples (e.g., '/rest/v1.0/aggpay/pre-pay'). This fully compensates for the schema's lack of description.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states that the tool retrieves detailed API definitions from Yeepay Payment Platform (YOP), listing included information types and mentioning a sibling tool for further detail. This distinguishes it from siblings like yeepay_yop_download_cert and yeepay_yop_gen_key_pair.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description explicitly states the tool's purpose and conditionally guides users to call yeepay_yop_link_detail when content contains links. While it lacks explicit when-not-to-use instructions, the context is clear for selecting this tool over siblings.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/yop-platform/yop-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server