MCPcopy Create free account
hub / github.com/1jehuang/jcode / format_tool

Function format_tool

scripts/jcode_monitor.py:122–130  ·  view source on GitHub ↗

Format a tool name with appropriate color

(name: str, status: str = "active")

Source from the content-addressed store, hash-verified

120
121
122def format_tool(name: str, status: str = "active") -> str:
123 """Format a tool name with appropriate color"""
124 if status == "active":
125 return f"{Colors.CYAN}{Colors.BOLD}{name}{Colors.RESET}"
126 elif status == "done":
127 return f"{Colors.GREEN}{name}{Colors.RESET}"
128 elif status == "error":
129 return f"{Colors.RED}{name}{Colors.RESET}"
130 return name
131
132
133def truncate(s: str, max_len: int) -> str:

Callers 1

render_dashboardFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected