Skip to content

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 registry usage

angrybayblade3b5585d12676
diff --git a/python/composio/core/models/base.py b/python/composio/core/models/base.py
index 4acae874c..1797371c5 100644
--- a/python/composio/core/models/base.py
+++ b/python/composio/core/models/base.py
@@ -71,7 +71,7 @@ class ResourceMeta(type):
def __init__(cls, name, bases, attrs):
for attr in attrs:
- if "__" in attr or not callable(getattr(cls, attr)):
+ if attr.startswith("_") or not callable(getattr(cls, attr)):
continue
setattr(cls, attr, trace_method(getattr(cls, attr), f"{name}.{attr}"))
diff --git a/python/composio/core/models/custom_tools.py b/python/composio/core/models/custom_tools.py
index 1a10edeb6..541f47740 100644
--- a/python/composio/core/models/custom_tools.py
+++ b/python/composio/core/models/custom_tools.py
@@ -84,7 +84,7 @@ class CustomTool:
return Tool(
name=self.name,
description=self.description,
- input_parameters={},
+ input_parameters=self.request_model.model_json_schema(),
output_parameters={},
available_versions=[],
version="1.0.0",
diff --git a/python/composio/core/models/tools.py b/python/composio/core/models/tools.py
index dcd679bb6..8c0ac9c8c 100644
--- a/python/composio/core/models/tools.py
+++ b/python/composio/core/models/tools.py
@@ -80,7 +80,7 @@ class Tools(Resource, t.Generic[TProvider]):
_custom_tools = []
for tool in tools:
try:
- _custom_tools.append(t.cast(Tool, self._custom_tools[tool]))
+ _custom_tools.append(self._custom_tools[tool].info)
except KeyError:
_tools.append(tool)
return _tools, _custom_tools
@@ -307,7 +307,9 @@ class Tools(Resource, t.Generic[TProvider]):
arguments: t.Dict,
connected_account_id: t.Optional[str] = None,
custom_auth_params: t.Optional[tool_execute_params.CustomAuthParams] = None,
- custom_connection_data: t.Optional[tool_execute_params.CustomConnectionData] = None,
+ custom_connection_data: t.Optional[
+ tool_execute_params.CustomConnectionData
+ ] = None,
user_id: t.Optional[str] = None,
text: t.Optional[str] = None,
version: t.Optional[str] = None,
@@ -339,7 +341,9 @@ class Tools(Resource, t.Generic[TProvider]):
*,
connected_account_id: t.Optional[str] = None,
custom_auth_params: t.Optional[tool_execute_params.CustomAuthParams] = None,
- custom_connection_data: t.Optional[tool_execute_params.CustomConnectionData] = None,
+ custom_connection_data: t.Optional[
+ tool_execute_params.CustomConnectionData
+ ] = None,
user_id: t.Optional[str] = None,
text: t.Optional[str] = None,
version: t.Optional[str] = None,