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

Function errorToolUpdate

packages/opencode/src/acp/tool.ts:201–228  ·  view source on GitHub ↗
(input: {
  readonly toolCallId: string
  readonly toolName: string
  readonly state: ErrorToolState
  readonly cwd?: string
})

Source from the content-addressed store, hash-verified

199}
200
201export function errorToolUpdate(input: {
202 readonly toolCallId: string
203 readonly toolName: string
204 readonly state: ErrorToolState
205 readonly cwd?: string
206}): ToolCallUpdate {
207 return {
208 toolCallId: input.toolCallId,
209 status: "failed",
210 kind: toToolKind(input.toolName),
211 title: toolTitle(input.toolName, input.state.input, undefined),
212 locations: toLocations(input.toolName, input.state.input, input.cwd),
213 rawInput: rawInput(input.toolName, input.state.input, input.cwd),
214 content: [
215 {
216 type: "content",
217 content: {
218 type: "text",
219 text: input.state.error,
220 },
221 },
222 ],
223 rawOutput: {
224 error: input.state.error,
225 metadata: input.state.metadata,
226 },
227 }
228}
229
230export function completedToolRawOutput(state: CompletedToolState) {
231 return {

Callers 1

handleToolPartMethod · 0.90

Calls 4

toToolKindFunction · 0.85
toolTitleFunction · 0.85
toLocationsFunction · 0.85
rawInputFunction · 0.85

Tested by

no test coverage detected