MCPcopy Create free account
hub / github.com/AQ-MedAI/MedMemoryBench / attach_tool

Method attach_tool

methods/letta/client/client.py:707–721  ·  view source on GitHub ↗

Add tool to an existing agent Args: agent_id (str): ID of the agent tool_id (str): A tool id Returns: agent_state (AgentState): State of the updated agent

(self, agent_id: str, tool_id: str)

Source from the content-addressed store, hash-verified

705 return [Tool(**tool) for tool in response.json()]
706
707 def attach_tool(self, agent_id: str, tool_id: str) -> AgentState:
708 """
709 Add tool to an existing agent
710
711 Args:
712 agent_id (str): ID of the agent
713 tool_id (str): A tool id
714
715 Returns:
716 agent_state (AgentState): State of the updated agent
717 """
718 response = requests.patch(f"{self.base_url}/{self.api_prefix}/agents/{agent_id}/tools/attach/{tool_id}", headers=self.headers)
719 if response.status_code != 200:
720 raise ValueError(f"Failed to update agent: {response.text}")
721 return AgentState(**response.json())
722
723 def detach_tool(self, agent_id: str, tool_id: str) -> AgentState:
724 """

Callers 2

attach_toolMethod · 0.45
stepMethod · 0.45

Calls 3

AgentStateClass · 0.90
patchMethod · 0.80
jsonMethod · 0.45

Tested by

no test coverage detected