Skip to main content
Tools give models the ability to take action: call an API, run code, call an MCP, or invoke any external service. Tools require a model with function calling support, look for the tools tag in the AI Gateway. The following Tools are available:

Function Tool

Pass the tool call back to the caller for local execution. Define parameters with JSON Schema.

JSON Schema Tool

Enforce structured output from the model using a full JSON Schema definition.

HTTP Tool

Make a real HTTP request to an external API at runtime. No extra code needed.

MCP Tool

Connect to a Model Context Protocol server. Orq.ai discovers available capabilities automatically.

Python Tool

Run arbitrary Python code at runtime. Define logic and parameters directly in the Studio.

Choosing a tool type

Orq.ai executes every tool type except Function: the model calls the tool, the platform runs it, and the run continues without the application being involved. A Function Tool is the one that gets handed back. The platform returns the call and waits for the application to execute it and send the result, which makes it the escape hatch for anything the platform cannot reach on its own. Pick a Function Tool when the code needs the application’s own environment: a database connection, an internal client library, credentials that never leave the application, or logic that no single request can express. An HTTP Tool is less work when the capability is already a REST endpoint, because Orq.ai makes the request. An MCP Tool removes the schema work entirely for anything already behind a Model Context Protocol server. Small self-contained logic can go in a Python Tool, which runs on the platform with no application code at all.

Function Tool

A Function Tool lets the model call custom code that runs in the application invoking the agent, not on the Orq.ai platform. Use it for database queries, internal APIs, or any logic that requires access to the application’s environment. The worked example below runs the whole flow end to end, and Use Tools documents the request and response shapes field by field. The name refers to how the tool is defined, a function signature described with JSON Schema, and not to function calling in general. Every tool type on this page is exposed to the model through function calling. Only this one is executed by the caller.
Define a callable function using JSON Schema.
1

Add a new Tool to a Project

Use the button to add a new Entity to a Project.
Tool Add

Select Function Tool

2

Enter Tool Details

Enter the main details of the tool:
  • Key, used by models to reference the tool
  • Name, used in the studio to find the tool
  • Description, used to describe the tool
    Make the Description as precise as possible, it is used notably by Agents when looking up relevant tools for their tasks.
Function Tool Configure

Configure all fields

3

Configure your Function Tool

Function Tools are defined using JSON.Here is an example of a JSON schema for a function get_current_weather that declares the fields location (string) and unit (string):
The object defined here is based on JSON Schema. This framework allows for extensible definition that fits your ideal function definition.
TypeUse here any of the valid JSON types: object, string, integer, number, array, etc. The top-level type will most commonly be an object holding other properties.Learn more about all JSON types in the JSON Schema definition.PropertiesProperties are definitions of fields within an object. Here you can define any new variable. Nested properties are allowed.RequiredThe required array within an object defines which fields must be entered for a JSON payload to be validated.
4

Publish your Tool

Once your tool is configured, click Publish to save a new version. Each published version is immutable and tracked in the version history.

Worked example: an Agent that checks stock

A support Agent answers stock questions against an internal inventory database. The database is only reachable from the application, which is what makes this a Function Tool rather than an HTTP Tool.
1

Write the tool definition

The description is the only thing the model reads when deciding whether to call the tool, so it states what the tool returns and when it applies, not just what it is. The parameter descriptions do the same job for the values.
The warehouse is deliberately absent from the schema. The application reads it from the signed-in session and passes it in when it executes the call, so the model can neither see it nor choose it.
2

Attach the tool to the Agent

An Agent takes its tools from its own configuration, so Orq.ai ignores a tools array in the request. Attach the tool from the Agent configuration in Studio, or by key through the API. See Function Tools.
cURL
3

Send the request

The let declaration matters in TypeScript: the loop in the next step reassigns response.The model answers with a function_call output item instead of text. See Use Tools for the exact item shape.
4

Run the tool loop

A single response can contain more than one function_call item, and the model can call tools again after seeing the results. Execute every call in the response, send all the outputs back in one continuation request, and repeat until the response contains no function_call items.inventory_db and session below are the application’s own database client and request session, not part of the SDK.
The result shape matters as much as the description. Splitting out_of_stock from unknown_skus tells the model the difference between a real SKU with no stock, which is an answer, and a SKU it invented, which is a signal to look the product up again instead of reporting it as unavailable.
In production:
  • Validate arguments against the schema before execution. The model can send values that do not fit, and a malformed arguments string is a tool error to report back, not an exception that ends the run.
  • Keep tenant, account, and user identifiers out of the schema and supply them from the session, so the model cannot send the wrong one.
  • Return tool errors as a function_call_output describing the failure so the model can recover. Reserve raised exceptions for failures the model cannot act on.
  • Cap the number of rounds so a model that keeps calling tools cannot loop indefinitely.
To run the same loop against a model instead of an Agent, reference the saved schema with {"type": "orq:function", "tool_id": "..."} in the request tools array and repeat that array on every continuation request. Tool Calling covers the model-level patterns in depth, including parallel execution and retries.

JSON Schema Tool

Enforce structured output from the model using a full JSON Schema definition.
1

Add a new Tool to a Project

Use the button to add a new Entity to a Project.
Tool Add

Select JSON Schema Tool

2

Enter Tool Details

Enter the main details of the tool:
  • Key, used by models to reference the tool
  • Name, used in the studio to find the tool
  • Description, used to describe the tool
    Make the Description as precise as possible, it is used notably by Agents when looking up relevant tools for their tasks.
