MCPcopy Index your code
hub / github.com/docker/docker-agent / emitToolsChanged

Method emitToolsChanged

pkg/runtime/runtime.go:1414–1426  ·  view source on GitHub ↗

emitToolsChanged is the callback registered on MCP toolsets. It re-reads the current agent's full tool list and pushes a ToolsetInfo event.

()

Source from the content-addressed store, hash-verified

1412// emitToolsChanged is the callback registered on MCP toolsets. It re-reads
1413// the current agent's full tool list and pushes a ToolsetInfo event.
1414func (r *LocalRuntime) emitToolsChanged() {
1415 if r.onToolsChanged == nil {
1416 return
1417 }
1418 ctx, cancel := context.WithTimeout(r.ctx(), toolsChangedTimeout)
1419 defer cancel()
1420 a := r.CurrentAgent()
1421 agentTools, err := a.StartedTools(ctx)
1422 if err != nil {
1423 return
1424 }
1425 r.onToolsChanged(ToolsetInfo(len(agentTools), false, r.currentAgentName()))
1426}
1427
1428// emitAgentAndTeamInfo sends the AgentInfo and TeamInfo events that drive the
1429// sidebar's agent/model/thinking display. It returns false when sending was

Callers

nothing calls this directly

Calls 4

CurrentAgentMethod · 0.95
currentAgentNameMethod · 0.95
ToolsetInfoFunction · 0.85
StartedToolsMethod · 0.80

Tested by

no test coverage detected