Skip to main content
Glama

delete_project

Remove a project from the Things 3 task management app by marking it as canceled. Requires the project ID and authentication token.

Instructions

删除项目(通过将其标记为已取消)。需要提供项目ID和授权令牌。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYes项目的ID(必需)
authTokenNo授权令牌(如未提供,将使用环境变量THINGS_AUTH_TOKEN)

Implementation Reference

  • The handler function for the delete_project tool. It retrieves the authToken, constructs parameters to set the project as canceled, builds a Things URL using buildThingsUrl('update-project'), opens the URL, and returns a success message.
    async handleDeleteProject(args) {
      const authToken = args.authToken || DEFAULT_AUTH_TOKEN;
      if (!authToken) {
        throw new Error('需要授权令牌。请设置环境变量THINGS_AUTH_TOKEN或在参数中提供authToken');
      }
    
      // 通过将 canceled 设为 true 来实现删除效果
      const params = {
        id: args.id,
        authToken,
        canceled: true,
      };
    
      const url = buildThingsUrl('update-project', params);
      await this.openThingsUrl(url);
    
      return {
        content: [
          {
            type: 'text',
            text: `🗑️ 项目已删除 (ID: ${args.id})`,
          },
        ],
      };
    }
  • Input schema for the delete_project tool, requiring 'id' and optionally 'authToken'.
    inputSchema: {
      type: 'object',
      properties: {
        id: {
          type: 'string',
          description: '项目的ID(必需)',
        },
        authToken: {
          type: 'string',
          description: '授权令牌(如未提供,将使用环境变量THINGS_AUTH_TOKEN)',
        },
      },
      required: ['id'],
    },
  • src/index.js:400-417 (registration)
    Tool registration in the ListToolsRequestSchema handler, defining name, description, and inputSchema for delete_project.
    {
      name: 'delete_project',
      description: '删除项目(通过将其标记为已取消)。需要提供项目ID和授权令牌。',
      inputSchema: {
        type: 'object',
        properties: {
          id: {
            type: 'string',
            description: '项目的ID(必需)',
          },
          authToken: {
            type: 'string',
            description: '授权令牌(如未提供,将使用环境变量THINGS_AUTH_TOKEN)',
          },
        },
        required: ['id'],
      },
    },
  • src/index.js:437-438 (registration)
    Dispatch case in the CallToolRequestSchema handler switch statement that routes to the delete_project handler.
    case 'delete_project':
      return await this.handleDeleteProject(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