Skip to main content
Glama

Add Todo

add_todo

Create a new task with title, optional description, priority, due date, and tags for organized task management.

Instructions

Add a new todo item

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
titleYesThe title of the todo
descriptionNoOptional description of the todo
priorityNoPriority level (default: normal)
dueDateNoDue date in ISO format (YYYY-MM-DD)
tagsNoTags for categorization

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
okYes
errorNo
resultNo

Implementation Reference

  • The handler function for the 'add_todo' MCP tool. It destructures input parameters, calls the storage addTodo function, and returns a formatted tool response or error.
    async ({ title, description, priority, dueDate, tags }) => {
      try {
        const todo = await addTodo(title, description, priority, dueDate, tags);
        return createToolResponse({
          ok: true,
          result: {
            item: todo,
            summary: `Added todo "${todo.title}"`,
            nextActions: ['list_todos', 'update_todo', 'complete_todo'],
          },
        });
      } catch (err) {
        return createErrorResponse('E_ADD_TODO', getErrorMessage(err));
      }
    }
  • Registration of the 'add_todo' tool with the MCP server, including metadata, schemas, and inline handler.
    export function registerAddTodo(server: McpServer): void {
      server.registerTool(
        'add_todo',
        {
          title: 'Add Todo',
          description: 'Add a new todo item',
          inputSchema: AddTodoSchema,
          outputSchema: DefaultOutputSchema,
          annotations: {
            readOnlyHint: false,
            idempotentHint: false,
          },
        },
        async ({ title, description, priority, dueDate, tags }) => {
          try {
            const todo = await addTodo(title, description, priority, dueDate, tags);
            return createToolResponse({
              ok: true,
              result: {
                item: todo,
                summary: `Added todo "${todo.title}"`,
                nextActions: ['list_todos', 'update_todo', 'complete_todo'],
              },
            });
          } catch (err) {
            return createErrorResponse('E_ADD_TODO', getErrorMessage(err));
          }
        }
      );
    }
  • Zod schema for 'add_todo' input validation (TodoInputSchema aliased as AddTodoSchema).
    const TodoInputSchema: ZodType<TodoInput> = z.strictObject({
      title: z.string().min(1).max(200).describe('The title of the todo'),
      description: z
        .string()
        .max(2000)
        .optional()
        .describe('Optional description of the todo'),
      priority: z
        .enum(['low', 'normal', 'high'])
        .optional()
        .describe('Priority level (default: normal)'),
      dueDate: IsoDateSchema.optional().describe(
        'Due date in ISO format (YYYY-MM-DD)'
      ),
      tags: z
        .array(TagSchema)
        .max(50)
        .optional()
        .describe('Tags for categorization'),
    });
    
    export const AddTodoSchema: ZodType<TodoInput> = TodoInputSchema;
  • Helper function that adds a single todo item by wrapping the batch addTodos function from storage layer.
    export async function addTodo(
      title: string,
      description?: string,
      priority: 'low' | 'normal' | 'high' = 'normal',
      dueDate?: string,
      tags: string[] = []
    ): Promise<Todo> {
      const [todo] = await addTodos([
        { title, description, priority, dueDate, tags },
      ]);
      if (!todo) {
        throw new Error('Failed to create todo');
      }
      return todo;
    }
  • Top-level call to register the 'add_todo' tool as part of all tools registration.
    registerAddTodo(server);
Behavior3/5

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

Annotations already declare readOnlyHint=false and idempotentHint=false, so the agent knows this is a non-read-only, non-idempotent operation. The description adds minimal behavioral context beyond this - it doesn't mention whether this creates a persistent record, what happens on duplicate titles, or any rate limits. With annotations covering the basic safety profile, this earns a baseline score.

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 maximally concise - a single clear sentence that states the core purpose without any wasted words. It's appropriately sized for a straightforward creation tool and gets directly to the point.

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

Completeness4/5

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

Given that the tool has comprehensive schema documentation (100% coverage), clear annotations, and an output schema (implied by 'Has output schema: true'), the minimal description is reasonably complete. The main gap is lack of differentiation from sibling tools, but the structured data provides sufficient context for basic usage.

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

Parameters3/5

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

Schema description coverage is 100%, with each parameter well-documented in the schema itself (title requirements, optional description, priority enum values, date format, tags constraints). The description adds no parameter information beyond what's already in the structured schema, so it meets but doesn't exceed the baseline expectation.

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

Purpose4/5

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

The description 'Add a new todo item' clearly states the verb ('Add') and resource ('todo item'), making the purpose immediately understandable. However, it doesn't differentiate from sibling tools like 'add_todos' (plural) or 'update_todo', which could cause confusion about when to use this specific tool versus alternatives.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives. With sibling tools like 'add_todos' (plural), 'update_todo', and 'complete_todo', the agent has no indication whether this is for single todo creation versus batch operations, or whether it should be used for initial creation versus updates.

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/j0hanz/todokit-mcp-server'

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