Skip to main content
Glama

get_message_platforms

Retrieve configured messaging platforms from AstrBot to manage bot communication channels and integration settings.

Instructions

获取 AstrBot 中配置的消息平台列表,对应 /api/config/platform/list。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The core asynchronous handler function implementing the 'get_message_platforms' tool. It connects to AstrBot via AstrBotClient, fetches the platform list from /api/config/platform/list, handles errors, and returns the platforms list or error details.
    async def get_message_platforms() -> Dict[str, Any]: """ 获取 AstrBot 中配置的消息平台列表,对应 /api/config/platform/list。 """ client = AstrBotClient.from_env() try: result = await client.get_platform_list() except Exception as e: 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), } status = result.get("status") if status != "ok": return { "status": status, "message": result.get("message"), "raw": result, } return { "platforms": result.get("data", {}).get("platforms", []), }
  • Registers the get_message_platforms tool function with the FastMCP server, explicitly naming it 'get_message_platforms'.
    server.tool(astrbot_tools.get_message_platforms, name="get_message_platforms")
  • Re-exports the get_message_platforms function from platform_tools.py into the tools package namespace, making it available as astrbot_tools.get_message_platforms for server registration.
    from .platform_tools import get_message_platforms
  • Lists 'get_message_platforms' in the astrbot://info resource, advertising the available tools to MCP hosts.
    "get_message_platforms",
  • Re-exports get_message_platforms in the top-level tools.py for backward compatibility.
    get_message_platforms,

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