Skip to main content
Glama

create_project_label

Create project labels in Todoist that start with "PROJECT: " to organize and categorize tasks by project. The tool automatically assigns a charcoal color to each new project label.

Instructions

Create a new project label in Todoist. The label name must start with "PROJECT: " (with a space after the colon). The label will be created with charcoal color.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
project_nameYesThe name of the project label. Must start with "PROJECT: " (e.g., "PROJECT: Website Redesign")

Implementation Reference

  • The handler function for the 'create_project_label' tool. It extracts the project_name from args, calls the createProjectLabel service function, and returns the result as a formatted ToolResponse.
    handler: async (args: { project_name: string }) => {
      console.error('Executing create_project_label...');
      const { project_name } = args;
      if (!project_name) {
        throw new Error('project_name is required');
      }
      const result = await createProjectLabel(project_name);
      console.error('create_project_label completed successfully');
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify(result, null, 2),
          },
        ],
      };
    },
  • The schema definition for the 'create_project_label' tool, including name, description, and input schema requiring 'project_name'.
    schema: {
      name: 'create_project_label',
      description:
        'Create a new project label in Todoist. The label name must start with "PROJECT: " (with a space after the colon). The label will be created with charcoal color.',
      inputSchema: {
        type: 'object',
        properties: {
          project_name: {
            type: 'string',
            description:
              'The name of the project label. Must start with "PROJECT: " (e.g., "PROJECT: Website Redesign")',
          },
        },
        required: ['project_name'],
      },
    },
  • The core helper function that performs the actual Todoist API call to create a new project label with the given name and charcoal color.
    export async function createProjectLabel(projectName: string): Promise<{
      id: number;
      name: string;
      color: string;
      order: number;
      is_favorite: boolean;
    }> {
      const todoistClient = getTodoistClient();
    
      try {
        // Validate that the project name starts with "PROJECT: "
        if (!projectName.startsWith('PROJECT: ')) {
          throw new Error('Project label name must start with "PROJECT: "');
        }
    
        if (!todoistClient.post) {
          throw new Error('POST method not available on Todoist client');
        }
    
        const response = await todoistClient.post<TodoistLabel>('/labels', {
          name: projectName,
          color: 'charcoal',
        });
    
        return {
          id: parseInt(response.data.id),
          name: response.data.name,
          color: response.data.color,
          order: response.data.order,
          is_favorite: response.data.is_favorite,
        };
      } catch (error) {
        throw new Error(
          `Failed to create project label: ${getErrorMessage(error)}`
        );
      }
    }
  • Registration of the 'create_project_label' tool handler in the toolsWithArgs registry used by handleToolRequest.
    const toolsWithArgs: Record<string, (args: any) => Promise<ToolResponse>> = {
      get_task_comments: getTaskCommentsTool.handler,
      create_project_label: createProjectLabelTool.handler,
      create_task_comment: createTaskCommentTool.handler,
      update_task: updateTaskTool.handler,
      create_task: createTaskTool.handler,
      move_task: moveTaskTool.handler,
      get_tasks_with_label: getTasksWithLabelTool.handler,
      complete_task: completeTaskTool.handler,
      uncomplete_task: uncompleteTaskTool.handler,
      search_tasks: searchTasksTool.handler,
      search_tasks_using_and: searchTasksUsingAndTool.handler,
      search_tasks_using_or: searchTasksUsingOrTool.handler,
      complete_becky_task: completeBeckyTaskTool.handler,
    };
  • src/index.ts:91-91 (registration)
    The tool schema is included in the listTools response for MCP protocol.
    createProjectLabelTool.schema,
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden. It discloses that the tool creates a label with a fixed charcoal color, which is useful behavioral context. However, it does not mention permissions, rate limits, or what happens on failure (e.g., duplicate names), leaving gaps in transparency for a mutation tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is front-loaded with the core action, followed by specific constraints (naming rule and color). Both sentences are essential—the first states the purpose, and the second adds critical behavioral details—with no wasted words, making it highly efficient and well-structured.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (a mutation with no annotations and no output schema), the description covers the creation action, naming rule, and color, but lacks information on return values, error handling, or system-level behaviors. It is adequate for basic use but incomplete for full contextual understanding.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the baseline is 3. The description adds value by reinforcing the naming requirement ('must start with "PROJECT: "') and providing an example, which clarifies semantics beyond the schema's basic description. This extra guidance justifies a score above the baseline.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the specific action ('Create a new project label'), the target resource ('in Todoist'), and distinguishes it from siblings by focusing on label creation rather than tasks or other operations. It specifies the unique naming convention and color, making the purpose unambiguous and differentiated.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage for creating project labels in Todoist with specific formatting, but does not explicitly state when to use this tool versus alternatives (e.g., other label-related tools if they existed) or mention prerequisites. It provides context but lacks explicit guidance on exclusions or comparisons with sibling tools.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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/bkotos/todoist-mcp'

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