feat(tool): add _meta to tool definitions (#534)

This commit is contained in:
Dylan Anthony 2025-11-10 18:27:52 -07:00 • committed by GitHub
commit 03040f8b0b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 33 additions and 1 deletions

View file

@ -6,7 +6,7 @@ use schemars::JsonSchema;
use serde::{Deserialize, Serialize};
use serde_json::Value;
use super::{Icon, JsonObject};
use super::{Icon, JsonObject, Meta};
/// A tool that can be used by a model.
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
@ -32,6 +32,9 @@ pub struct Tool {
/// Optional list of icons for the tool
#[serde(skip_serializing_if = "Option::is_none")]
pub icons: Option<Vec<Icon>>,
/// Optional additional metadata for this tool
#[serde(rename = "_meta", skip_serializing_if = "Option::is_none")]
pub meta: Option<Meta>,
}
/// Additional properties describing a Tool to clients.
@ -150,6 +153,7 @@ impl Tool {
output_schema: None,
annotations: None,
icons: None,
meta: None,
}
}

View file

@ -2292,6 +2292,14 @@
"description": "A tool that can be used by a model.",
"type": "object",
"properties": {
"_meta": {
"description": "Optional additional metadata for this tool",
"type": [
"object",
"null"
],
"additionalProperties": true
},
"annotations": {
"description": "Optional additional tool information.",
"anyOf": [

View file

@ -2292,6 +2292,14 @@
"description": "A tool that can be used by a model.",
"type": "object",
"properties": {
"_meta": {
"description": "Optional additional metadata for this tool",
"type": [
"object",
"null"
],
"additionalProperties": true
},
"annotations": {
"description": "Optional additional tool information.",
"anyOf": [