Skip to main content
Glama
glaucia86
by glaucia86

create_todo

Add a new task with title, description, priority, and tags to organize your to-do list effectively.

Instructions

Create a new todo item with validation

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
titleYesTitle of the todo (1-200 characters)
descriptionNoOptional description (max 1000 characters)
priorityNoPriority levelmedium
tagsNoTags for categorization

Implementation Reference

  • The handleCreateTodo method implements the core logic for the create_todo tool: sanitizes and validates input using CreateTodoSchema, creates the todo via TodoService, and returns a success response.
    private async handleCreateTodo(request: CallToolRequest): Promise<CallToolResult> {
      try {
        const sanitizedArgs = sanitizeInput(request.params.arguments);
        const validatedRequest = validateData(CreateTodoSchema, sanitizedArgs);
        
        const todo = this.todoService.createTodo({
          ...validatedRequest,
          priority: validatedRequest.priority || "medium",
          tags: validatedRequest.tags || [],
        });
    
        return {
          content: [
            {
              type: "text",
              text: `✅ Todo criado com sucesso!\n\n${JSON.stringify(todo, null, 2)}`,
            },
          ],
        };
      } catch (error) {
        const errorResponse = createErrorResponse(error, "criar todo");
        return {
          content: [
            {
              type: "text",
              text: `❌ ${errorResponse.error}\n${errorResponse.details || ""}`,
            },
          ],
        };
      }
    }
  • Tool definition and registration in TOOL_DEFINITIONS array, including name, description, and inputSchema.
    {
      name: "create_todo",
      description: "Create a new todo item with validation",
      inputSchema: {
        type: "object",
        properties: {
          title: {
            type: "string",
            description: "Title of the todo (1-200 characters)",
            minLength: 1,
            maxLength: 200,
          },
          description: {
            type: "string",
            description: "Optional description (max 1000 characters)",
            maxLength: 1000,
          },
          priority: {
            type: "string",
            enum: ["low", "medium", "high"],
            description: "Priority level",
            default: "medium",
          },
          tags: {
            type: "array",
            items: { type: "string", minLength: 1, maxLength: 50 },
            maxItems: 10,
            description: "Tags for categorization",
            default: [],
          },
        },
        required: ["title"],
      },
    },
  • Zod schema definition for CreateTodoSchema used in validation for create_todo input.
    export const CreateTodoSchema = z.object({
      title: NonEmptyStringSchema.max(200, 'Título não pode exceder 200 caracteres'),
      description: z.string().max(500, 'Descrição não pode exceder 500 caracteres').optional(),
      priority: z.enum(['low', 'medium', 'high']).default('medium'),
      tags: z.array(z.string().min(1).max(50)).max(10).default([])
    });
  • TodoService.createTodo method that generates UUID, sets defaults, validates with CreateTodoSchema, stores the todo in an in-memory Map, and returns the new Todo object.
    createTodo(request: CreateTodoRequest): Todo {
      // Validar entrada
      const validatedRequest = validateData(CreateTodoSchema, request);
      
      const todo: Todo = {
        id: randomUUID(),
        title: validatedRequest.title,
        description: validatedRequest.description,
        completed: false,
        createdAt: new Date(),
        priority: validatedRequest.priority || 'medium',
        tags: validatedRequest.tags || []
      };
    
      this.todos.set(todo.id, todo);
      
      return todo;
    }
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It mentions 'validation' but doesn't specify what validation entails (e.g., format checks, uniqueness, permissions). For a creation tool with mutation implications, this lack of detail about behavior, error handling, or side effects is a significant gap.

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 directly states the tool's function. It's front-loaded with the core purpose and avoids unnecessary words, making it highly concise and well-structured.

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

Completeness2/5

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

For a creation tool with no annotations and no output schema, the description is incomplete. It lacks details on what happens after creation (e.g., returns an ID, error responses), validation specifics, and how it fits with sibling tools, leaving critical context gaps for effective use.

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%, providing detailed documentation for all parameters. The description adds no additional parameter semantics beyond what's in the schema, so it meets the baseline but doesn't enhance understanding of the inputs.

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 action ('Create a new todo item') and resource ('todo item'), making the purpose immediately understandable. However, it doesn't differentiate from sibling tools like 'update_todo' or specify what kind of validation occurs, which prevents a perfect score.

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 like 'update_todo' or 'list_todos'. There's no mention of prerequisites, context for creation, or comparison with sibling tools, leaving usage decisions ambiguous.

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/glaucia86/todo-list-mcp-server'

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