item_operations
Perform CRUD operations on JSON data and templates, including creation, retrieval, editing, deletion, and statistical analysis. Supports advanced querying, node-level editing, and tag-based filtering for efficient JSON management.
Instructions
通用工具,用于创建、获取、列表、编辑、删除JSON或模板,以及获取统计信息。支持完整的CRUD操作和高级查询功能。
Input Schema
Name | Required | Description | Default |
---|---|---|---|
action | Yes | 操作类型:create(创建)、get(获取)、list(列表)、edit(编辑)、delete(删除)、stats(统计) | |
category | No | 分类:模板的分类,如'user'、'product'、'config'等 | |
content | No | 内容:JSON字符串,必须是有效的JSON格式。示例:{"key":"value"} | |
description | No | 描述:项目的详细说明,帮助理解项目用途 | |
filter_tags | No | 标签筛选:只显示包含指定标签的JSON,如['user', 'active'] | |
filter_type | No | 类型筛选:all(全部)、generated(批量生成)、manual(手动创建) | |
id | No | 项目ID:用于get、edit、delete操作,必须是已存在的ID | |
index | No | 数组索引:add/remove操作时的位置索引,从0开始。不指定则添加到末尾或删除第一个 | |
item_type | No | 项目类型:json(JSON数据) 或 template(模板),除stats外都需要指定 | |
limit | No | 列表限制:返回的最大项目数量,默认20,最大100 | |
name | No | 名称:创建时的项目名称,建议使用有意义的描述性名称 | |
operation | No | 编辑操作:set(设置值)、add(添加元素)、remove(删除)、update(更新对象) | |
path | No | 节点路径:编辑JSON时的路径,支持点号分隔。示例:'users.0.name'、'config.database.host' | |
sort_by | No | 排序方式:createdAt(创建时间)、updatedAt(更新时间)、name(名称)、size(大小) | |
tags | No | 标签:JSON项目的分类标签,如['user', 'config', 'test'] | |
value | No | 新值:要设置、添加或更新的值。可以是任何类型:字符串、数字、数组、对象等 | |
variables | No | 变量:模板中的变量名列表,如['name', 'age', 'email'] |
Input Schema (JSON Schema)
{
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {
"action": {
"description": "操作类型:create(创建)、get(获取)、list(列表)、edit(编辑)、delete(删除)、stats(统计)",
"enum": [
"create",
"get",
"list",
"edit",
"delete",
"stats"
],
"type": "string"
},
"category": {
"description": "分类:模板的分类,如'user'、'product'、'config'等",
"type": "string"
},
"content": {
"description": "内容:JSON字符串,必须是有效的JSON格式。示例:{\"key\":\"value\"}",
"type": "string"
},
"description": {
"description": "描述:项目的详细说明,帮助理解项目用途",
"type": "string"
},
"filter_tags": {
"description": "标签筛选:只显示包含指定标签的JSON,如['user', 'active']",
"items": {
"type": "string"
},
"type": "array"
},
"filter_type": {
"description": "类型筛选:all(全部)、generated(批量生成)、manual(手动创建)",
"enum": [
"all",
"generated",
"manual"
],
"type": "string"
},
"id": {
"description": "项目ID:用于get、edit、delete操作,必须是已存在的ID",
"type": "string"
},
"index": {
"description": "数组索引:add/remove操作时的位置索引,从0开始。不指定则添加到末尾或删除第一个",
"type": "number"
},
"item_type": {
"description": "项目类型:json(JSON数据) 或 template(模板),除stats外都需要指定",
"enum": [
"json",
"template"
],
"type": "string"
},
"limit": {
"description": "列表限制:返回的最大项目数量,默认20,最大100",
"type": "number"
},
"name": {
"description": "名称:创建时的项目名称,建议使用有意义的描述性名称",
"type": "string"
},
"operation": {
"description": "编辑操作:set(设置值)、add(添加元素)、remove(删除)、update(更新对象)",
"enum": [
"set",
"add",
"remove",
"update"
],
"type": "string"
},
"path": {
"description": "节点路径:编辑JSON时的路径,支持点号分隔。示例:'users.0.name'、'config.database.host'",
"type": "string"
},
"sort_by": {
"description": "排序方式:createdAt(创建时间)、updatedAt(更新时间)、name(名称)、size(大小)",
"enum": [
"createdAt",
"updatedAt",
"name",
"size"
],
"type": "string"
},
"tags": {
"description": "标签:JSON项目的分类标签,如['user', 'config', 'test']",
"items": {
"type": "string"
},
"type": "array"
},
"value": {
"description": "新值:要设置、添加或更新的值。可以是任何类型:字符串、数字、数组、对象等"
},
"variables": {
"description": "变量:模板中的变量名列表,如['name', 'age', 'email']",
"items": {
"type": "string"
},
"type": "array"
}
},
"required": [
"action"
],
"type": "object"
}