list_astrbot_config_files
Retrieve configuration files for AstrBot to manage settings and customize bot behavior.
Instructions
List AstrBot config files (abconfs), via /api/config/abconfs.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- The core handler function implementing the 'list_astrbot_config_files' tool. It uses AstrBotClient to fetch the list of config files (abconfs) from the AstrBot API endpoint /api/config/abconfs, handling errors and formatting the response.async def list_astrbot_config_files() -> Dict[str, Any]: """ List AstrBot config files (abconfs), via /api/config/abconfs. """ client = AstrBotClient.from_env() try: result = await client.get_abconf_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 {"info_list": (result.get("data") or {}).get("info_list", [])}
- astrbot_mcp/server.py:34-34 (registration)Registers the tool function with the FastMCP server instance, making it available via the MCP protocol under the name 'list_astrbot_config_files'.server.tool(astrbot_tools.list_astrbot_config_files, name="list_astrbot_config_files")
- astrbot_mcp/tools/__init__.py:28-32 (registration)Imports and re-exports the list_astrbot_config_files function from config_tools.py, making it available as astrbot_tools.list_astrbot_config_files for use in server.py.from .config_tools import ( list_astrbot_config_files, inspect_astrbot_config, apply_astrbot_config_ops, )