Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion PUBLIC_API_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3e9c6fa0a27454d8d5300c42e4215c475c3954b085dae9901f429d0c531e50f3
586bfa02914633c65d476bb70379c809ad332873be958cd41d5032882561a606
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
2 changes: 1 addition & 1 deletion src/gradient_labs/_tool_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
3 changes: 2 additions & 1 deletion src/gradient_labs/_tool_read.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
4 changes: 3 additions & 1 deletion src/gradient_labs/_tool_update.py
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down
9 changes: 6 additions & 3 deletions src/gradient_labs/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -677,15 +678,17 @@ 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(
client=self.http_client,
)

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(
Expand Down
15 changes: 15 additions & 0 deletions tests/test_new_operations.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
2 changes: 1 addition & 1 deletion uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading