Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.
fix: custom tool cache creation
angrybayblade committed
Aug 6, 2025 at 14:16 UTC
0b32a62304d545182ea83eb068800597e6497acc
2 files changed
+8
-4
python/composio/core/models/custom_tools.py
+4
-3
@@ -25,8 +25,9 @@ class ExecuteRequestFn(t.Protocol):
25
method: t.Literal["GET", "POST", "PUT", "DELETE", "PATCH"],
26
body: t.Dict | NotGiven = HttpClient.not_given,
27
connected_account_id: str | NotGiven = HttpClient.not_given,
28
- parameters: t.Iterable[tool_proxy_params.Parameter]
29
- | NotGiven = HttpClient.not_given,
28
+ parameters: (
29
+ t.Iterable[tool_proxy_params.Parameter] | NotGiven
30
+ ) = HttpClient.not_given,
31
) -> tool_proxy_response.ToolProxyResponse: ...
32
33
@@ -70,10 +71,10 @@ class CustomTool:
71
self.description = t.cast(str, f.__doc__)
72
self.toolkit = toolkit
73
self.client = client
73
- self.info = self.__parse_info()
74
if self.toolkit is not None:
75
self.name = f"{self.toolkit.lower()}_{self.name}"
76
self.slug = f"{self.toolkit.upper()}_{self.slug}"
77
+ self.info = self.__parse_info()
78
79
def __parse_info(self) -> Tool:
80
"""Parse the parameters of the custom tool."""
python/composio/core/models/tools.py
+4
-1
@@ -114,7 +114,10 @@ class Tools(Resource, t.Generic[TProvider]):
114
if tools is not None:
115
tools, custom_tools = self._filter_custom_tools(tools=tools)
116
tools_list.extend(custom_tools)
117
- tools_list.extend(self._client.tools.list(tool_slugs=",".join(tools)).items)
117
+ if len(tools):
118
+ tools_list.extend(
119
+ self._client.tools.list(tool_slugs=",".join(tools)).items
120
+ )
121
122
# Search tools by toolkit slugs and search term
123
if toolkits is not None or search is not None: