MCPcopy Create free account
hub / github.com/agent-tower/core / toolNameToAction

Function toolNameToAction

packages/server/src/output/cursor-agent-parser.ts:380–397  ·  view source on GitHub ↗

* 工具名称到动作类型的映射

(toolName: string)

Source from the content-addressed store, hash-verified

378 * 工具名称到动作类型的映射
379 */
380function toolNameToAction(toolName: string): ActionType {
381 const mapping: Record<string, ActionType> = {
382 shell: 'command_run',
383 read: 'file_read',
384 write: 'file_edit',
385 edit: 'file_edit',
386 delete: 'file_edit',
387 grep: 'search',
388 glob: 'search',
389 semsearch: 'search',
390 ls: 'other',
391 todo: 'todo_management',
392 mcp: 'tool',
393 web_search: 'search',
394 web_fetch: 'web_fetch',
395 };
396 return mapping[toolName] || 'tool';
397}
398
399/**
400 * Normalize Cursor todo status strings to standard format

Callers 2

handleToolCallMethod · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected