MCPcopy Create free account
hub / github.com/anomalyco/opencode / toToolKind

Function toToolKind

packages/opencode/src/acp/tool.ts:38–71  ·  view source on GitHub ↗
(toolName: string)

Source from the content-addressed store, hash-verified

36}
37
38export function toToolKind(toolName: string): ToolKind {
39 const tool = toolName.toLocaleLowerCase()
40
41 switch (tool) {
42 case "bash":
43 case "shell":
44 return "execute"
45
46 case "webfetch":
47 return "fetch"
48
49 case "edit":
50 case "apply_patch":
51 case "patch":
52 case "write":
53 return "edit"
54
55 case "grep":
56 case "glob":
57 case "context":
58 case "context7_resolve_library_id":
59 case "context7_get_library_docs":
60 return "search"
61
62 case "read":
63 return "read"
64
65 case "task":
66 return "think"
67
68 default:
69 return "other"
70 }
71}
72
73export function toLocations(toolName: string, input: ToolInput, cwd?: string): ToolCallLocation[] {
74 const tool = toolName.toLocaleLowerCase()

Callers 6

tool.test.tsFile · 0.90
completedToolContentFunction · 0.85
pendingToolCallFunction · 0.85
runningToolUpdateFunction · 0.85
errorToolUpdateFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected