MCPcopy Create free account
hub / github.com/astercloud/aster / formatToolCallLabelWeb

Function formatToolCallLabelWeb

examples/plan-explore-ui/static/main.js:238–272  ·  view source on GitHub ↗
(call)

Source from the content-addressed store, hash-verified

236 }
237
238 function formatToolCallLabelWeb(call) {
239 const name = call.name;
240 const args = call.arguments || {};
241
242 switch (name) {
243 case "Read": {
244 const path = getStringArgWeb(args, "file_path");
245 return path ? `Read(${path})` : "Read";
246 }
247 case "Glob": {
248 const pattern = getStringArgWeb(args, "pattern");
249 const root = getStringArgWeb(args, "root");
250 if (pattern && root) return `Glob(${pattern}, root=${root})`;
251 if (pattern) return `Glob(${pattern})`;
252 return "Glob";
253 }
254 case "Grep": {
255 const pattern = getStringArgWeb(args, "pattern");
256 const path = getStringArgWeb(args, "path");
257 if (pattern && path) return `Grep("${pattern}" in ${path})`;
258 if (pattern) return `Grep("${pattern}")`;
259 return "Grep";
260 }
261 case "Bash": {
262 let cmd = getStringArgWeb(args, "command");
263 if (!cmd) return "Bash";
264 if (cmd.length > 40) cmd = cmd.slice(0, 37) + "...";
265 return `Bash(${cmd})`;
266 }
267 case "ExitPlanMode":
268 return "ExitPlanMode(plan)";
269 default:
270 return name || "";
271 }
272 }
273})();

Callers 1

renderToolStartWebFunction · 0.85

Calls 1

getStringArgWebFunction · 0.85

Tested by

no test coverage detected