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

Output 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,
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. It states it retrieves a list but doesn't disclose behavioral traits such as permissions needed, rate limits, pagination, or error handling. The API endpoint reference adds minimal context, leaving key operational details 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 a single, efficient sentence that directly states the tool's purpose and includes the API endpoint without unnecessary elaboration. It is front-loaded and wastes no words, making it highly concise and well-structured.

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

Completeness3/5

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

Given the tool's simplicity (0 parameters, output schema exists), the description is minimally adequate. However, with no annotations and siblings present, it lacks context on usage scenarios and behavioral details, making it incomplete for optimal agent guidance despite the output schema covering return values.

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

Parameters4/5

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

The tool has 0 parameters with 100% schema description coverage, so no parameter details are needed. The description doesn't add parameter semantics, but this is acceptable given the absence of parameters, aligning with the baseline for zero parameters.

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 action ('获取' meaning 'get') and the resource ('消息平台列表' meaning 'message platform list'), specifying it retrieves configured platforms in AstrBot. It doesn't explicitly differentiate from siblings like 'get_platform_session_messages' or 'send_platform_message', but the purpose is unambiguous.

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

Usage Guidelines2/5

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

No guidance is provided on when to use this tool versus alternatives. It mentions the API endpoint ('/api/config/platform/list'), but doesn't explain scenarios, prerequisites, or exclusions relative to siblings like 'inspect_astrbot_config' or 'list_astrbot_config_files'.

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