MCPcopy Index your code
hub / github.com/codehamr/codehamr / Execute

Function Execute

internal/tools/bash.go:125–133  ·  view source on GitHub ↗

Execute runs a tool call and returns the (possibly truncated) result ready to be appended to the conversation as a `tool` message.

(parent context.Context, call chmctx.ToolCall)

Source from the content-addressed store, hash-verified

123// Execute runs a tool call and returns the (possibly truncated) result ready
124// to be appended to the conversation as a `tool` message.
125func Execute(parent context.Context, call chmctx.ToolCall) chmctx.Message {
126 raw := runRaw(parent, call)
127 return chmctx.Message{
128 Role: chmctx.RoleTool,
129 Content: chmctx.Truncate(raw),
130 ToolCallID: call.ID,
131 ToolName: call.Name,
132 }
133}
134
135func runRaw(parent context.Context, call chmctx.ToolCall) string {
136 // A truncated/oversized tool call leaves llm.resolve()'s _parse_error

Calls 1

runRawFunction · 0.85