MCPcopy Create free account
hub / github.com/apache/maka / settleToolCall

Method settleToolCall

packages/runtime/src/tool-runtime.ts:694–718  ·  view source on GitHub ↗

* Settle one resolved Maka tool call. Tool/business failures resolve with a * provider-facing error output; durable runtime commit failures still reject.

(call: ResolvedMakaToolCall)

Source from the content-addressed store, hash-verified

692 * provider-facing error output; durable runtime commit failures still reject.
693 */
694 async settleToolCall(call: ResolvedMakaToolCall): Promise<ToolSettlement> {
695 const settlement = await this.settleToolCallRaw(call);
696 const modelOutput = settlement.providerError
697 ? call.tool.providerTool?.kind === 'openai-apply-patch'
698 ? {
699 type: 'json' as const,
700 value: { status: 'failed' as const, output: settlement.providerError },
701 }
702 : { type: 'error-text' as const, value: new Error(settlement.providerError).toString() }
703 : call.tool.toModelOutput
704 ? await call.tool.toModelOutput({
705 toolCallId: call.toolCallId,
706 input: call.input,
707 output: settlement.result,
708 })
709 : this.input.materializeDefaultToolResultOutput
710 ? await this.input.materializeDefaultToolResultOutput({
711 toolCallId: call.toolCallId,
712 output: settlement.result,
713 })
714 : typeof settlement.result === 'string'
715 ? { type: 'text' as const, value: settlement.result }
716 : { type: 'json' as const, value: jsonValue(settlement.result) };
717 return { result: settlement.result, modelOutput };
718 }
719
720 /**
721 * Settle a tool without producing provider-visible output. Runtime-owned

Calls 2

settleToolCallRawMethod · 0.95
jsonValueFunction · 0.85

Tested by 12

runFunction · 0.64
runtimeExecuteFunction · 0.64
makeHarnessFunction · 0.64
settleFunction · 0.64
settleFunction · 0.64
runToolFunction · 0.64
persistedFunction · 0.64
settleFunction · 0.64
invokeFunction · 0.64
executeToolFunction · 0.64
callFunction · 0.64
settleToolFunction · 0.64