feat(tools)!: substantial clean up of "Tool" related datatypes (#3627)

This is a sweeping change to clean up some gunk around our "Tool"
definitions.

First, we had two types `Tool` and `ToolDef`. The first of these was a
"Resource" type for the registry but we had stopped registering tools
inside the Registry long back (and only registered ToolGroups.) The
latter was for specifying tools for the Agents API. This PR removes the
former and adds an optional `toolgroup_id` field to the latter.

Secondly, as pointed out by @bbrowning in
https://github.com/llamastack/llama-stack/pull/3003#issuecomment-3245270132,
we were doing a lossy conversion from a full JSON schema from the MCP
tool specification into our ToolDefinition to send it to the model.
There is no necessity to do this -- we ourselves aren't doing any
execution at all but merely passing it to the chat completions API which
supports this. By doing this (and by doing it poorly), we encountered
limitations like not supporting array items, or not resolving $refs,
etc.

To fix this, we replaced the `parameters` field by `{ input_schema,
output_schema }` which can be full blown JSON schemas.

Finally, there were some types in our llama-related chat format
conversion which needed some cleanup. We are taking this opportunity to
clean those up.

This PR is a substantial breaking change to the API. However, given our
window for introducing breaking changes, this suits us just fine. I will
be landing a concurrent `llama-stack-client` change as well since API
shapes are changing.
This commit is contained in:
Ashwin Bharambe 2025-10-02 15:12:03 -07:00 committed by GitHub
parent 1f5003d50e
commit ef0736527d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
179 changed files with 34186 additions and 9171 deletions

View file

@ -4289,6 +4289,10 @@
"ToolDef": {
"type": "object",
"properties": {
"toolgroup_id": {
"type": "string",
"description": "(Optional) ID of the tool group this tool belongs to"
},
"name": {
"type": "string",
"description": "Name of the tool"
@ -4297,12 +4301,57 @@
"type": "string",
"description": "(Optional) Human-readable description of what the tool does"
},
"parameters": {
"type": "array",
"items": {
"$ref": "#/components/schemas/ToolParameter"
"input_schema": {
"type": "object",
"additionalProperties": {
"oneOf": [
{
"type": "null"
},
{
"type": "boolean"
},
{
"type": "number"
},
{
"type": "string"
},
{
"type": "array"
},
{
"type": "object"
}
]
},
"description": "(Optional) List of parameters this tool accepts"
"description": "(Optional) JSON Schema for tool inputs (MCP inputSchema)"
},
"output_schema": {
"type": "object",
"additionalProperties": {
"oneOf": [
{
"type": "null"
},
{
"type": "boolean"
},
{
"type": "number"
},
{
"type": "string"
},
{
"type": "array"
},
{
"type": "object"
}
]
},
"description": "(Optional) JSON Schema for tool outputs (MCP outputSchema)"
},
"metadata": {
"type": "object",
@ -4338,68 +4387,6 @@
"title": "ToolDef",
"description": "Tool definition used in runtime contexts."
},
"ToolParameter": {
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "Name of the parameter"
},
"parameter_type": {
"type": "string",
"description": "Type of the parameter (e.g., string, integer)"
},
"description": {
"type": "string",
"description": "Human-readable description of what the parameter does"
},
"required": {
"type": "boolean",
"default": true,
"description": "Whether this parameter is required for tool invocation"
},
"items": {
"type": "object",
"description": "Type of the elements when parameter_type is array"
},
"title": {
"type": "string",
"description": "(Optional) Title of the parameter"
},
"default": {
"oneOf": [
{
"type": "null"
},
{
"type": "boolean"
},
{
"type": "number"
},
{
"type": "string"
},
{
"type": "array"
},
{
"type": "object"
}
],
"description": "(Optional) Default value for the parameter if not provided"
}
},
"additionalProperties": false,
"required": [
"name",
"parameter_type",
"description",
"required"
],
"title": "ToolParameter",
"description": "Parameter definition for a tool."
},
"TopKSamplingStrategy": {
"type": "object",
"properties": {
@ -4915,79 +4902,6 @@
]
},
"arguments": {
"oneOf": [
{
"type": "string"
},
{
"type": "object",
"additionalProperties": {
"oneOf": [
{
"type": "string"
},
{
"type": "integer"
},
{
"type": "number"
},
{
"type": "boolean"
},
{
"type": "null"
},
{
"type": "array",
"items": {
"oneOf": [
{
"type": "string"
},
{
"type": "integer"
},
{
"type": "number"
},
{
"type": "boolean"
},
{
"type": "null"
}
]
}
},
{
"type": "object",
"additionalProperties": {
"oneOf": [
{
"type": "string"
},
{
"type": "integer"
},
{
"type": "number"
},
{
"type": "boolean"
},
{
"type": "null"
}
]
}
}
]
}
}
]
},
"arguments_json": {
"type": "string"
}
},

View file

@ -3143,6 +3143,10 @@ components:
ToolDef:
type: object
properties:
toolgroup_id:
type: string
description: >-
(Optional) ID of the tool group this tool belongs to
name:
type: string
description: Name of the tool
@ -3150,12 +3154,30 @@ components:
type: string
description: >-
(Optional) Human-readable description of what the tool does
parameters:
type: array
items:
$ref: '#/components/schemas/ToolParameter'
input_schema:
type: object
additionalProperties:
oneOf:
- type: 'null'
- type: boolean
- type: number
- type: string
- type: array
- type: object
description: >-
(Optional) List of parameters this tool accepts
(Optional) JSON Schema for tool inputs (MCP inputSchema)
output_schema:
type: object
additionalProperties:
oneOf:
- type: 'null'
- type: boolean
- type: number
- type: string
- type: array
- type: object
description: >-
(Optional) JSON Schema for tool outputs (MCP outputSchema)
metadata:
type: object
additionalProperties:
@ -3174,50 +3196,6 @@ components:
title: ToolDef
description: >-
Tool definition used in runtime contexts.
ToolParameter:
type: object
properties:
name:
type: string
description: Name of the parameter
parameter_type:
type: string
description: >-
Type of the parameter (e.g., string, integer)
description:
type: string
description: >-
Human-readable description of what the parameter does
required:
type: boolean
default: true
description: >-
Whether this parameter is required for tool invocation
items:
type: object
description: >-
Type of the elements when parameter_type is array
title:
type: string
description: (Optional) Title of the parameter
default:
oneOf:
- type: 'null'
- type: boolean
- type: number
- type: string
- type: array
- type: object
description: >-
(Optional) Default value for the parameter if not provided
additionalProperties: false
required:
- name
- parameter_type
- description
- required
title: ToolParameter
description: Parameter definition for a tool.
TopKSamplingStrategy:
type: object
properties:
@ -3630,33 +3608,6 @@ components:
title: BuiltinTool
- type: string
arguments:
oneOf:
- type: string
- type: object
additionalProperties:
oneOf:
- type: string
- type: integer
- type: number
- type: boolean
- type: 'null'
- type: array
items:
oneOf:
- type: string
- type: integer
- type: number
- type: boolean
- type: 'null'
- type: object
additionalProperties:
oneOf:
- type: string
- type: integer
- type: number
- type: boolean
- type: 'null'
arguments_json:
type: string
additionalProperties: false
required:

View file

@ -2784,6 +2784,10 @@
"ToolDef": {
"type": "object",
"properties": {
"toolgroup_id": {
"type": "string",
"description": "(Optional) ID of the tool group this tool belongs to"
},
"name": {
"type": "string",
"description": "Name of the tool"
@ -2792,12 +2796,57 @@
"type": "string",
"description": "(Optional) Human-readable description of what the tool does"
},
"parameters": {
"type": "array",
"items": {
"$ref": "#/components/schemas/ToolParameter"
"input_schema": {
"type": "object",
"additionalProperties": {
"oneOf": [
{
"type": "null"
},
{
"type": "boolean"
},
{
"type": "number"
},
{
"type": "string"
},
{
"type": "array"
},
{
"type": "object"
}
]
},
"description": "(Optional) List of parameters this tool accepts"
"description": "(Optional) JSON Schema for tool inputs (MCP inputSchema)"
},
"output_schema": {
"type": "object",
"additionalProperties": {
"oneOf": [
{
"type": "null"
},
{
"type": "boolean"
},
{
"type": "number"
},
{
"type": "string"
},
{
"type": "array"
},
{
"type": "object"
}
]
},
"description": "(Optional) JSON Schema for tool outputs (MCP outputSchema)"
},
"metadata": {
"type": "object",
@ -2833,68 +2882,6 @@
"title": "ToolDef",
"description": "Tool definition used in runtime contexts."
},
"ToolParameter": {
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "Name of the parameter"
},
"parameter_type": {
"type": "string",
"description": "Type of the parameter (e.g., string, integer)"
},
"description": {
"type": "string",
"description": "Human-readable description of what the parameter does"
},
"required": {
"type": "boolean",
"default": true,
"description": "Whether this parameter is required for tool invocation"
},
"items": {
"type": "object",
"description": "Type of the elements when parameter_type is array"
},
"title": {
"type": "string",
"description": "(Optional) Title of the parameter"
},
"default": {
"oneOf": [
{
"type": "null"
},
{
"type": "boolean"
},
{
"type": "number"
},
{
"type": "string"
},
{
"type": "array"
},
{
"type": "object"
}
],
"description": "(Optional) Default value for the parameter if not provided"
}
},
"additionalProperties": false,
"required": [
"name",
"parameter_type",
"description",
"required"
],
"title": "ToolParameter",
"description": "Parameter definition for a tool."
},
"TopKSamplingStrategy": {
"type": "object",
"properties": {
@ -3410,79 +3397,6 @@
]
},
"arguments": {
"oneOf": [
{
"type": "string"
},
{
"type": "object",
"additionalProperties": {
"oneOf": [
{
"type": "string"
},
{
"type": "integer"
},
{
"type": "number"
},
{
"type": "boolean"
},
{
"type": "null"
},
{
"type": "array",
"items": {
"oneOf": [
{
"type": "string"
},
{
"type": "integer"
},
{
"type": "number"
},
{
"type": "boolean"
},
{
"type": "null"
}
]
}
},
{
"type": "object",
"additionalProperties": {
"oneOf": [
{
"type": "string"
},
{
"type": "integer"
},
{
"type": "number"
},
{
"type": "boolean"
},
{
"type": "null"
}
]
}
}
]
}
}
]
},
"arguments_json": {
"type": "string"
}
},

View file

@ -2002,6 +2002,10 @@ components:
ToolDef:
type: object
properties:
toolgroup_id:
type: string
description: >-
(Optional) ID of the tool group this tool belongs to
name:
type: string
description: Name of the tool
@ -2009,12 +2013,30 @@ components:
type: string
description: >-
(Optional) Human-readable description of what the tool does
parameters:
type: array
items:
$ref: '#/components/schemas/ToolParameter'
input_schema:
type: object
additionalProperties:
oneOf:
- type: 'null'
- type: boolean
- type: number
- type: string
- type: array
- type: object
description: >-
(Optional) List of parameters this tool accepts
(Optional) JSON Schema for tool inputs (MCP inputSchema)
output_schema:
type: object
additionalProperties:
oneOf:
- type: 'null'
- type: boolean
- type: number
- type: string
- type: array
- type: object
description: >-
(Optional) JSON Schema for tool outputs (MCP outputSchema)
metadata:
type: object
additionalProperties:
@ -2033,50 +2055,6 @@ components:
title: ToolDef
description: >-
Tool definition used in runtime contexts.
ToolParameter:
type: object
properties:
name:
type: string
description: Name of the parameter
parameter_type:
type: string
description: >-
Type of the parameter (e.g., string, integer)
description:
type: string
description: >-
Human-readable description of what the parameter does
required:
type: boolean
default: true
description: >-
Whether this parameter is required for tool invocation
items:
type: object
description: >-
Type of the elements when parameter_type is array
title:
type: string
description: (Optional) Title of the parameter
default:
oneOf:
- type: 'null'
- type: boolean
- type: number
- type: string
- type: array
- type: object
description: >-
(Optional) Default value for the parameter if not provided
additionalProperties: false
required:
- name
- parameter_type
- description
- required
title: ToolParameter
description: Parameter definition for a tool.
TopKSamplingStrategy:
type: object
properties:
@ -2489,33 +2467,6 @@ components:
title: BuiltinTool
- type: string
arguments:
oneOf:
- type: string
- type: object
additionalProperties:
oneOf:
- type: string
- type: integer
- type: number
- type: boolean
- type: 'null'
- type: array
items:
oneOf:
- type: string
- type: integer
- type: number
- type: boolean
- type: 'null'
- type: object
additionalProperties:
oneOf:
- type: string
- type: integer
- type: number
- type: boolean
- type: 'null'
arguments_json:
type: string
additionalProperties: false
required:

View file

@ -2404,11 +2404,11 @@
"get": {
"responses": {
"200": {
"description": "A ListToolsResponse.",
"description": "A ListToolDefsResponse.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ListToolsResponse"
"$ref": "#/components/schemas/ListToolDefsResponse"
}
}
}
@ -2449,11 +2449,11 @@
"get": {
"responses": {
"200": {
"description": "A Tool.",
"description": "A ToolDef.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Tool"
"$ref": "#/components/schemas/ToolDef"
}
}
}
@ -8490,79 +8490,6 @@
]
},
"arguments": {
"oneOf": [
{
"type": "string"
},
{
"type": "object",
"additionalProperties": {
"oneOf": [
{
"type": "string"
},
{
"type": "integer"
},
{
"type": "number"
},
{
"type": "boolean"
},
{
"type": "null"
},
{
"type": "array",
"items": {
"oneOf": [
{
"type": "string"
},
{
"type": "integer"
},
{
"type": "number"
},
{
"type": "boolean"
},
{
"type": "null"
}
]
}
},
{
"type": "object",
"additionalProperties": {
"oneOf": [
{
"type": "string"
},
{
"type": "integer"
},
{
"type": "number"
},
{
"type": "boolean"
},
{
"type": "null"
}
]
}
}
]
}
}
]
},
"arguments_json": {
"type": "string"
}
},
@ -10156,6 +10083,10 @@
"ToolDef": {
"type": "object",
"properties": {
"toolgroup_id": {
"type": "string",
"description": "(Optional) ID of the tool group this tool belongs to"
},
"name": {
"type": "string",
"description": "Name of the tool"
@ -10164,12 +10095,57 @@
"type": "string",
"description": "(Optional) Human-readable description of what the tool does"
},
"parameters": {
"type": "array",
"items": {
"$ref": "#/components/schemas/ToolParameter"
"input_schema": {
"type": "object",
"additionalProperties": {
"oneOf": [
{
"type": "null"
},
{
"type": "boolean"
},
{
"type": "number"
},
{
"type": "string"
},
{
"type": "array"
},
{
"type": "object"
}
]
},
"description": "(Optional) List of parameters this tool accepts"
"description": "(Optional) JSON Schema for tool inputs (MCP inputSchema)"
},
"output_schema": {
"type": "object",
"additionalProperties": {
"oneOf": [
{
"type": "null"
},
{
"type": "boolean"
},
{
"type": "number"
},
{
"type": "string"
},
{
"type": "array"
},
{
"type": "object"
}
]
},
"description": "(Optional) JSON Schema for tool outputs (MCP outputSchema)"
},
"metadata": {
"type": "object",
@ -10205,68 +10181,6 @@
"title": "ToolDef",
"description": "Tool definition used in runtime contexts."
},
"ToolParameter": {
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "Name of the parameter"
},
"parameter_type": {
"type": "string",
"description": "Type of the parameter (e.g., string, integer)"
},
"description": {
"type": "string",
"description": "Human-readable description of what the parameter does"
},
"required": {
"type": "boolean",
"default": true,
"description": "Whether this parameter is required for tool invocation"
},
"items": {
"type": "object",
"description": "Type of the elements when parameter_type is array"
},
"title": {
"type": "string",
"description": "(Optional) Title of the parameter"
},
"default": {
"oneOf": [
{
"type": "null"
},
{
"type": "boolean"
},
{
"type": "number"
},
{
"type": "string"
},
{
"type": "array"
},
{
"type": "object"
}
],
"description": "(Optional) Default value for the parameter if not provided"
}
},
"additionalProperties": false,
"required": [
"name",
"parameter_type",
"description",
"required"
],
"title": "ToolParameter",
"description": "Parameter definition for a tool."
},
"ListToolDefsResponse": {
"type": "object",
"properties": {
@ -10761,107 +10675,6 @@
],
"title": "RegisterToolGroupRequest"
},
"Tool": {
"type": "object",
"properties": {
"identifier": {
"type": "string"
},
"provider_resource_id": {
"type": "string"
},
"provider_id": {
"type": "string"
},
"type": {
"type": "string",
"enum": [
"model",
"shield",
"vector_db",
"dataset",
"scoring_function",
"benchmark",
"tool",
"tool_group",
"prompt"
],
"const": "tool",
"default": "tool",
"description": "Type of resource, always 'tool'"
},
"toolgroup_id": {
"type": "string",
"description": "ID of the tool group this tool belongs to"
},
"description": {
"type": "string",
"description": "Human-readable description of what the tool does"
},
"parameters": {
"type": "array",
"items": {
"$ref": "#/components/schemas/ToolParameter"
},
"description": "List of parameters this tool accepts"
},
"metadata": {
"type": "object",
"additionalProperties": {
"oneOf": [
{
"type": "null"
},
{
"type": "boolean"
},
{
"type": "number"
},
{
"type": "string"
},
{
"type": "array"
},
{
"type": "object"
}
]
},
"description": "(Optional) Additional metadata about the tool"
}
},
"additionalProperties": false,
"required": [
"identifier",
"provider_id",
"type",
"toolgroup_id",
"description",
"parameters"
],
"title": "Tool",
"description": "A tool that can be invoked by agents."
},
"ListToolsResponse": {
"type": "object",
"properties": {
"data": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Tool"
},
"description": "List of tools"
}
},
"additionalProperties": false,
"required": [
"data"
],
"title": "ListToolsResponse",
"description": "Response containing a list of tools."
},
"VectorDB": {
"type": "object",
"properties": {

View file

@ -1753,11 +1753,11 @@ paths:
get:
responses:
'200':
description: A ListToolsResponse.
description: A ListToolDefsResponse.
content:
application/json:
schema:
$ref: '#/components/schemas/ListToolsResponse'
$ref: '#/components/schemas/ListToolDefsResponse'
'400':
$ref: '#/components/responses/BadRequest400'
'429':
@ -1785,11 +1785,11 @@ paths:
get:
responses:
'200':
description: A Tool.
description: A ToolDef.
content:
application/json:
schema:
$ref: '#/components/schemas/Tool'
$ref: '#/components/schemas/ToolDef'
'400':
$ref: '#/components/responses/BadRequest400'
'429':
@ -6398,33 +6398,6 @@ components:
title: BuiltinTool
- type: string
arguments:
oneOf:
- type: string
- type: object
additionalProperties:
oneOf:
- type: string
- type: integer
- type: number
- type: boolean
- type: 'null'
- type: array
items:
oneOf:
- type: string
- type: integer
- type: number
- type: boolean
- type: 'null'
- type: object
additionalProperties:
oneOf:
- type: string
- type: integer
- type: number
- type: boolean
- type: 'null'
arguments_json:
type: string
additionalProperties: false
required:
@ -7552,6 +7525,10 @@ components:
ToolDef:
type: object
properties:
toolgroup_id:
type: string
description: >-
(Optional) ID of the tool group this tool belongs to
name:
type: string
description: Name of the tool
@ -7559,12 +7536,30 @@ components:
type: string
description: >-
(Optional) Human-readable description of what the tool does
parameters:
type: array
items:
$ref: '#/components/schemas/ToolParameter'
input_schema:
type: object
additionalProperties:
oneOf:
- type: 'null'
- type: boolean
- type: number
- type: string
- type: array
- type: object
description: >-
(Optional) List of parameters this tool accepts
(Optional) JSON Schema for tool inputs (MCP inputSchema)
output_schema:
type: object
additionalProperties:
oneOf:
- type: 'null'
- type: boolean
- type: number
- type: string
- type: array
- type: object
description: >-
(Optional) JSON Schema for tool outputs (MCP outputSchema)
metadata:
type: object
additionalProperties:
@ -7583,50 +7578,6 @@ components:
title: ToolDef
description: >-
Tool definition used in runtime contexts.
ToolParameter:
type: object
properties:
name:
type: string
description: Name of the parameter
parameter_type:
type: string
description: >-
Type of the parameter (e.g., string, integer)
description:
type: string
description: >-
Human-readable description of what the parameter does
required:
type: boolean
default: true
description: >-
Whether this parameter is required for tool invocation
items:
type: object
description: >-
Type of the elements when parameter_type is array
title:
type: string
description: (Optional) Title of the parameter
default:
oneOf:
- type: 'null'
- type: boolean
- type: number
- type: string
- type: array
- type: object
description: >-
(Optional) Default value for the parameter if not provided
additionalProperties: false
required:
- name
- parameter_type
- description
- required
title: ToolParameter
description: Parameter definition for a tool.
ListToolDefsResponse:
type: object
properties:
@ -8002,78 +7953,6 @@ components:
- toolgroup_id
- provider_id
title: RegisterToolGroupRequest
Tool:
type: object
properties:
identifier:
type: string
provider_resource_id:
type: string
provider_id:
type: string
type:
type: string
enum:
- model
- shield
- vector_db
- dataset
- scoring_function
- benchmark
- tool
- tool_group
- prompt
const: tool
default: tool
description: Type of resource, always 'tool'
toolgroup_id:
type: string
description: >-
ID of the tool group this tool belongs to
description:
type: string
description: >-
Human-readable description of what the tool does
parameters:
type: array
items:
$ref: '#/components/schemas/ToolParameter'
description: List of parameters this tool accepts
metadata:
type: object
additionalProperties:
oneOf:
- type: 'null'
- type: boolean
- type: number
- type: string
- type: array
- type: object
description: >-
(Optional) Additional metadata about the tool
additionalProperties: false
required:
- identifier
- provider_id
- type
- toolgroup_id
- description
- parameters
title: Tool
description: A tool that can be invoked by agents.
ListToolsResponse:
type: object
properties:
data:
type: array
items:
$ref: '#/components/schemas/Tool'
description: List of tools
additionalProperties: false
required:
- data
title: ListToolsResponse
description: Response containing a list of tools.
VectorDB:
type: object
properties:

View file

@ -2404,11 +2404,11 @@
"get": {
"responses": {
"200": {
"description": "A ListToolsResponse.",
"description": "A ListToolDefsResponse.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ListToolsResponse"
"$ref": "#/components/schemas/ListToolDefsResponse"
}
}
}
@ -2449,11 +2449,11 @@
"get": {
"responses": {
"200": {
"description": "A Tool.",
"description": "A ToolDef.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Tool"
"$ref": "#/components/schemas/ToolDef"
}
}
}
@ -10499,79 +10499,6 @@
]
},
"arguments": {
"oneOf": [
{
"type": "string"
},
{
"type": "object",
"additionalProperties": {
"oneOf": [
{
"type": "string"
},
{
"type": "integer"
},
{
"type": "number"
},
{
"type": "boolean"
},
{
"type": "null"
},
{
"type": "array",
"items": {
"oneOf": [
{
"type": "string"
},
{
"type": "integer"
},
{
"type": "number"
},
{
"type": "boolean"
},
{
"type": "null"
}
]
}
},
{
"type": "object",
"additionalProperties": {
"oneOf": [
{
"type": "string"
},
{
"type": "integer"
},
{
"type": "number"
},
{
"type": "boolean"
},
{
"type": "null"
}
]
}
}
]
}
}
]
},
"arguments_json": {
"type": "string"
}
},
@ -12165,6 +12092,10 @@
"ToolDef": {
"type": "object",
"properties": {
"toolgroup_id": {
"type": "string",
"description": "(Optional) ID of the tool group this tool belongs to"
},
"name": {
"type": "string",
"description": "Name of the tool"
@ -12173,12 +12104,57 @@
"type": "string",
"description": "(Optional) Human-readable description of what the tool does"
},
"parameters": {
"type": "array",
"items": {
"$ref": "#/components/schemas/ToolParameter"
"input_schema": {
"type": "object",
"additionalProperties": {
"oneOf": [
{
"type": "null"
},
{
"type": "boolean"
},
{
"type": "number"
},
{
"type": "string"
},
{
"type": "array"
},
{
"type": "object"
}
]
},
"description": "(Optional) List of parameters this tool accepts"
"description": "(Optional) JSON Schema for tool inputs (MCP inputSchema)"
},
"output_schema": {
"type": "object",
"additionalProperties": {
"oneOf": [
{
"type": "null"
},
{
"type": "boolean"
},
{
"type": "number"
},
{
"type": "string"
},
{
"type": "array"
},
{
"type": "object"
}
]
},
"description": "(Optional) JSON Schema for tool outputs (MCP outputSchema)"
},
"metadata": {
"type": "object",
@ -12214,68 +12190,6 @@
"title": "ToolDef",
"description": "Tool definition used in runtime contexts."
},
"ToolParameter": {
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "Name of the parameter"
},
"parameter_type": {
"type": "string",
"description": "Type of the parameter (e.g., string, integer)"
},
"description": {
"type": "string",
"description": "Human-readable description of what the parameter does"
},
"required": {
"type": "boolean",
"default": true,
"description": "Whether this parameter is required for tool invocation"
},
"items": {
"type": "object",
"description": "Type of the elements when parameter_type is array"
},
"title": {
"type": "string",
"description": "(Optional) Title of the parameter"
},
"default": {
"oneOf": [
{
"type": "null"
},
{
"type": "boolean"
},
{
"type": "number"
},
{
"type": "string"
},
{
"type": "array"
},
{
"type": "object"
}
],
"description": "(Optional) Default value for the parameter if not provided"
}
},
"additionalProperties": false,
"required": [
"name",
"parameter_type",
"description",
"required"
],
"title": "ToolParameter",
"description": "Parameter definition for a tool."
},
"ListToolDefsResponse": {
"type": "object",
"properties": {
@ -12770,107 +12684,6 @@
],
"title": "RegisterToolGroupRequest"
},
"Tool": {
"type": "object",
"properties": {
"identifier": {
"type": "string"
},
"provider_resource_id": {
"type": "string"
},
"provider_id": {
"type": "string"
},
"type": {
"type": "string",
"enum": [
"model",
"shield",
"vector_db",
"dataset",
"scoring_function",
"benchmark",
"tool",
"tool_group",
"prompt"
],
"const": "tool",
"default": "tool",
"description": "Type of resource, always 'tool'"
},
"toolgroup_id": {
"type": "string",
"description": "ID of the tool group this tool belongs to"
},
"description": {
"type": "string",
"description": "Human-readable description of what the tool does"
},
"parameters": {
"type": "array",
"items": {
"$ref": "#/components/schemas/ToolParameter"
},
"description": "List of parameters this tool accepts"
},
"metadata": {
"type": "object",
"additionalProperties": {
"oneOf": [
{
"type": "null"
},
{
"type": "boolean"
},
{
"type": "number"
},
{
"type": "string"
},
{
"type": "array"
},
{
"type": "object"
}
]
},
"description": "(Optional) Additional metadata about the tool"
}
},
"additionalProperties": false,
"required": [
"identifier",
"provider_id",
"type",
"toolgroup_id",
"description",
"parameters"
],
"title": "Tool",
"description": "A tool that can be invoked by agents."
},
"ListToolsResponse": {
"type": "object",
"properties": {
"data": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Tool"
},
"description": "List of tools"
}
},
"additionalProperties": false,
"required": [
"data"
],
"title": "ListToolsResponse",
"description": "Response containing a list of tools."
},
"VectorDB": {
"type": "object",
"properties": {

View file

@ -1756,11 +1756,11 @@ paths:
get:
responses:
'200':
description: A ListToolsResponse.
description: A ListToolDefsResponse.
content:
application/json:
schema:
$ref: '#/components/schemas/ListToolsResponse'
$ref: '#/components/schemas/ListToolDefsResponse'
'400':
$ref: '#/components/responses/BadRequest400'
'429':
@ -1788,11 +1788,11 @@ paths:
get:
responses:
'200':
description: A Tool.
description: A ToolDef.
content:
application/json:
schema:
$ref: '#/components/schemas/Tool'
$ref: '#/components/schemas/ToolDef'
'400':
$ref: '#/components/responses/BadRequest400'
'429':
@ -7843,33 +7843,6 @@ components:
title: BuiltinTool
- type: string
arguments:
oneOf:
- type: string
- type: object
additionalProperties:
oneOf:
- type: string
- type: integer
- type: number
- type: boolean
- type: 'null'
- type: array
items:
oneOf:
- type: string
- type: integer
- type: number
- type: boolean
- type: 'null'
- type: object
additionalProperties:
oneOf:
- type: string
- type: integer
- type: number
- type: boolean
- type: 'null'
arguments_json:
type: string
additionalProperties: false
required:
@ -8997,6 +8970,10 @@ components:
ToolDef:
type: object
properties:
toolgroup_id:
type: string
description: >-
(Optional) ID of the tool group this tool belongs to
name:
type: string
description: Name of the tool
@ -9004,12 +8981,30 @@ components:
type: string
description: >-
(Optional) Human-readable description of what the tool does
parameters:
type: array
items:
$ref: '#/components/schemas/ToolParameter'
input_schema:
type: object
additionalProperties:
oneOf:
- type: 'null'
- type: boolean
- type: number
- type: string
- type: array
- type: object
description: >-
(Optional) List of parameters this tool accepts
(Optional) JSON Schema for tool inputs (MCP inputSchema)
output_schema:
type: object
additionalProperties:
oneOf:
- type: 'null'
- type: boolean
- type: number
- type: string
- type: array
- type: object
description: >-
(Optional) JSON Schema for tool outputs (MCP outputSchema)
metadata:
type: object
additionalProperties:
@ -9028,50 +9023,6 @@ components:
title: ToolDef
description: >-
Tool definition used in runtime contexts.
ToolParameter:
type: object
properties:
name:
type: string
description: Name of the parameter
parameter_type:
type: string
description: >-
Type of the parameter (e.g., string, integer)
description:
type: string
description: >-
Human-readable description of what the parameter does
required:
type: boolean
default: true
description: >-
Whether this parameter is required for tool invocation
items:
type: object
description: >-
Type of the elements when parameter_type is array
title:
type: string
description: (Optional) Title of the parameter
default:
oneOf:
- type: 'null'
- type: boolean
- type: number
- type: string
- type: array
- type: object
description: >-
(Optional) Default value for the parameter if not provided
additionalProperties: false
required:
- name
- parameter_type
- description
- required
title: ToolParameter
description: Parameter definition for a tool.
ListToolDefsResponse:
type: object
properties:
@ -9447,78 +9398,6 @@ components:
- toolgroup_id
- provider_id
title: RegisterToolGroupRequest
Tool:
type: object
properties:
identifier:
type: string
provider_resource_id:
type: string
provider_id:
type: string
type:
type: string
enum:
- model
- shield
- vector_db
- dataset
- scoring_function
- benchmark
- tool
- tool_group
- prompt
const: tool
default: tool
description: Type of resource, always 'tool'
toolgroup_id:
type: string
description: >-
ID of the tool group this tool belongs to
description:
type: string
description: >-
Human-readable description of what the tool does
parameters:
type: array
items:
$ref: '#/components/schemas/ToolParameter'
description: List of parameters this tool accepts
metadata:
type: object
additionalProperties:
oneOf:
- type: 'null'
- type: boolean
- type: number
- type: string
- type: array
- type: object
description: >-
(Optional) Additional metadata about the tool
additionalProperties: false
required:
- identifier
- provider_id
- type
- toolgroup_id
- description
- parameters
title: Tool
description: A tool that can be invoked by agents.
ListToolsResponse:
type: object
properties:
data:
type: array
items:
$ref: '#/components/schemas/Tool'
description: List of tools
additionalProperties: false
required:
- data
title: ListToolsResponse
description: Response containing a list of tools.
VectorDB:
type: object
properties: