get_platform_overview
Retrieve API module overview for Android, iOS, or Windows, listing module names, descriptions, classes, and functions.
Instructions
获取指定平台(android/ios/windows)的 API 模块概览,包含模块名、描述、类和函数列表。
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| platform | Yes | 目标平台:android、ios 或 windows |
Implementation Reference
- src/ascript_mcp/api_store.py:43-78 (handler)The core handler function that executes the tool logic. It loads platform data from JSON, formats an overview with module names, descriptions, classes, and functions.
def get_platform_overview(self, platform: str) -> str: """返回指定平台所有模块的概览信息。 包含每个模块的名称、描述,以及其下主要的类和函数列表。 """ self._ensure_loaded() platform = platform.strip().lower() if platform not in self._data: return f"错误:不支持的平台 '{platform}'。支持的平台:{', '.join(VALID_PLATFORMS)}" modules = self._data[platform].get("modules", []) lines: list[str] = [f"# {platform.upper()} 平台 API 概览\n"] lines.append(f"共 {len(modules)} 个模块:\n") for mod in modules: module_name = mod["module"] docstring = (mod.get("docstring") or "").split("\n")[0] lines.append(f"## {module_name}") if docstring: lines.append(f" {docstring}") # 列出类 classes = mod.get("classes", []) if classes: cls_names = [c["name"] for c in classes] lines.append(f" 类: {', '.join(cls_names)}") # 列出函数 functions = mod.get("functions", []) if functions: func_names = [f["name"] for f in functions] lines.append(f" 函数: {', '.join(func_names)}") lines.append("") return "\n".join(lines) - src/ascript_mcp/local.py:369-386 (registration)Tool registration in local.py - defines the tool name, description, and inputSchema for the MCP server (Chinese locale).
Tool( name="get_platform_overview", description=( "获取指定平台(android/ios/windows)的 API 模块概览," "包含模块名、描述、类和函数列表。" ), inputSchema={ "type": "object", "properties": { "platform": { "type": "string", "description": "目标平台:android、ios 或 windows", "enum": ["android", "ios", "windows"], } }, "required": ["platform"], }, ), - src/ascript_mcp/server.py:155-172 (registration)Tool registration in server.py - defines the tool name, description, and inputSchema for the MCP server (English locale).
Tool( name="get_platform_overview", description=( "Get an overview of all API modules for a given platform (android/ios/windows). " "Returns module names, descriptions, and lists of classes/functions." ), inputSchema={ "type": "object", "properties": { "platform": { "type": "string", "description": "Target platform: 'android', 'ios', or 'windows'", "enum": ["android", "ios", "windows"], } }, "required": ["platform"], }, ), - src/ascript_mcp/server.py:271-273 (handler)Dispatch call in server.py - routes the 'get_platform_overview' tool invocation to api_store.get_platform_overview().
if name == "get_platform_overview": platform = arguments.get("platform", "") result = api_store.get_platform_overview(platform) - src/ascript_mcp/local.py:1052-1053 (handler)Dispatch call in local.py - routes the 'get_platform_overview' tool invocation to api_store.get_platform_overview().
if name == "get_platform_overview": return api_store.get_platform_overview(args["platform"])