MCPcopy Create free account
hub / github.com/astercloud/aster / NewToolCallRecord

Function NewToolCallRecord

pkg/tools/executor.go:149–170  ·  view source on GitHub ↗

NewToolCallRecord 创建工具调用记录

(id, name string, input map[string]any)

Source from the content-addressed store, hash-verified

147
148// NewToolCallRecord 创建工具调用记录
149func NewToolCallRecord(id, name string, input map[string]any) *ToolCallRecordBuilder {
150 now := time.Now()
151 return &ToolCallRecordBuilder{
152 record: &types.ToolCallRecord{
153 ID: id,
154 Name: name,
155 Input: input,
156 State: types.ToolCallStatePending,
157 Approval: types.ToolCallApproval{Required: false},
158 Progress: 0,
159 CreatedAt: now,
160 UpdatedAt: now,
161 AuditTrail: []types.ToolCallAuditEntry{
162 {
163 State: types.ToolCallStatePending,
164 Timestamp: now,
165 Note: "created",
166 },
167 },
168 },
169 }
170}
171
172// SetState 设置状态
173func (b *ToolCallRecordBuilder) SetState(state types.ToolCallState, note string) *ToolCallRecordBuilder {

Callers 1

executeSingleToolMethod · 0.92

Calls

no outgoing calls

Tested by

no test coverage detected