MCPcopy Create free account
hub / github.com/aws/amazon-q-developer-cli / remove_by_name

Method remove_by_name

crates/chat-cli/src/util/knowledge_store.rs:482–491  ·  view source on GitHub ↗

Remove context by name

(&mut self, name: &str)

Source from the content-addressed store, hash-verified

480
481 /// Remove context by name
482 pub async fn remove_by_name(&mut self, name: &str) -> Result<(), String> {
483 if let Some(context) = self.agent_client.get_context_by_name(name).await {
484 self.agent_client
485 .remove_context_by_id(&context.id)
486 .await
487 .map_err(|e| e.to_string())
488 } else {
489 Err(format!("No context found with name '{}'", name))
490 }
491 }
492
493 /// Remove context by ID
494 pub async fn remove_by_id(&mut self, context_id: &str) -> Result<(), String> {

Callers 2

invokeMethod · 0.80
handle_removeMethod · 0.80

Calls 3

to_stringMethod · 0.80
get_context_by_nameMethod · 0.45
remove_context_by_idMethod · 0.45

Tested by

no test coverage detected