diff --git a/PUBLIC_API_VERSION b/PUBLIC_API_VERSION index c5a26d7..390cef4 100644 --- a/PUBLIC_API_VERSION +++ b/PUBLIC_API_VERSION @@ -1 +1 @@ -3e9c6fa0a27454d8d5300c42e4215c475c3954b085dae9901f429d0c531e50f3 +586bfa02914633c65d476bb70379c809ad332873be958cd41d5032882561a606 diff --git a/pyproject.toml b/pyproject.toml index 89d4502..495c938 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "gradient-labs" -version = "0.13.0" +version = "0.13.1" description = "Python bindings for the Gradient Labs API" readme = "README.md" requires-python = ">=3.9,<4.0" diff --git a/src/gradient_labs/_tool_list.py b/src/gradient_labs/_tool_list.py index 11680d5..4a7430d 100644 --- a/src/gradient_labs/_tool_list.py +++ b/src/gradient_labs/_tool_list.py @@ -16,7 +16,7 @@ class ToolList: def list_tools(*, client: HttpClient) -> List[Tool]: - """list_tools retrieves all tools. + """Lists company tools and enabled MCP tools. Interactive tools are omitted. Note: requires a `Management` API key.""" rsp = client.get( path="tools", diff --git a/src/gradient_labs/_tool_read.py b/src/gradient_labs/_tool_read.py index 930d7bc..5cec440 100644 --- a/src/gradient_labs/_tool_read.py +++ b/src/gradient_labs/_tool_read.py @@ -7,7 +7,8 @@ def read_tool( *, client: HttpClient, tool_id: str, version: Optional[int] = None ) -> Tool: - """read_tool retrieves a tool. Leave version out to read its current version. + """Leave version out to read the current tool version. + Enabled MCP tools can be read by ID. Interactive tools return 404. Note: requires a `Management` API key.""" query_params = {} if version is not None: diff --git a/src/gradient_labs/_tool_update.py b/src/gradient_labs/_tool_update.py index d9c8e1e..488f51b 100644 --- a/src/gradient_labs/_tool_update.py +++ b/src/gradient_labs/_tool_update.py @@ -4,7 +4,9 @@ def update_tool(*, client: HttpClient, params: ToolUpdateParams) -> Tool: - """Update the supplied fields of a tool. + """Updates a webhook, HTTP, async or draft tool. + + Only draft tools can change kind. Edit repository-managed tools in their files. Note: requires a `Management` API key.""" body = without_none(params.to_dict()) diff --git a/src/gradient_labs/client.py b/src/gradient_labs/client.py index dcf6913..0865e8c 100644 --- a/src/gradient_labs/client.py +++ b/src/gradient_labs/client.py @@ -667,7 +667,8 @@ def execute_tool(self, *, params: ToolExecuteParams) -> ToolExecuteResult: ) def read_tool(self, *, tool_id: str, version: Optional[int] = None) -> Tool: - """read_tool retrieves a tool. Leave version out to read its current version. + """Leave version out to read the current tool version. + Enabled MCP tools can be read by ID. Interactive tools return 404. Note: requires a `Management` API key.""" return read_tool( @@ -677,7 +678,7 @@ def read_tool(self, *, tool_id: str, version: Optional[int] = None) -> Tool: ) def list_tools(self) -> List[Tool]: - """list_tools lists all tools. + """Lists company tools and enabled MCP tools. Interactive tools are omitted. Note: requires a `Management` API key.""" return list_tools( @@ -685,7 +686,9 @@ def list_tools(self) -> List[Tool]: ) def update_tool(self, *, params: ToolUpdateParams) -> Tool: - """Update the supplied fields of a tool. + """Updates a webhook, HTTP, async or draft tool. + + Only draft tools can change kind. Edit repository-managed tools in their files. Note: requires a `Management` API key.""" return update_tool( diff --git a/tests/test_new_operations.py b/tests/test_new_operations.py index 0f45e13..b837c7f 100644 --- a/tests/test_new_operations.py +++ b/tests/test_new_operations.py @@ -436,3 +436,18 @@ def test_rfc3339_fractional_seconds(fraction, microsecond): ) assert memory.created_at.microsecond == microsecond assert memory.created_at.utcoffset().total_seconds() == 0 + + +def test_list_tools_returns_enabled_mcp_tool(): + mcp = {"server_id": "mcpserver_1", "external_tool_name": "lookup_order"} + tool = { + "id": "tool_1", + "name": "lookup", + "description": "Look up an order", + "parameters": [], + "mcp": mcp, + } + client, _ = _client("get", {"tools": [tool]}) + (result,) = client.list_tools() + assert result.mcp.server_id == "mcpserver_1" + assert result.mcp.external_tool_name == "lookup_order" diff --git a/uv.lock b/uv.lock index 2d5a2a7..1d503f2 100644 --- a/uv.lock +++ b/uv.lock @@ -181,7 +181,7 @@ wheels = [ [[package]] name = "gradient-labs" -version = "0.13.0" +version = "0.13.1" source = { editable = "." } dependencies = [ { name = "dataclasses-json" },