Skip to main content
Glama
xiaobenyang-com

Search-Apple-Docs

find_similar_apis

find_similar_apis

Discover alternative and related Apple developer APIs by finding similar functionality, modern replacements for deprecated APIs, and platform-specific alternatives to implement features effectively.

Instructions

Discover alternative and related APIs. Finds APIs with similar functionality, modern replacements for deprecated APIs, and platform-specific alternatives. Perfect when looking for better ways to implement functionality.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
apiUrlYes
searchDepthNo
filterByCategoryNo
includeAlternativesNo

Implementation Reference

  • The core handler function that proxies tool execution to the external Xiaobenyang API by making an HTTP POST request with the tool name and arguments. This implements the logic for 'find_similar_apis' and all other dynamically registered tools.
    const calcXiaoBenYangApi = async function (fullArgs: Record<string, any>) {
        // 发起 POST 请求
        let response = await fetch('https://mcp.xiaobenyang.com/api', {
            method: 'POST',
            headers: {
                'XBY-APIKEY': apiKey,
                'func': fullArgs.toolName,
                'mcpid': mcpID
            },
            body: new URLSearchParams(fullArgs)
        });
        const apiResult = await response.text();
    
        return {
            content: [
                {
                    type: "text",
                    text: apiResult // 将字符串结果放入 content 中
                }
            ]
        } as { [x: string]: unknown; content: [{ type: "text"; text: string }] };
    };
  • Wrapper handler that validates and prepares arguments by adding the toolName ('find_similar_apis'), then delegates to the core proxy function.
    const handleXiaoBenYangApi = async (args: Record<string, any>, toolName: string) => {
        // 校验aid是否存在
        if (toolName === undefined || toolName === null) {
            throw new Error("缺少必要参数 'aid'");
        }
        // 合并参数
        const fullArgs = {...args, toolName: toolName};
        // 调用API
        return calcXiaoBenYangApi(fullArgs);
    };
  • src/mcp.ts:50-65 (registration)
    Registers a single tool with the MCP server, specifying name, description, input schema, and the proxy handler. Called for each tool including 'find_similar_apis'.
    const addToolXiaoBenYangApi = function (
        name: string,
        desc: string,
        params: Record<string, ZodType>
    ) {
        server.registerTool(
            name,
            {
                title: name,
                description: desc,
                inputSchema: params,
            }
            ,
            async (args: Record<string, any>) => handleXiaoBenYangApi(args, name)
        )
    };
  • src/mcp.ts:87-134 (registration)
    Dynamically fetches the list of tools (including 'find_similar_apis') from the external API, constructs Zod schemas from their descriptions, and registers them using addToolXiaoBenYangApi.
    const data = await res.json();
    const apiDescList = data.tools;
    
    for (const apiDesc of apiDescList) {
        let inputSchema = JSON.parse(apiDesc.inputSchema);
        const zodDict: Record<string, z.ZodTypeAny> = {};
    
        Object.entries(inputSchema.properties).forEach(([name, propConfig]) => {
            let zodType;
            let pt = (propConfig as { type: string }).type;
            switch (pt) {
                case 'string':
                    zodType = z.string();
                    break;
                case 'number':
                    zodType = z.number();
                    break;
                case 'boolean':
                    zodType = z.boolean();
                    break;
                case 'integer':
                    zodType = z.bigint();
                    break;
                case 'array':
                    zodType = z.array(z.any());
                    break;
                case 'object':
                    zodType = z.object(z.any());
                    break;
                default:
                    zodType = z.any();
            }
    
            if (inputSchema.required?.includes(name)) {
                zodDict[name] = zodType;
            } else {
                zodDict[name] = zodType.optional();
            }
        });
    
    
        addToolXiaoBenYangApi(
            apiDesc.name,
            apiDesc.description ? apiDesc.description : apiDesc.name,
            zodDict);
    }
    isRegistered = true;
    state.isLoading = false;
  • Constructs the input schema (Zod types) dynamically from the JSON schema fetched for each tool, mapping types like string, number, etc., and handling required/optional fields.
    let inputSchema = JSON.parse(apiDesc.inputSchema);
    const zodDict: Record<string, z.ZodTypeAny> = {};
    
    Object.entries(inputSchema.properties).forEach(([name, propConfig]) => {
        let zodType;
        let pt = (propConfig as { type: string }).type;
        switch (pt) {
            case 'string':
                zodType = z.string();
                break;
            case 'number':
                zodType = z.number();
                break;
            case 'boolean':
                zodType = z.boolean();
                break;
            case 'integer':
                zodType = z.bigint();
                break;
            case 'array':
                zodType = z.array(z.any());
                break;
            case 'object':
                zodType = z.object(z.any());
                break;
            default:
                zodType = z.any();
        }
    
        if (inputSchema.required?.includes(name)) {
            zodDict[name] = zodType;
        } else {
            zodDict[name] = zodType.optional();
        }
    });
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions the tool 'Finds APIs' but doesn't describe how results are returned (e.g., list format, ranking, or pagination), potential rate limits, authentication needs, or error conditions. For a discovery tool with 4 parameters, this lack of behavioral context is a significant gap, though it doesn't contradict any annotations.

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 appropriately sized with two sentences that are front-loaded: the first sentence states the core purpose and key use cases, and the second provides a usage hint. There's no wasted text, and it efficiently conveys the tool's value, though it could be slightly more structured with bullet points for clarity.

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

Completeness2/5

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

Given the complexity (4 parameters, 0% schema coverage, no annotations, no output schema), the description is incomplete. It doesn't explain parameter meanings, return values, or behavioral traits like result formatting or limitations. For a tool that likely returns structured API data, this leaves the agent with insufficient context to use it effectively beyond basic invocation.

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

Parameters2/5

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

The schema description coverage is 0%, meaning none of the 4 parameters are documented in the schema. The description adds no information about parameters like 'apiUrl' (what format?), 'searchDepth' (what values?), 'filterByCategory' (what categories?), or 'includeAlternatives' (what does this toggle?). It fails to compensate for the schema's lack of descriptions, leaving parameters largely unexplained.

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

Purpose4/5

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

The description clearly states the tool's purpose: 'Discover alternative and related APIs' with specific examples like 'similar functionality, modern replacements for deprecated APIs, and platform-specific alternatives.' It distinguishes itself from siblings like 'get_related_apis' by emphasizing discovery and alternatives rather than just relatedness. However, it doesn't explicitly contrast with 'search_apple_docs' or 'search_framework_symbols,' leaving some sibling differentiation incomplete.

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

Usage Guidelines3/5

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

The description provides implied usage guidance with 'Perfect when looking for better ways to implement functionality,' which suggests it's for optimization or replacement scenarios. It doesn't explicitly state when not to use it or name alternatives among siblings, such as 'get_related_apis' for simpler relatedness or 'search_apple_docs' for broader searches. This leaves some ambiguity in tool selection.

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/xiaobenyang-com/Search-Apple-Docs'

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