Skip to main content
Glama

bulk_update

Update multiple memories simultaneously by specifying memory IDs and new field values. Modify content, importance, scope, type, category, subject, or tags for up to 50 items per operation.

Instructions

Update multiple memories at once. Each item needs a memory_id and fields to update. Maximum 50 items per call.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
updatesYesArray of update objects (max 50)

Implementation Reference

  • Handler function for bulk_update tool - calls the API endpoint /cogmemai/bulk-update with POST method, passing the updates array and returning wrapped result or error.
    async ({ updates }) => {
      try {
        const result = await api('/cogmemai/bulk-update', 'POST', { updates });
        return wrapResult(result);
      } catch (error) {
        return wrapError(error);
      }
    }
  • Zod schema definition for bulk_update input - validates an array of update objects (1-50 items), each containing memory_id (required) and optional fields: content, importance, scope, memory_type, category, subject, tags.
    updates: z
      .array(
        z.object({
          memory_id: z.coerce.number().int().describe('Memory ID to update'),
          content: z.string().min(5).max(2000).optional().describe('New content'),
          importance: z.coerce.number().int().min(1).max(10).optional().describe('New importance'),
          scope: z.enum(['global', 'project']).optional().describe('New scope'),
          memory_type: z.enum(MEMORY_TYPES).optional().describe('New memory type'),
          category: z.string().max(50).optional().describe('New category'),
          subject: z.string().max(100).optional().describe('New subject'),
          tags: z.array(z.string().max(30)).max(5).optional().describe('New tags'),
        })
      )
      .min(1)
      .max(50)
      .describe('Array of update objects (max 50)'),
  • src/tools.ts:566-595 (registration)
    Full tool registration using server.tool() - registers 'bulk_update' with description, input schema, and handler function.
    server.tool(
      'bulk_update',
      'Update multiple memories at once. Each item needs a memory_id and fields to update. Maximum 50 items per call.',
      {
        updates: z
          .array(
            z.object({
              memory_id: z.coerce.number().int().describe('Memory ID to update'),
              content: z.string().min(5).max(2000).optional().describe('New content'),
              importance: z.coerce.number().int().min(1).max(10).optional().describe('New importance'),
              scope: z.enum(['global', 'project']).optional().describe('New scope'),
              memory_type: z.enum(MEMORY_TYPES).optional().describe('New memory type'),
              category: z.string().max(50).optional().describe('New category'),
              subject: z.string().max(100).optional().describe('New subject'),
              tags: z.array(z.string().max(30)).max(5).optional().describe('New tags'),
            })
          )
          .min(1)
          .max(50)
          .describe('Array of update objects (max 50)'),
      },
      async ({ updates }) => {
        try {
          const result = await api('/cogmemai/bulk-update', 'POST', { updates });
          return wrapResult(result);
        } catch (error) {
          return wrapError(error);
        }
      }
    );
  • wrapError helper function - formats error messages for MCP tool responses, used by the bulk_update handler to return errors.
    function wrapError(error: unknown): { content: Array<{ type: 'text'; text: string }>; isError: true } {
      const message = error instanceof Error ? error.message : String(error);
      return {
        content: [{
          type: 'text' as const,
          text: JSON.stringify({ error: message }),
        }],
        isError: true,
      };
    }
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 states this is an update operation (implying mutation) and mentions the 50-item limit, but doesn't describe permissions needed, whether updates are atomic/partial, error behavior for invalid items, or what the response contains. For a bulk mutation tool with zero annotation coverage, this leaves significant behavioral gaps.

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?

Two concise sentences with zero waste. The first states the core purpose, the second adds the key constraint. Every word earns its place, and the information is front-loaded appropriately for a tool description.

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?

For a bulk mutation tool with no annotations and no output schema, the description is minimally adequate. It covers the basic purpose and a key constraint (50-item limit), but lacks important context about permissions, error handling, response format, and when to choose this over 'update_memory'. The 100% schema coverage helps, but behavioral aspects are underspecified.

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%, so the schema fully documents the 'updates' parameter and its nested structure. The description adds that 'Each item needs a memory_id and fields to update' and the 'Maximum 50 items per call' constraint, which provides some context beyond the schema's technical specifications. This meets the baseline for high schema coverage.

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 'Update multiple memories at once' which specifies the verb (update) and resource (memories) with the bulk operation scope. It distinguishes from sibling 'update_memory' by emphasizing the multiple/batch nature, though it doesn't explicitly contrast them. The purpose is specific and actionable.

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_memory' or other sibling tools. It mentions the 50-item limit which is a constraint but not usage context. There's no mention of prerequisites, error handling, or comparative scenarios with single-update 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/hifriendbot/cogmemai-mcp'

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