MCPcopy Index your code
hub / github.com/anomalyco/opencode / tool

Function tool

packages/opencode/src/cli/cmd/run.ts:90–106  ·  view source on GitHub ↗
(part: ToolPart)

Source from the content-addressed store, hash-verified

88}
89
90async function tool(part: ToolPart) {
91 try {
92 const { toolInlineInfo } = await import("./run/tool")
93 const next = toolInlineInfo(part)
94 if (next.mode === "block") {
95 block(next, next.body)
96 return
97 }
98
99 inline(next)
100 } catch {
101 inline({
102 icon: "\u2699",
103 title: part.tool,
104 })
105 }
106}
107
108async function toolError(part: ToolPart) {
109 try {

Callers 3

loopFunction · 0.70
tools.tsFile · 0.50

Calls 3

toolInlineInfoFunction · 0.85
blockFunction · 0.70
inlineFunction · 0.70

Tested by

no test coverage detected