MCPcopy Create free account
hub / github.com/GongShichen/LuminaCode / NewSendMessageTool

Function NewSendMessageTool

agent/agent_tool.go:365–378  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

363}
364
365func NewSendMessageTool() coretools.Tool {
366 return newTaskTool("SendMessage", "Send a new prompt to an existing reusable worker. This only succeeds when the target worker is idle and ready for more work.", SendMessageInput{}, func(_ context.Context, execCtx coretools.ExecutionContext, input any) (string, error) {
367 rt, scope, err := runtimeAndScope(execCtx)
368 if err != "" {
369 return err, nil
370 }
371 in := derefSendMessage(input)
372 result := rt.SendMessage(in.TaskID, scope, in.Prompt)
373 if text, ok := result.(string); ok {
374 return text, nil
375 }
376 return jsonString(serializeTaskResult(result)), nil
377 })
378}
379
380func newTaskTool(name, description string, proto any, exec func(context.Context, coretools.ExecutionContext, any) (string, error)) coretools.Tool {
381 return &taskTool{

Calls 6

newTaskToolFunction · 0.85
runtimeAndScopeFunction · 0.85
derefSendMessageFunction · 0.85
jsonStringFunction · 0.85
serializeTaskResultFunction · 0.85
SendMessageMethod · 0.80