MCPcopy Index your code
hub / github.com/codeaashu/claude-code / MCPToolListView

Function MCPToolListView

src/components/mcp/MCPToolListView.tsx:20–134  ·  view source on GitHub ↗
(t0)

Source from the content-addressed store, hash-verified

18 onBack: () => void;
19};
20export function MCPToolListView(t0) {
21 const $ = _c(21);
22 const {
23 server,
24 onSelectTool,
25 onBack
26 } = t0;
27 const mcpTools = useAppState(_temp);
28 let t1;
29 bb0: {
30 if (server.client.type !== "connected") {
31 let t2;
32 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
33 t2 = [];
34 $[0] = t2;
35 } else {
36 t2 = $[0];
37 }
38 t1 = t2;
39 break bb0;
40 }
41 let t2;
42 if ($[1] !== mcpTools || $[2] !== server.name) {
43 t2 = filterToolsByServer(mcpTools, server.name);
44 $[1] = mcpTools;
45 $[2] = server.name;
46 $[3] = t2;
47 } else {
48 t2 = $[3];
49 }
50 t1 = t2;
51 }
52 const serverTools = t1;
53 let t2;
54 if ($[4] !== server.name || $[5] !== serverTools) {
55 let t3;
56 if ($[7] !== server.name) {
57 t3 = (tool, index) => {
58 const toolName = getMcpDisplayName(tool.name, server.name);
59 const fullDisplayName = tool.userFacingName ? tool.userFacingName({}) : toolName;
60 const displayName = extractMcpToolDisplayName(fullDisplayName);
61 const isReadOnly = tool.isReadOnly?.({}) ?? false;
62 const isDestructive = tool.isDestructive?.({}) ?? false;
63 const isOpenWorld = tool.isOpenWorld?.({}) ?? false;
64 const annotations = [];
65 if (isReadOnly) {
66 annotations.push("read-only");
67 }
68 if (isDestructive) {
69 annotations.push("destructive");
70 }
71 if (isOpenWorld) {
72 annotations.push("open-world");
73 }
74 return {
75 label: displayName,
76 value: index.toString(),
77 description: annotations.length > 0 ? annotations.join(", ") : undefined,

Callers

nothing calls this directly

Calls 7

useAppStateFunction · 0.85
filterToolsByServerFunction · 0.85
getMcpDisplayNameFunction · 0.85
pluralFunction · 0.85
toStringMethod · 0.65
pushMethod · 0.45

Tested by

no test coverage detected