Home / Function/ _should_retry_tool() — langchain Function Reference

_should_retry_tool() — langchain Function Reference

Architecture documentation for the _should_retry_tool() function in tool_retry.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  5665de07_b809_7bb1_4e7f_e0409866de63["_should_retry_tool()"]
  33f83a05_ad1b_0c1c_e484_ac91455db157["ToolRetryMiddleware"]
  5665de07_b809_7bb1_4e7f_e0409866de63 -->|defined in| 33f83a05_ad1b_0c1c_e484_ac91455db157
  731777b2_3052_874d_7b48_c5d58d2e0a8c["wrap_tool_call()"]
  731777b2_3052_874d_7b48_c5d58d2e0a8c -->|calls| 5665de07_b809_7bb1_4e7f_e0409866de63
  e9a8e4d0_4a9e_0f20_9c10_65fc4f8ed225["awrap_tool_call()"]
  e9a8e4d0_4a9e_0f20_9c10_65fc4f8ed225 -->|calls| 5665de07_b809_7bb1_4e7f_e0409866de63
  style 5665de07_b809_7bb1_4e7f_e0409866de63 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/langchain_v1/langchain/agents/middleware/tool_retry.py lines 223–234

    def _should_retry_tool(self, tool_name: str) -> bool:
        """Check if retry logic should apply to this tool.

        Args:
            tool_name: Name of the tool being called.

        Returns:
            `True` if retry logic should apply, `False` otherwise.
        """
        if self._tool_filter is None:
            return True
        return tool_name in self._tool_filter

Domain

Subdomains

Frequently Asked Questions

What does _should_retry_tool() do?
_should_retry_tool() is a function in the langchain codebase, defined in libs/langchain_v1/langchain/agents/middleware/tool_retry.py.
Where is _should_retry_tool() defined?
_should_retry_tool() is defined in libs/langchain_v1/langchain/agents/middleware/tool_retry.py at line 223.
What calls _should_retry_tool()?
_should_retry_tool() is called by 2 function(s): awrap_tool_call, wrap_tool_call.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free