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

Method GetStatus

server/handlers/tool_runtime.go:23–52  ·  view source on GitHub ↗

GetStatus 获取指定调用的状态

(c *gin.Context)

Source from the content-addressed store, hash-verified

21
22// GetStatus 获取指定调用的状态
23func (h *ToolRuntimeHandler) GetStatus(c *gin.Context) {
24 agentID := c.Query("agent_id")
25 callID := c.Param("id")
26 if agentID == "" || callID == "" {
27 c.JSON(http.StatusBadRequest, gin.H{"error": "agent_id and call id are required"})
28 return
29 }
30
31 if snap := h.runtimeSnapshot(agentID, callID); snap != nil {
32 c.JSON(http.StatusOK, gin.H{"status": snap})
33 return
34 }
35
36 records, err := (*h.store).LoadToolCallRecords(c.Request.Context(), agentID)
37 if err != nil {
38 c.JSON(http.StatusInternalServerError, gin.H{"error": err.Error()})
39 return
40 }
41
42 for _, rec := range records {
43 if rec.ID == callID {
44 c.JSON(http.StatusOK, gin.H{
45 "status": mapRecordToSnapshot(&rec),
46 })
47 return
48 }
49 }
50
51 c.JSON(http.StatusNotFound, gin.H{"error": "call not found"})
52}
53
54// ListRunning 返回运行中的工具调用
55func (h *ToolRuntimeHandler) ListRunning(c *gin.Context) {

Callers

nothing calls this directly

Calls 7

runtimeSnapshotMethod · 0.95
mapRecordToSnapshotFunction · 0.85
JSONMethod · 0.80
QueryMethod · 0.65
LoadToolCallRecordsMethod · 0.65
ContextMethod · 0.65
ErrorMethod · 0.65

Tested by

no test coverage detected