Skip to main content
Glama
mjucius

Cozi MCP Server

by mjucius

Add an item to a list

add_item

Add an item to a Cozi list by specifying the list ID and text. Optionally set a position. Returns the new item's ID and text.

Instructions

Add an item to a list. Returns: {id, text}.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
list_idYes
textYes
positionNo

Implementation Reference

  • The addItemHandler function that executes the tool logic. It takes a CoziClient, listId, text, and position, calls client.addItem, and returns {id, text}.
    export async function addItemHandler(
      client: CoziClient,
      listId: string,
      text: string,
      position: number,
    ): Promise<{ id: string; text: string }> {
      const item = await client.addItem(listId, text, position);
      return { id: item.id ?? '', text: item.text };
    }
  • Registration of the 'add_item' tool on the MCP server via server.registerTool. Defines input schema (list_id, text, position) and the callback that invokes addItemHandler.
    server.registerTool(
      'add_item',
      {
        title: 'Add an item to a list',
        description: 'Add an item to a list. Returns: {id, text}.',
        inputSchema: {
          list_id: z.string(),
          text: z.string(),
          position: z.number().int().optional(),
        },
      },
      async ({ list_id, text, position }) => {
        const result = await addItemHandler(await getClient(), list_id, text, position ?? 0);
        return { content: [{ type: 'text', text: JSON.stringify(result) }] };
      },
    );
  • Input schema for the 'add_item' tool defined using zod: list_id (string), text (string), position (optional int).
    'add_item',
    {
      title: 'Add an item to a list',
      description: 'Add an item to a list. Returns: {id, text}.',
      inputSchema: {
        list_id: z.string(),
        text: z.string(),
        position: z.number().int().optional(),
      },
  • The CoziClient.addItem method that performs the actual HTTP POST request to the Cozi API endpoint /list/{listId}/item/ with text and position body, parsing the response with CoziItemSchema.
    async addItem(listId: string, text: string, position = 0): Promise<CoziItem> {
      if (!text.trim()) throw new ValidationError('Item text cannot be empty');
      await this.ensureAuthenticated();
      const response = await this.http.request({
        method: 'POST',
        endpoint: this.accountEndpoint(`/list/${listId}/item/`),
        body: { text, position },
      });
      return CoziItemSchema.parse(response);
    }
  • registerItemTools is called from registerCoziTools which wires up all tool registrations to the MCP server.
    registerItemTools(server, getClient);
Behavior3/5

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

With no annotations provided, the description carries the full burden. It states that the tool adds an item (implying mutation) and returns {id, text}. However, it does not disclose side effects, permissions required, rate limits, or error scenarios. The return shape is helpful but incomplete.

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 two short sentences with no extraneous information. It is front-loaded with the core purpose and immediately provides the return structure. Every word earns its place, making it highly efficient.

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?

The tool has 3 parameters, one optional, and no output schema. The description at least mentions the return format ({id, text}). However, it omits critical context such as constraints on list_id (must be valid?), behavior when position is out of bounds, and whether the operation is idempotent. Adequate for a simple tool but leaves gaps.

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

Parameters2/5

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

Schema description coverage is 0%, so the description must compensate for parameter meaning. It does not explain list_id, text, or the optional position parameter. For example, position's impact on insertion order or defaults is omitted. The description adds no semantic value beyond the schema's field names and types.

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 action (add) and the resource (item to a list). It distinguishes from sibling tools like create_list (which creates a list itself) and update_item (which modifies an existing item). The verb+resource combination is specific and unambiguous.

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?

No guidance on when to use this tool versus alternatives such as update_item or remove_items. The description lacks context about prerequisites, such as requiring the list to exist, or when to use optional parameters. An agent has no basis for choosing this tool over others.

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/mjucius/cozi_mcp'

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