MCPcopy Index your code
hub / github.com/ChrisFeldmeier/OpenCodeRust / list_agents

Method list_agents

crates/opencode-tui/src/api.rs:462–475  ·  view source on GitHub ↗
(&self)

Source from the content-addressed store, hash-verified

460 }
461
462 pub fn list_agents(&self) -> anyhow::Result<Vec<AgentInfo>> {
463 let url = format!("{}/agent", self.base_url);
464
465 let response = self.client.get(&url).send()?;
466
467 if !response.status().is_success() {
468 let status = response.status();
469 let text = response.text().unwrap_or_default();
470 anyhow::bail!("Failed to list agents: {} - {}", status, text);
471 }
472
473 let agents: Vec<AgentInfo> = response.json()?;
474 Ok(agents)
475 }
476
477 pub fn list_skills(&self) -> anyhow::Result<Vec<String>> {
478 let url = format!("{}/skill", self.base_url);

Callers 1

refresh_agent_dialogMethod · 0.80

Calls 4

sendMethod · 0.45
getMethod · 0.45
statusMethod · 0.45
textMethod · 0.45

Tested by

no test coverage detected