MCPcopy
hub / github.com/AstrBotDevs/AstrBot / _test_config_body

Function _test_config_body

astrbot/dashboard/api/tools.py:78–91  ·  view source on GitHub ↗
(
    service: ToolsService,
    server_name: str,
    body: dict[str, Any],
)

Source from the content-addressed store, hash-verified

76
77
78def _test_config_body(
79 service: ToolsService,
80 server_name: str,
81 body: dict[str, Any],
82) -> dict[str, Any]:
83 config = body.get("mcp_server_config") or body.get("config")
84 if isinstance(config, dict):
85 return dict(config)
86
87 stored_config = service.get_mcp_server_config(server_name)
88 if stored_config is not None:
89 return stored_config
90
91 return {"name": server_name}
92
93
94def _raise_tools_error(exc: ToolsServiceError) -> None:

Callers 1

_test_mcp_serverFunction · 0.85

Calls 2

get_mcp_server_configMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected