MCPcopy
hub / github.com/smittix/intercept / get_agent

Function get_agent

utils/database.py:2280–2287  ·  view source on GitHub ↗

Get an agent by ID.

(agent_id: int)

Source from the content-addressed store, hash-verified

2278
2279
2280def get_agent(agent_id: int) -> dict | None:
2281 """Get an agent by ID."""
2282 with get_db() as conn:
2283 cursor = conn.execute("SELECT * FROM agents WHERE id = ?", (agent_id,))
2284 row = cursor.fetchone()
2285 if not row:
2286 return None
2287 return _row_to_agent(row)
2288
2289
2290def get_agent_by_name(name: str) -> dict | None:

Callers 15

register_agentFunction · 0.90
get_agent_detailFunction · 0.90
update_agent_detailFunction · 0.90
remove_agentFunction · 0.90
refresh_agent_metadataFunction · 0.90
get_agent_statusFunction · 0.90
proxy_start_modeFunction · 0.90
proxy_stop_modeFunction · 0.90
proxy_mode_statusFunction · 0.90
proxy_mode_dataFunction · 0.90
proxy_mode_streamFunction · 0.90
proxy_wifi_monitorFunction · 0.90

Calls 2

get_dbFunction · 0.85
_row_to_agentFunction · 0.85

Tested by 6

test_get_agentMethod · 0.72
test_update_agentMethod · 0.72
test_delete_agentMethod · 0.72