Tools
List Tools
Lists all workspace tools. By default, returns all tools in a single response. Setlimit to enable cursor-based pagination with starting_after and ending_before.
from orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.tools.list(limit=300)
# Handle response
print(res)
Show Parameters
Show Parameters
{
"limit": Optional[float],
"starting_after": Optional[str],
"ending_before": Optional[str],
}
Show Response
Show Response
{
"object": Literal["list"],
"data": Union[DataFunctionTool, DataJSONSchemaTool, DataHTTPTool, DataMCPTool, DataCodeExecutionTool],
"has_more": bool,
}
Create a Tool
Creates a new tool in the workspace.import orq_ai_sdk
from orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.tools.create(request=orq_ai_sdk.RequestBodyJSONSchemaTool(
path="Default",
key="<key>",
description="runway border pro mortally recount accredit promptly",
status="live",
type="json_schema",
json_schema=orq_ai_sdk.RequestBodyJSONSchema(
name="<value>",
description="lovable past madly uh-huh by",
schema_=orq_ai_sdk.RequestBodySchema(
type="<value>",
properties={
"key": "<value>",
},
required=[],
),
),
))
# Handle response
print(res)
Show Parameters
Show Parameters
{
"path": str, # required
"key": str, # required
"display_name": Optional[str],
"description": str, # required
"status": Optional[Literal["live", "draft", "pending", "published"]],
"type": Literal["function"], # required
"function": { # required
"name": str, # required
"description": Optional[str],
"strict": Optional[bool],
"parameters": { # optional
"type": Literal["object"], # required
"properties": Dict[str, Any], # required
"required": List[str], # required
"__pydantic_extra__": Dict[str, Any],
},
},
}
Show Response
Show Response
{
"id": Optional[str],
"path": str,
"key": str,
"display_name": Optional[str],
"description": str,
"created_by_id": Optional[str],
"updated_by_id": Optional[str],
"project_id": str,
"workspace_id": str,
"created": str,
"updated": str,
"status": Optional[Literal["live", "draft", "pending", "published"]],
"type": Literal["function"],
"function": {
"name": str,
"description": Optional[str],
"strict": Optional[bool],
"parameters": { # optional
"type": Literal["object"],
"properties": Dict[str, Any],
"required": List[str],
"__pydantic_extra__": Dict[str, Any],
},
},
}
Update a Tool
Updates a tool in the workspace.import orq_ai_sdk
from orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.tools.update(tool_id="<id>", request_body=orq_ai_sdk.UpdateFunctionTool(
path="Default",
status="live",
type="function",
))
# Handle response
print(res)
Show Parameters
Show Parameters
{
"tool_id": str, # required
"request_body": Union[UpdateFunctionTool, UpdateJSONSchemaTool, UpdateHTTPTool, UpdateMCPTool, UpdateCodeExecutionTool],
}
Show Response
Show Response
{
"id": Optional[str],
"path": str,
"key": str,
"display_name": Optional[str],
"description": str,
"created_by_id": Optional[str],
"updated_by_id": Optional[str],
"project_id": str,
"workspace_id": str,
"created": str,
"updated": str,
"status": Optional[Literal["live", "draft", "pending", "published"]],
"type": Literal["function"],
"function": {
"name": str,
"description": Optional[str],
"strict": Optional[bool],
"parameters": { # optional
"type": Literal["object"],
"properties": Dict[str, Any],
"required": List[str],
"__pydantic_extra__": Dict[str, Any],
},
},
}
Delete a Tool
Deletes a tool by key.from orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
orq.tools.delete(tool_id="<id>")
# Use the SDK ...
Show Parameters
Show Parameters
{
"tool_id": str, # required
}
Retrieve a Tool
Retrieves a tool by id.from orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.tools.retrieve(tool_id="<id>")
# Handle response
print(res)
Show Parameters
Show Parameters
{
"tool_id": str, # required
}
Show Response
Show Response
{
"id": Optional[str],
"path": str,
"key": str,
"display_name": Optional[str],
"description": str,
"created_by_id": Optional[str],
"updated_by_id": Optional[str],
"project_id": str,
"workspace_id": str,
"created": str,
"updated": str,
"status": Optional[Literal["live", "draft", "pending", "published"]],
"type": Literal["function"],
"function": {
"name": str,
"description": Optional[str],
"strict": Optional[bool],
"parameters": { # optional
"type": Literal["object"],
"properties": Dict[str, Any],
"required": List[str],
"__pydantic_extra__": Dict[str, Any],
},
},
}
Tools Versions
Returns version history for a specific toolfrom orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.tools.list_versions(tool_id="<id>", limit=10)
# Handle response
print(res)
Show Parameters
Show Parameters
{
"tool_id": str, # required
"limit": Optional[int],
"starting_after": Optional[str],
"ending_before": Optional[str],
}
Show Response
Show Response
{
"object": Literal["list"],
"data": {
"id": str,
"created_at": str,
"updated_at": str,
"created_by_id": Optional[str],
"updated_by_id": Optional[str],
"version": str,
"description": Optional[str],
"checksum": str,
"entity_type": str,
"entity_id": str,
"data": Dict[str, Any],
"workspace_id": str,
},
"has_more": bool,
}
Tools Versions
Returns a specific version of a toolfrom orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.tools.get_version(tool_id="<id>", version_id="<id>")
# Handle response
print(res)
Show Parameters
Show Parameters
{
"tool_id": str, # required
"version_id": str, # required
}
Show Response
Show Response
{
"id": str,
"created_at": str,
"updated_at": str,
"created_by_id": Optional[str],
"updated_by_id": Optional[str],
"version": str,
"description": Optional[str],
"checksum": str,
"entity_type": str,
"entity_id": str,
"data": Dict[str, Any],
"workspace_id": str,
}