JSON Schema Tool configure

Configure all fields

3

Configure your JSON Schema Tool

JSON Schema Tools are defined using JSON.Here is an example of a JSON schema for a function get_current_weather that declares the fields location (string) and unit (string):
The object defined here is based on JSON Schema. This framework allows for extensible definition that fits your ideal function definition.
TypeUse here any of the valid JSON types: object, string, integer, number, array, etc. The top-level type will most commonly be an object holding other properties.Learn more about all JSON types in the JSON Schema definition.PropertiesProperties are definitions of fields within an object. Here you can define any new variable. Nested properties are allowed.RequiredThe required array within an object defines which fields must be entered for a JSON payload to be validated.
4

Publish your Tool

Once your tool is configured, click Publish to save a new version. Each published version is immutable and tracked in the version history.

HTTP Tool

Make a real HTTP request to an external API at runtime. Use {{variable}} syntax to inject dynamic values into any field.
1

Add a new Tool to a Project

Use the button to add a new Entity to a Project.
Tool Add

Select HTTP Tool

2

Enter Tool Details

Enter the main details of the tool:
  • Key, used by models to reference the tool
  • Name, used in the studio to find the tool
  • Description, used to describe the tool
    Make the Description as precise as possible, it is used notably by Agents when looking up relevant tools for their tasks.
Http Tool Add Pn

Configure all fields

3

Configure your HTTP Tool

HTTP Tools are defined within the Studio, either using the UI or using JSON (use the toggle to change mode).
Http Tool Configuration Pn

Configure your HTTP Tool

You can use Variables with the {{variable}} syntax within any configuration field. The variable will be resolved at runtime when the payload is built for the HTTP call.
Use the Autogenerate Schema when using variables to ensure variable definition is correctly created.
4

Publish your Tool

Once your tool is configured, click Publish to save a new version. Each published version is immutable and tracked in the version history.

MCP Tool

Connect to a Model Context Protocol server. Orq.ai discovers available tools automatically. Provide an optional Bearer token for private servers.
1

Add a new Tool to a Project

Use the button to add a new Entity to a Project.
Tool Add

Select MCP Tool

2

Enter Tool Details

Enter the main details of the tool:
  • Key, used by models to reference the tool
  • Name, used in the studio to find the tool
  • Description, used to describe the tool
    Make the Description as precise as possible, it is used notably by Agents when looking up relevant tools for their tasks.
  • MCP Server URL, a valid MCP server endpoint
  • Header, key-value pairs sent with every request to the MCP server. Use {{variable}} syntax for sensitive values such as API keys.
Create Mcp Tool Pn

Configure all fields

MCP Provider templatesUse the MCP Provider dropdown to select from a curated list of pre-configured providers. Selecting a provider pre-fills Key, Name, and Headers with the correct values for that provider, including any required authentication headers using {{variable}} placeholders.When template variables are detected, a prompt appears below the form asking for temporary values. These values are used only to connect to the MCP server and discover its available tools. They are not stored after the connection.
MCP Provider Templates

Select a provider to pre-fill connection details

3

View your MCP configuration

MCP Tools are automatically configured, you can then visualize all the capabilities and actions dynamically fetched from the MCP Server. Use the button to remove a tool from the list.Use the Refresh button to fetch a new configuration.
Mcp Tools Pn

View MCP Tool Actions

Python Tool

Python code is limited to 1 MB (1,048,576 bytes) per tool: roughly 1 million characters, or about 20,000 lines of typical Python. Larger code returns a Code exceeds maximum size error and does not run.
Run arbitrary Python code at runtime. Access parameters via params and store the result in result.
1

Add a new Tool to a Project

Use the button to add a new Entity to a Project.
Tool Add

Select Python Tool

2

Enter Tool Details

Enter the main details of the tool:
  • Key, used by models to reference the tool
  • Name, used in the studio to find the tool
  • Description, used to describe the tool
    Make the Description as precise as possible, it is used notably by Agents when looking up relevant tools for their tasks.
Create Python Tool

Configure all fields

3

Configure your Python Tool

Freely define the code to be ran during Tool execution.You can define the JSON Schema for the parameters to be sent into the tool. Here, see the name field defined and then further fetched using params.get('name').Ensure your return value is stored within the result field.
Python Tool Config

Configure your Python Tool

4

Publish your Tool

Once your tool is configured, click Publish to save a new version. Each published version is immutable and tracked in the version history.

Versions

When you are done editing, click Publish to save your changes. You will be prompted to write a commit message and choose a version bump: major, minor, or patch.
Tool version publish

Publish a new version of your Tool

  • Patch (e.g. v1.0.0 to v1.0.1): small fixes, no behavior change
  • Minor (e.g. v1.0.0 to v1.1.0): new functionality, backwards compatible
  • Major (e.g. v1.0.0 to v2.0.0): breaking change or significant rework
Every time you publish, a new version of the tool is created. The Versions tab shows the full history. Versions are numbered (e.g. v1.0.0, v1.1.0) and each entry shows the author and publish timestamp.
Tool versions

Version history in the Versions tab

Use the Compare button to open a diff view to see what changed between versions.

Using Tools

All tool types are supported. Reference a tool by key in the settings.tools array. Your agent’s instructions must explicitly describe each tool and when to use it.
Learn more about using tools in Agents.
Only Function Tools are supported. Import a previously created tool from the Tools tab in the deployment configuration.
Learn more about using tools in Deployments.