feat(tools): use { input_schema, output_schema } for ToolDefinition

This commit is contained in:
Ashwin Bharambe 2025-09-30 19:13:15 -07:00
parent 42414a1a1b
commit 139320e19f
20 changed files with 1989 additions and 386 deletions

View file

@ -7383,12 +7383,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",
@ -7424,68 +7469,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": {
@ -13132,6 +13115,68 @@
"title": "Tool",
"description": "A tool that can be invoked by agents."
},
"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."
},
"ToolGroup": {
"type": "object",
"properties": {