Skip to main content
Glama

browse_plugin_market

Browse and search the AstrBot plugin marketplace to discover available plugins, view descriptions, tags, and update dates.

Instructions

查看 AstrBot 插件市场(支持搜索与按时间排序)。

用法:

  • mode="latest": 按 updated_at 倒序,返回第 start ~ start+count-1 条(start 从 1 开始)

  • mode="search": 按 query 搜索(名称/简介/标签/作者/仓库),再按 updated_at 倒序

返回字段:

  • total_plugins: 插件市场总数(未过滤)

  • matched_plugins: 搜索命中数(mode=search)

  • plugins: 列表(包含 name/desc/tags/stars/updated_at)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
modeNolatest
queryNo
startNo
countNo
custom_registryNo
force_refreshNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The primary handler function implementing the 'browse_plugin_market' tool. It fetches plugins from AstrBot client or fallback registry, supports 'latest' and 'search' modes, sorts by update time and stars, and paginates results.
    async def browse_plugin_market(
        mode: Literal["latest", "search"] = "latest",
        query: str | None = None,
        start: int = 1,
        count: int = 20,
        custom_registry: str | None = None,
        force_refresh: bool = False,
    ) -> Dict[str, Any]:
        """
        查看 AstrBot 插件市场(支持搜索与按时间排序)。
    
        用法:
          - mode="latest": 按 `updated_at` 倒序,返回第 start ~ start+count-1 条(start 从 1 开始)
          - mode="search": 按 query 搜索(名称/简介/标签/作者/仓库),再按 `updated_at` 倒序
    
        返回字段:
          - total_plugins: 插件市场总数(未过滤)
          - matched_plugins: 搜索命中数(mode=search)
          - plugins: 列表(包含 name/desc/tags/stars/updated_at)
        """
        if start < 1:
            return {"status": "error", "message": "start must be >= 1"}
        if count < 1 or count > 200:
            return {"status": "error", "message": "count must be in [1, 200]"}
        if mode not in ("latest", "search"):
            return {"status": "error", "message": "mode must be 'latest' or 'search'"}
        if mode == "search" and not (query or "").strip():
            return {"status": "error", "message": "query is required when mode='search'"}
    
        client = AstrBotClient.from_env()
        source = "astrbot"
        raw_data: Any | None = None
    
        try:
            result = await client.get_plugin_market_list(
                custom_registry=custom_registry,
                force_refresh=force_refresh,
            )
            if result.get("status") != "ok":
                return {
                    "status": result.get("status") or "error",
                    "message": result.get("message") or "AstrBot returned non-ok status.",
                    "raw": result,
                }
            raw_data = (result.get("data") or {})
        except Exception as e:
            source = "remote"
            try:
                raw_data = await _fetch_default_registry(timeout=client.timeout)
            except Exception as fallback_exc:
                return {
                    "status": "error",
                    "message": f"AstrBot API error: {e.response.status_code if hasattr(e, 'response') else 'Unknown'}",
                    "base_url": client.base_url,
                    "detail": _httpx_error_detail(e),
                    "hint": _astrbot_connect_hint(client),
                    "fallback_error": str(fallback_exc),
                }
    
        items = _normalize_plugin_items(raw_data)
        total = len(items)
    
        if mode == "search":
            items = [it for it in items if _matches_query(it, query or "")]
    
        def sort_key(it: Dict[str, Any]) -> Tuple[datetime, int, str]:
            dt = _parse_iso_datetime(it.get("updated_at") or it.get("update_time") or it.get("updated"))
            stars = _as_int(it.get("stars") or it.get("star") or 0)
            pid = str(it.get("id") or "")
            return (dt, stars, pid)
    
        items.sort(key=sort_key, reverse=True)
    
        matched = len(items)
        offset = start - 1
        page = items[offset : offset + count]
    
        plugins: List[Dict[str, Any]] = []
        for idx, it in enumerate(page, start=start):
            plugin_id = str(it.get("id") or "")
            display_name = it.get("display_name") or it.get("name") or plugin_id
            tags = it.get("tags") if isinstance(it.get("tags"), list) else []
            plugins.append(
                {
                    "rank": idx,
                    "id": plugin_id,
                    "name": str(display_name),
                    "desc": str(it.get("desc") or it.get("description") or ""),
                    "tags": [str(t) for t in tags],
                    "stars": _as_int(it.get("stars") or it.get("star") or 0),
                    "updated_at": it.get("updated_at"),
                }
            )
    
        return {
            "status": "ok",
            "source": source,
            "mode": mode,
            "query": query,
            "start": start,
            "count": count,
            "total_plugins": total,
            "matched_plugins": matched if mode == "search" else total,
            "returned_plugins": len(plugins),
            "plugins": plugins,
        }
  • Registers the browse_plugin_market tool handler with the FastMCP server using the re-exported function from astrbot_tools.
    server.tool(astrbot_tools.browse_plugin_market, name="browse_plugin_market")
  • Re-exports the browse_plugin_market handler from plugin_market_tools.py into the tools package namespace for use in server.py.
    from .plugin_market_tools import browse_plugin_market
  • Lists 'browse_plugin_market' as one of the available tools in the astrbot_info resource.
    "tools": [
        "get_astrbot_logs",
        "get_message_platforms",
        "send_platform_message",
        "send_platform_message_direct",
        "restart_astrbot",
        "get_platform_session_messages",
        "browse_plugin_market",
        "list_astrbot_config_files",
        "inspect_astrbot_config",
        "apply_astrbot_config_ops",
        "search_astrbot_config_paths",
    ],
Behavior4/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 effectively describes key behaviors: pagination mechanics (start and count parameters), sorting order (updated_at descending), and what fields are returned in the output. However, it doesn't mention potential rate limits, authentication requirements, or error conditions, leaving some behavioral aspects unspecified.

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

Conciseness5/5

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

The description is well-structured and appropriately sized. It begins with a clear purpose statement, followed by a '用法' (usage) section detailing modes, and a '返回字段' (return fields) section. Each sentence adds specific value—no wasted words—and information is front-loaded with the most critical details about modes and parameters.

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?

Given the tool's moderate complexity (6 parameters, no annotations, but with an output schema), the description is complete enough. It covers purpose, usage modes, parameter semantics, and output structure. Since an output schema exists, the description doesn't need to exhaustively explain return values, and it provides sufficient context for an agent to use the tool effectively.

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?

With 0% schema description coverage for 6 parameters, the description compensates excellently. It explains the semantics of 'mode' (latest vs. search), 'query' (search across multiple fields), 'start' (starting index from 1), and 'count' (number of results). While it doesn't cover 'custom_registry' or 'force_refresh', it provides substantial value beyond the bare schema, making parameter purposes clear.

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 the tool's purpose: '查看 AstrBot 插件市场(支持搜索与按时间排序)' which translates to 'Browse AstrBot plugin market (supports search and sorting by time)'. It specifies the exact resource (plugin market) and actions (browse with search/sorting), distinguishing it from sibling tools that handle configuration, logs, messages, or restart operations.

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

Usage Guidelines5/5

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

The description provides explicit usage guidelines with two distinct modes: 'mode="latest"' for chronological browsing and 'mode="search"' for query-based filtering. It explains when to use each mode based on the user's intent (browse latest vs. search), including details on how results are ordered and paginated, making it clear when this tool is appropriate versus alternatives.

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/xunxiing/astrbotmcp'

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