MCPcopy Create free account
hub / github.com/QuantGeekDev/docker-mcp / handle_call_tool

Function handle_call_tool

src/docker_mcp/server.py:151–167  ·  view source on GitHub ↗
(name: str, arguments: Dict[str, Any] | None)

Source from the content-addressed store, hash-verified

149
150@server.call_tool()
151async 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
170async def main():

Callers

nothing calls this directly

Calls 4

handle_deploy_composeMethod · 0.80
handle_get_logsMethod · 0.80

Tested by

no test coverage detected