MCPcopy Create free account
hub / github.com/MiniCodeMonkey/chief / cursorToolCallNameAndInput

Function cursorToolCallNameAndInput

internal/loop/cursor_parser.go:235–331  ·  view source on GitHub ↗

cursorToolCallNameAndInput returns display name (PascalCase for TUI icons) and optional ToolInput for the log.

(tc *cursorToolCall)

Source from the content-addressed store, hash-verified

233
234// cursorToolCallNameAndInput returns display name (PascalCase for TUI icons) and optional ToolInput for the log.
235func cursorToolCallNameAndInput(tc *cursorToolCall) (name string, input map[string]interface{}) {
236 if tc.ReadToolCall != nil {
237 input = make(map[string]interface{})
238 if path, ok := tc.ReadToolCall.Args["path"].(string); ok {
239 input["file_path"] = path
240 }
241 return "Read", input
242 }
243 if tc.WriteToolCall != nil {
244 input = make(map[string]interface{})
245 if path, ok := tc.WriteToolCall.Args["path"].(string); ok {
246 input["file_path"] = path
247 }
248 return "Write", input
249 }
250 if tc.EditToolCall != nil {
251 input = make(map[string]interface{})
252 if path, ok := tc.EditToolCall.Args["path"].(string); ok {
253 input["file_path"] = path
254 }
255 return "Edit", input
256 }
257 if tc.ShellToolCall != nil {
258 input = make(map[string]interface{})
259 if cmd, ok := tc.ShellToolCall.Args["command"].(string); ok {
260 input["command"] = cmd
261 }
262 return "Bash", input
263 }
264 if tc.GrepToolCall != nil {
265 input = make(map[string]interface{})
266 if pattern, ok := tc.GrepToolCall.Args["pattern"].(string); ok {
267 input["pattern"] = pattern
268 }
269 if path, ok := tc.GrepToolCall.Args["path"].(string); ok {
270 input["path"] = path
271 }
272 return "Grep", input
273 }
274 if tc.GlobToolCall != nil {
275 input = make(map[string]interface{})
276 if pattern, ok := tc.GlobToolCall.Args["globPattern"].(string); ok {
277 input["pattern"] = pattern
278 }
279 if dir, ok := tc.GlobToolCall.Args["targetDirectory"].(string); ok {
280 input["path"] = dir
281 }
282 return "Glob", input
283 }
284 if tc.LsToolCall != nil {
285 input = make(map[string]interface{})
286 if path, ok := tc.LsToolCall.Args["path"].(string); ok {
287 input["path"] = path
288 }
289 return "List", input
290 }
291 if tc.DeleteToolCall != nil {
292 input = make(map[string]interface{})

Callers 1

parseCursorToolCallFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected