execute() — anthropic-sdk-python Function Reference
Architecture documentation for the execute() function in _beta_builtin_memory_tool.py from the anthropic-sdk-python codebase.
Entity Profile
Dependency Diagram
graph TD 19b9272d_d835_6305_8e21_55eb6c8b2f96["execute()"] a0c776a7_63ce_9752_6068_14794f180e7d["BetaAsyncAbstractMemoryTool"] 19b9272d_d835_6305_8e21_55eb6c8b2f96 -->|defined in| a0c776a7_63ce_9752_6068_14794f180e7d 6f0540a3_65b1_70b4_ce28_d4ad7f2afd09["execute()"] 6f0540a3_65b1_70b4_ce28_d4ad7f2afd09 -->|calls| 19b9272d_d835_6305_8e21_55eb6c8b2f96 cd7c56a6_976c_8d3b_3975_2c30ce839874["call()"] cd7c56a6_976c_8d3b_3975_2c30ce839874 -->|calls| 19b9272d_d835_6305_8e21_55eb6c8b2f96 f055f63a_c08c_67ec_6945_96f5aba95a16["view()"] 19b9272d_d835_6305_8e21_55eb6c8b2f96 -->|calls| f055f63a_c08c_67ec_6945_96f5aba95a16 0d62f96b_9675_c053_7ae8_5d58680e01d1["create()"] 19b9272d_d835_6305_8e21_55eb6c8b2f96 -->|calls| 0d62f96b_9675_c053_7ae8_5d58680e01d1 18e36d35_e1f1_40ea_0eeb_cfa2d4e034bf["str_replace()"] 19b9272d_d835_6305_8e21_55eb6c8b2f96 -->|calls| 18e36d35_e1f1_40ea_0eeb_cfa2d4e034bf 7398632d_dacc_dd76_2fbd_666fa697ea60["insert()"] 19b9272d_d835_6305_8e21_55eb6c8b2f96 -->|calls| 7398632d_dacc_dd76_2fbd_666fa697ea60 8954cd86_9574_d593_3805_ee2a036111b3["rename()"] 19b9272d_d835_6305_8e21_55eb6c8b2f96 -->|calls| 8954cd86_9574_d593_3805_ee2a036111b3 6f0540a3_65b1_70b4_ce28_d4ad7f2afd09["execute()"] 19b9272d_d835_6305_8e21_55eb6c8b2f96 -->|calls| 6f0540a3_65b1_70b4_ce28_d4ad7f2afd09 style 19b9272d_d835_6305_8e21_55eb6c8b2f96 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
src/anthropic/lib/tools/_beta_builtin_memory_tool.py lines 188–211
async def execute(self, command: BetaMemoryTool20250818Command) -> BetaFunctionToolResultType:
"""Execute a memory command and return the result.
This method dispatches to the appropriate handler method based on the
command type (view, create, str_replace, insert, delete, rename).
You typically don't need to override this method.
"""
if command.command == "view":
return await self.view(command)
elif command.command == "create":
return await self.create(command)
elif command.command == "str_replace":
return await self.str_replace(command)
elif command.command == "insert":
return await self.insert(command)
elif command.command == "delete":
return await self.delete(command)
elif command.command == "rename":
return await self.rename(command)
elif TYPE_CHECKING: # type: ignore[unreachable]
assert_never(command)
else:
raise NotImplementedError(f"Unknown command: {command.command}")
Domain
Subdomains
Source
Frequently Asked Questions
What does execute() do?
execute() is a function in the anthropic-sdk-python codebase, defined in src/anthropic/lib/tools/_beta_builtin_memory_tool.py.
Where is execute() defined?
execute() is defined in src/anthropic/lib/tools/_beta_builtin_memory_tool.py at line 188.
What does execute() call?
execute() calls 6 function(s): create, execute, insert, rename, str_replace, view.
What calls execute()?
execute() is called by 2 function(s): call, execute.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free