Skip to main content
Glama

json_import

Import multiple to-dos and projects into Things 3 from JSON data arrays, supporting complex nested structures for batch task management.

Instructions

JSON批量导入待办事项和项目。支持复杂的嵌套结构。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dataYesJSON数据数组,包含to-do和project对象
authTokenNo授权令牌(如包含更新操作则必需)
revealNo是否显示第一个创建的项

Implementation Reference

  • The handler function that implements the core logic of the 'json_import' tool. It processes the input arguments, stringifies the data, checks for update operations requiring authToken, builds a Things URL scheme using buildThingsUrl('json', params), executes it via openThingsUrl, and returns a success message.
    async handleJsonImport(args) { const authToken = args.authToken || DEFAULT_AUTH_TOKEN; const params = { data: JSON.stringify(args.data), reveal: args.reveal, }; // 如果数据中包含更新操作,需要授权令牌 const hasUpdate = args.data.some(item => item.operation === 'update'); if (hasUpdate && !authToken) { throw new Error('JSON数据包含更新操作,需要授权令牌'); } if (authToken) { params.authToken = authToken; } const url = buildThingsUrl('json', params); await this.openThingsUrl(url); return { content: [ { type: 'text', text: `✅ JSON导入命令已发送 (${args.data.length}个项目)`, }, ], }; }
  • The input schema and metadata for the 'json_import' tool, defined in the ListTools response. Specifies the expected input structure including required 'data' array.
    { name: 'json_import', description: 'JSON批量导入待办事项和项目。支持复杂的嵌套结构。', inputSchema: { type: 'object', properties: { data: { type: 'array', description: 'JSON数据数组,包含to-do和project对象', }, authToken: { type: 'string', description: '授权令牌(如包含更新操作则必需)', }, reveal: { type: 'boolean', description: '是否显示第一个创建的项', }, }, required: ['data'], }, },
  • src/index.js:445-446 (registration)
    The dispatch case in the CallToolRequestSchema handler that routes 'json_import' calls to the handleJsonImport method.
    case 'json_import': return await this.handleJsonImport(args);

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Mieluoxxx/things_mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server