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

Method buildTools

internal/tui/model.go:686–693  ·  view source on GitHub ↗

buildTools exposes the four local tools every turn: bash, read_file, write_file, edit_file. No loop/control tool; a turn ends when the model stops emitting tool calls (see handleStreamClosed).

()

Source from the content-addressed store, hash-verified

684func (m *Model) buildMessages() []chmctx.Message {
685 ctxSize := m.activeContextSize()
686 budget := chmctx.Budget(ctxSize)
687 r := chmctx.Pack(m.history, budget)
688 out := make([]chmctx.Message, 0, len(r.Messages)+1)
689 out = append(out, chmctx.Message{Role: chmctx.RoleSystem, Content: m.system})
690 out = append(out, r.Messages...)
691 dbgWriteRequest(m.cfg.ActiveProfile().LLM, ctxSize, budget, len(m.history), out)
692 return out
693}
694
695// buildTools exposes the four local tools every turn: bash, read_file,
696// write_file, edit_file. No loop/control tool; a turn ends when the model

Callers 2

startChatMethod · 0.95

Calls 5

BashSchemaFunction · 0.92
ReadFileSchemaFunction · 0.92
WriteFileSchemaFunction · 0.92
EditFileSchemaFunction · 0.92
schemaToToolFunction · 0.85

Tested by 1