Tools
List Tools
List all workspace tools. By default returns all tools in one response. Setlimit for cursor-based pagination.
from orq_ai_sdk import Orq
import os
with Orq(
api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:
res = orq.tools.list(limit=10)
# Handle response
print(res)
import { Orq } from "@orq-ai/node";
const orq = new Orq({
apiKey: process.env["ORQ_API_KEY"] ?? "",
});
async function run() {
const result = await orq.tools.list({
limit: 10,
});
console.log(result);
}
run();
Show Parameters
Show Parameters
{
"limit": Optional[float],
"starting_after": Optional[str],
"ending_before": Optional[str],
}
{
limit?: number;
startingAfter?: string;
endingBefore?: string;
}
Show Response
Show Response
{
"object": Literal["list"],
"data": List[Union[DataFunctionTool, DataJSONSchemaTool, DataHTTPTool, DataCodeExecutionTool]],
"has_more": bool,
}
{
object: "list";
data: (DataFunctionTool | DataJSONSchemaTool | DataHTTPTool | DataCodeExecutionTool)[];
hasMore: boolean;
}
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.JSONSchemaTool(
path="Default",
key="<key>",
description="Looks up order status",
status="live",
type="json_schema",
json_schema=orq_ai_sdk.RequestBodyJSONSchema(
name="<value>",
description="Order lookup parameters",
schema_=orq_ai_sdk.RequestBodySchema(
type="<value>",
properties={
"key": "<value>",
},
required=[],
),
),
))
# Handle response
print(res)
import { Orq } from "@orq-ai/node";
const orq = new Orq({
apiKey: process.env["ORQ_API_KEY"] ?? "",
});
async function run() {
const result = await orq.tools.create({
path: "Default",
key: "<key>",
description: "Looks up order status",
status: "live",
type: "json_schema",
jsonSchema: {
name: "<value>",
description: "Order lookup parameters",
schema: {
type: "<value>",
properties: {
"key": "<value>",
},
required: [],
},
},
});
console.log(result);
}
run();
Show Parameters
Show Parameters
{
# one of: FunctionTool, JSONSchemaTool, HTTPTool, CodeExecutionTool
"path": str, # required
"key": str, # required
"display_name": Optional[str],
"description": str, # required
"status": Optional[Literal["live", "draft", "pending", "published"]],
"type": Union[Union[Union[Literal["function"], Literal["json_schema"]], Literal["http"]], Literal["code"]], # required
"function": { # required (variant-specific)
"name": str, # required
"description": Optional[str],
"strict": Optional[bool],
"parameters": { # optional
"type": Literal["object"], # required
"properties": Dict[str, Any], # required
"required": List[str], # required
},
},
"json_schema": { # required (variant-specific)
"name": str, # required
"description": str, # required
"schema_": { # required
"type": str, # required
"properties": Dict[str, Any], # required
"required": List[str], # required
},
"strict": Optional[bool],
},
"http": { # required (variant-specific)
"blueprint": { # required
"url": str, # required
"method": Literal["GET", "POST", "PUT", "DELETE"], # required
"headers": Dict[str, Union[str, CreateToolHeaders2]], # optional
"body": Dict[str, Any], # optional
"timeout": Optional[float],
},
"arguments": Dict[str, RequestBodyArguments], # optional
},
"code_tool": { # required (variant-specific)
"parameters": { # optional
"type": Literal["object"], # required
"properties": Dict[str, Any], # required
"required": List[str], # required
},
"language": Literal["python"], # required
"code": str, # required
},
}
{
// one of: FunctionTool, JSONSchemaTool, HTTPTool, CodeExecutionTool
path: string; // required
key: string; // required
displayName?: string;
description: string; // required
status?: "live" | "draft" | "pending" | "published";
type: "function" | "json_schema" | "http" | "code"; // required
function: { // required (variant-specific)
name: string; // required
description?: string;
strict?: boolean;
parameters?: {
type: "object"; // required
properties: Record<string, any>; // required
required: string[]; // required
};
};
jsonSchema: { // required (variant-specific)
name: string; // required
description: string; // required
schema: { // required
type: string; // required
properties: Record<string, any>; // required
required: string[]; // required
};
strict?: boolean;
};
http: { // required (variant-specific)
blueprint: { // required
url: string; // required
method: "GET" | "POST" | "PUT" | "DELETE"; // required
headers?: Record<string, string | CreateToolHeaders2>;
body?: Record<string, any>;
timeout?: number;
};
arguments?: Record<string, RequestBodyArguments>;
};
codeTool: { // required (variant-specific)
parameters?: {
type: "object"; // required
properties: Record<string, any>; // required
required: string[]; // required
};
language: "python"; // required
code: string; // 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],
},
},
}
{
id?: string;
path: string;
key: string;
displayName?: string;
description: string;
createdById?: string;
updatedById?: string;
projectId: string;
workspaceId: string;
created: string;
updated: string;
status?: "live" | "draft" | "pending" | "published";
type: "function";
function: {
name: string;
description?: string;
strict?: boolean;
parameters?: {
type: "object";
properties: Record<string, any>;
required: string[];
};
};
}
Show Variant types
Show Variant types
CreateToolHeaders2
{
"value": str,
"encrypted": Optional[bool],
}
{
value: string;
encrypted?: boolean;
}
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)
import { Orq } from "@orq-ai/node";
const orq = new Orq({
apiKey: process.env["ORQ_API_KEY"] ?? "",
});
async function run() {
const result = await orq.tools.update({
toolId: "<id>",
requestBody: {
path: "Default",
status: "live",
type: "function",
},
});
console.log(result);
}
run();
Show Parameters
Show Parameters
{
"tool_id": str, # required
"request_body": { # optional
# one of: UpdateFunctionTool, UpdateJSONSchemaTool, UpdateHTTPTool, UpdateCodeExecutionTool
"path": Optional[str],
"key": Optional[str],
"display_name": Optional[str],
"description": Optional[str],
"status": Optional[Literal["live", "draft", "pending", "published"]],
"type": Union[Union[Union[Literal["function"], Literal["json_schema"]], Literal["http"]], Literal["code"]], # required
"function": { # optional
"name": str, # required
"description": Optional[str],
"strict": Optional[bool],
"parameters": { # optional
"type": Literal["object"], # required
"properties": Dict[str, Any], # required
"required": List[str], # required
},
},
"version_increment": Optional[Literal["major", "minor", "patch"]],
"version_description": Optional[str],
"json_schema": { # optional
"name": str, # required
"description": str, # required
"schema_": { # required
"type": str, # required
"properties": Dict[str, Any], # required
"required": List[str], # required
},
"strict": Optional[bool],
},
"http": { # optional
"blueprint": { # required
"url": str, # required
"method": Literal["GET", "POST", "PUT", "DELETE"], # required
"headers": Dict[str, Union[str, UpdateToolHeaders2]], # optional
"body": Dict[str, Any], # optional
"timeout": Optional[float],
},
"arguments": Dict[str, UpdateToolRequestBodyArguments], # optional
},
"code_tool": { # optional
"parameters": { # optional
"type": Literal["object"], # required
"properties": Dict[str, Any], # required
"required": List[str], # required
},
"language": Literal["python"], # required
"code": str, # required
},
},
}
{
toolId: string; // required
requestBody?: {
// one of: UpdateFunctionTool, UpdateJSONSchemaTool, UpdateHTTPTool, UpdateCodeExecutionTool
path?: string;
key?: string;
displayName?: string;
description?: string;
status?: "live" | "draft" | "pending" | "published";
type: "function" | "json_schema" | "http" | "code"; // required
function?: {
name: string; // required
description?: string;
strict?: boolean;
parameters?: {
type: "object"; // required
properties: Record<string, any>; // required
required: string[]; // required
};
};
versionIncrement?: "major" | "minor" | "patch";
versionDescription?: string;
jsonSchema?: {
name: string; // required
description: string; // required
schema: { // required
type: string; // required
properties: Record<string, any>; // required
required: string[]; // required
};
strict?: boolean;
};
http?: {
blueprint: { // required
url: string; // required
method: "GET" | "POST" | "PUT" | "DELETE"; // required
headers?: Record<string, string | UpdateToolHeaders2>;
body?: Record<string, any>;
timeout?: number;
};
arguments?: Record<string, UpdateToolRequestBodyArguments>;
};
codeTool?: {
parameters?: {
type: "object"; // required
properties: Record<string, any>; // required
required: string[]; // required
};
language: "python"; // required
code: string; // 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],
},
},
}
{
id?: string;
path: string;
key: string;
displayName?: string;
description: string;
createdById?: string;
updatedById?: string;
projectId: string;
workspaceId: string;
created: string;
updated: string;
status?: "live" | "draft" | "pending" | "published";
type: "function";
function: {
name: string;
description?: string;
strict?: boolean;
parameters?: {
type: "object";
properties: Record<string, any>;
required: string[];
};
};
}
Show Variant types
Show Variant types
UpdateToolHeaders2
{
"value": str,
"encrypted": Optional[bool],
}
{
value: string;
encrypted?: boolean;
}
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 ...
import { Orq } from "@orq-ai/node";
const orq = new Orq({
apiKey: process.env["ORQ_API_KEY"] ?? "",
});
async function run() {
await orq.tools.delete({
toolId: "<id>",
});
}
run();
Show Parameters
Show Parameters
{
"tool_id": str, # required
}
{
toolId: string; // 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)
import { Orq } from "@orq-ai/node";
const orq = new Orq({
apiKey: process.env["ORQ_API_KEY"] ?? "",
});
async function run() {
const result = await orq.tools.retrieve({
toolId: "<id>",
});
console.log(result);
}
run();
Show Parameters
Show Parameters
{
"tool_id": str, # required
}
{
toolId: string; // 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],
},
},
}
{
id?: string;
path: string;
key: string;
displayName?: string;
description: string;
createdById?: string;
updatedById?: string;
projectId: string;
workspaceId: string;
created: string;
updated: string;
status?: "live" | "draft" | "pending" | "published";
type: "function";
function: {
name: string;
description?: string;
strict?: boolean;
parameters?: {
type: "object";
properties: Record<string, any>;
required: string[];
};
};
}
List Tool 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)
import { Orq } from "@orq-ai/node";
const orq = new Orq({
apiKey: process.env["ORQ_API_KEY"] ?? "",
});
async function run() {
const result = await orq.tools.listVersions({
toolId: "<id>",
});
console.log(result);
}
run();
Show Parameters
Show Parameters
{
"tool_id": str, # required
"limit": Optional[int],
"starting_after": Optional[str],
"ending_before": Optional[str],
}
{
toolId: string; // required
limit?: number;
startingAfter?: string;
endingBefore?: string;
}
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,
}
{
object: "list";
data: {
id: string;
createdAt: string;
updatedAt: string;
createdById?: string;
updatedById?: string;
version: string;
description?: string;
checksum: string;
entityType: string;
entityId: string;
data: Record<string, any>;
workspaceId: string;
}[];
hasMore: boolean;
}
Retrieve a Tool Version
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)
import { Orq } from "@orq-ai/node";
const orq = new Orq({
apiKey: process.env["ORQ_API_KEY"] ?? "",
});
async function run() {
const result = await orq.tools.getVersion({
toolId: "<id>",
versionId: "<id>",
});
console.log(result);
}
run();
Show Parameters
Show Parameters
{
"tool_id": str, # required
"version_id": str, # required
}
{
toolId: string; // required
versionId: string; // 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,
}
{
id: string;
createdAt: string;
updatedAt: string;
createdById?: string;
updatedById?: string;
version: string;
description?: string;
checksum: string;
entityType: string;
entityId: string;
data: Record<string, any>;
workspaceId: string;
}