(name: str, arguments: Dict[str, Any] | None)
| 149 | |
| 150 | @server.call_tool() |
| 151 | async def handle_call_tool(name: str, arguments: Dict[str, Any] | None) -> List[types.TextContent]: |
| 152 | if not arguments and name != "list-containers": |
| 153 | raise ValueError("Missing arguments") |
| 154 | |
| 155 | try: |
| 156 | if name == "create-container": |
| 157 | return await DockerHandlers.handle_create_container(arguments) |
| 158 | elif name == "deploy-compose": |
| 159 | return await DockerHandlers.handle_deploy_compose(arguments) |
| 160 | elif name == "get-logs": |
| 161 | return await DockerHandlers.handle_get_logs(arguments) |
| 162 | elif name == "list-containers": |
| 163 | return await DockerHandlers.handle_list_containers(arguments) |
| 164 | else: |
| 165 | raise ValueError(f"Unknown tool: {name}") |
| 166 | except Exception as e: |
| 167 | return [types.TextContent(type="text", text=f"Error: {str(e)} | Arguments: {arguments}")] |
| 168 | |
| 169 | |
| 170 | async def main(): |
nothing calls this directly
no test coverage detected