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 6f0540a3_65b1_70b4_ce28_d4ad7f2afd09["execute()"] d2acad16_3d69_9ffc_b385_3f353b4288f2["BetaAbstractMemoryTool"] 6f0540a3_65b1_70b4_ce28_d4ad7f2afd09 -->|defined in| d2acad16_3d69_9ffc_b385_3f353b4288f2 c1795f4c_e68a_1e1f_d9fb_ea2c6aae248d["call()"] c1795f4c_e68a_1e1f_d9fb_ea2c6aae248d -->|calls| 6f0540a3_65b1_70b4_ce28_d4ad7f2afd09 19b9272d_d835_6305_8e21_55eb6c8b2f96["execute()"] 19b9272d_d835_6305_8e21_55eb6c8b2f96 -->|calls| 6f0540a3_65b1_70b4_ce28_d4ad7f2afd09 819ec211_5934_b63a_723a_ba1f1eba16cb["view()"] 6f0540a3_65b1_70b4_ce28_d4ad7f2afd09 -->|calls| 819ec211_5934_b63a_723a_ba1f1eba16cb 0ece2516_b8ca_11b1_03fd_264c81bbd81d["create()"] 6f0540a3_65b1_70b4_ce28_d4ad7f2afd09 -->|calls| 0ece2516_b8ca_11b1_03fd_264c81bbd81d a877ff69_249a_dde6_6779_91863320f091["str_replace()"] 6f0540a3_65b1_70b4_ce28_d4ad7f2afd09 -->|calls| a877ff69_249a_dde6_6779_91863320f091 a8e570a9_f267_d6dd_f9fe_8f2094e09854["insert()"] 6f0540a3_65b1_70b4_ce28_d4ad7f2afd09 -->|calls| a8e570a9_f267_d6dd_f9fe_8f2094e09854 757cd931_8743_ce72_96e5_a33e8d974d1b["rename()"] 6f0540a3_65b1_70b4_ce28_d4ad7f2afd09 -->|calls| 757cd931_8743_ce72_96e5_a33e8d974d1b 19b9272d_d835_6305_8e21_55eb6c8b2f96["execute()"] 6f0540a3_65b1_70b4_ce28_d4ad7f2afd09 -->|calls| 19b9272d_d835_6305_8e21_55eb6c8b2f96 style 6f0540a3_65b1_70b4_ce28_d4ad7f2afd09 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
src/anthropic/lib/tools/_beta_builtin_memory_tool.py lines 75–98
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 self.view(command)
elif command.command == "create":
return self.create(command)
elif command.command == "str_replace":
return self.str_replace(command)
elif command.command == "insert":
return self.insert(command)
elif command.command == "delete":
return self.delete(command)
elif command.command == "rename":
return 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 75.
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