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

Method QueryAgent

pkg/asteros/interfaces/a2a.go:164–179  ·  view source on GitHub ↗

QueryAgent 查询 Agent 状态

(agentID string)

Source from the content-addressed store, hash-verified

162
163// QueryAgent 查询 Agent 状态
164func (i *A2AInterface) QueryAgent(agentID string) (map[string]any, error) {
165 i.mu.RLock()
166 defer i.mu.RUnlock()
167
168 ag, exists := i.agents[agentID]
169 if !exists {
170 return nil, fmt.Errorf("agent not found: %s", agentID)
171 }
172
173 status := ag.Status()
174
175 return map[string]any{
176 "agent_id": status.AgentID,
177 "state": status.State,
178 }, nil
179}
180
181// ListAgents 列出所有可用的 Agents
182func (i *A2AInterface) ListAgents() []string {

Callers

nothing calls this directly

Calls 1

StatusMethod · 0.45

Tested by

no test coverage detected