Skip to main content
Glama

Add Todos (Batch)

add_todos

Add multiple todo items in a single batch operation to manage tasks with titles, descriptions, priorities, due dates, and tags.

Instructions

Add multiple todo items in one call

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
itemsYesTodos to add in a single batch

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
okYes
errorNo
resultNo

Implementation Reference

  • The handler function for the 'add_todos' tool. It processes the input items by calling addTodos from storage, creates a success response with the added todos, or handles errors.
    async ({ items }) => {
      try {
        const todos = await addTodos(items);
        return createToolResponse({
          ok: true,
          result: {
            items: todos,
            summary: `Added ${String(todos.length)} todos`,
            nextActions: ['list_todos', 'update_todo'],
          },
        });
      } catch (err) {
        return createErrorResponse('E_ADD_TODOS', getErrorMessage(err));
      }
    }
  • Zod schema defining the input structure for add_todos: an array of TodoInput objects with validation.
    export const AddTodosSchema: ZodType<AddTodosInput> = z.strictObject({
      items: z
        .array(TodoInputSchema)
        .min(1)
        .max(50)
        .describe('Todos to add in a single batch'),
    });
  • Registers the 'add_todos' tool on the MCP server with schema, description, and handler function.
    export function registerAddTodos(server: McpServer): void {
      server.registerTool(
        'add_todos',
        {
          title: 'Add Todos (Batch)',
          description: 'Add multiple todo items in one call',
          inputSchema: AddTodosSchema,
          outputSchema: DefaultOutputSchema,
          annotations: {
            readOnlyHint: false,
            idempotentHint: false,
          },
        },
        async ({ items }) => {
          try {
            const todos = await addTodos(items);
            return createToolResponse({
              ok: true,
              result: {
                items: todos,
                summary: `Added ${String(todos.length)} todos`,
                nextActions: ['list_todos', 'update_todo'],
              },
            });
          } catch (err) {
            return createErrorResponse('E_ADD_TODOS', getErrorMessage(err));
          }
        }
      );
    }
  • Helper function that creates new Todo objects from input and appends them to the todos list in storage.
    export function addTodos(items: NewTodoInput[]): Promise<Todo[]> {
      const timestamp = new Date().toISOString();
      return withTodos((todos) => {
        const newTodos = items.map((item) => createNewTodo(item, timestamp));
        return { todos: [...todos, ...newTodos], result: newTodos };
      });
    }
  • Invokes the registration of the add_todos tool as part of registering all tools.
    registerAddTodos(server);
Behavior3/5

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

Annotations indicate this is a non-readOnly, non-idempotent operation, which the description aligns with by implying creation ('Add'). However, the description adds minimal behavioral context beyond annotations—it doesn't disclose rate limits, authentication needs, batch size implications (e.g., partial failures), or what happens on success/failure. No contradiction with annotations exists.

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 a single, efficient sentence that front-loads the core action ('Add multiple todo items') and specifies the batch mechanism ('in one call'). There is zero wasted verbiage, making it highly concise and well-structured for quick comprehension.

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 moderate complexity (batch mutation), rich input schema (100% coverage), annotations (readOnlyHint=false, idempotentHint=false), and presence of an output schema, the description is minimally adequate. However, it lacks context on batch behavior (e.g., atomicity, error handling) and doesn't leverage the output schema to hint at return values, leaving gaps for an agent.

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?

With 100% schema description coverage, the input schema fully documents the 'items' parameter and its nested properties (title, description, priority, dueDate, tags). The description adds no additional parameter semantics beyond the schema, merely restating the batch concept. Baseline 3 is appropriate as the schema carries the full burden.

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 clearly states the verb ('Add') and resource ('multiple todo items'), specifying it's a batch operation ('in one call'). It distinguishes from the singular 'add_todo' sibling tool by emphasizing the batch capability, though it doesn't explicitly contrast with other siblings like 'list_todos' or 'delete_todos'.

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. It doesn't mention when batch addition is preferred over the singular 'add_todo', nor does it address prerequisites, error handling, or any contextual constraints for batch operations.

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