Skip to main content
Glama

Manage Monica tags

monica_manage_tag

Manage contact tags in Monica CRM to organize and categorize your contacts effectively. Perform actions like listing, creating, updating, or deleting tags for better contact management.

Instructions

List, inspect, create, update, or delete tags. Tags allow you to group and categorize contacts.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
actionYes
tagIdNo
limitNo
pageNo
payloadNo

Implementation Reference

  • Handler function for 'monica_manage_tag' tool that supports listing, getting, creating, updating, and deleting tags using MonicaClient methods.
    async ({ action, tagId, payload, limit, page }) => {
      switch (action) {
        case 'list': {
          const result = await client.listTags(limit, page);
          const tags = result.data.map(normalizeTag);
    
          return {
            content: [
              {
                type: 'text' as const,
                text: `Found ${result.meta.total} tags:\n${tags.map((tag) => `• ${tag.name} (ID: ${tag.id})`).join('\n')}`
              }
            ]
          };
        }
    
        case 'get': {
          if (!tagId) {
            throw new Error('tagId is required for get action');
          }
    
          const result = await client.getTag(tagId);
          const tag = normalizeTag(result.data);
    
          return {
            content: [
              {
                type: 'text' as const,
                text: `Tag Details:\n• Name: ${tag.name}\n• Slug: ${tag.nameSlug}\n• Created: ${tag.createdAt}\n• Updated: ${tag.updatedAt}`
              }
            ]
          };
        }
    
        case 'create': {
          if (!payload) {
            throw new Error('payload is required for create action');
          }
    
          const input = toTagPayloadInput(payload);
          const result = await client.createTag(input);
          const tag = normalizeTag(result.data);
    
          return {
            content: [
              {
                type: 'text' as const,
                text: `Created tag "${tag.name}" (ID: ${tag.id})`
              }
            ]
          };
        }
    
        case 'update': {
          if (!tagId) {
            throw new Error('tagId is required for update action');
          }
          if (!payload) {
            throw new Error('payload is required for update action');
          }
    
          const input = toTagPayloadInput(payload);
          const result = await client.updateTag(tagId, input);
          const tag = normalizeTag(result.data);
    
          return {
            content: [
              {
                type: 'text' as const,
                text: `Updated tag "${tag.name}" (ID: ${tag.id})`
              }
            ]
          };
        }
    
        case 'delete': {
          if (!tagId) {
            throw new Error('tagId is required for delete action');
          }
    
          await client.deleteTag(tagId);
    
          return {
            content: [
              {
                type: 'text' as const,
                text: `Deleted tag with ID ${tagId}`
              }
            ]
          };
        }
    
        default:
          throw new Error(`Unknown action: ${action}`);
      }
    }
  • Registration of the 'monica_manage_tag' tool, including title, description, input schema, and reference to the handler function.
    server.registerTool(
      'monica_manage_tag',
      {
        title: 'Manage Monica tags',
        description: 'List, inspect, create, update, or delete tags. Tags allow you to group and categorize contacts.',
        inputSchema: {
          action: z.enum(['list', 'get', 'create', 'update', 'delete']),
          tagId: z.number().int().positive().optional(),
          limit: z.number().int().min(1).max(100).optional(),
          page: z.number().int().min(1).optional(),
          payload: tagPayloadSchema.optional()
        }
      },
      async ({ action, tagId, payload, limit, page }) => {
        switch (action) {
          case 'list': {
            const result = await client.listTags(limit, page);
            const tags = result.data.map(normalizeTag);
    
            return {
              content: [
                {
                  type: 'text' as const,
                  text: `Found ${result.meta.total} tags:\n${tags.map((tag) => `• ${tag.name} (ID: ${tag.id})`).join('\n')}`
                }
              ]
            };
          }
    
          case 'get': {
            if (!tagId) {
              throw new Error('tagId is required for get action');
            }
    
            const result = await client.getTag(tagId);
            const tag = normalizeTag(result.data);
    
            return {
              content: [
                {
                  type: 'text' as const,
                  text: `Tag Details:\n• Name: ${tag.name}\n• Slug: ${tag.nameSlug}\n• Created: ${tag.createdAt}\n• Updated: ${tag.updatedAt}`
                }
              ]
            };
          }
    
          case 'create': {
            if (!payload) {
              throw new Error('payload is required for create action');
            }
    
            const input = toTagPayloadInput(payload);
            const result = await client.createTag(input);
            const tag = normalizeTag(result.data);
    
            return {
              content: [
                {
                  type: 'text' as const,
                  text: `Created tag "${tag.name}" (ID: ${tag.id})`
                }
              ]
            };
          }
    
          case 'update': {
            if (!tagId) {
              throw new Error('tagId is required for update action');
            }
            if (!payload) {
              throw new Error('payload is required for update action');
            }
    
            const input = toTagPayloadInput(payload);
            const result = await client.updateTag(tagId, input);
            const tag = normalizeTag(result.data);
    
            return {
              content: [
                {
                  type: 'text' as const,
                  text: `Updated tag "${tag.name}" (ID: ${tag.id})`
                }
              ]
            };
          }
    
          case 'delete': {
            if (!tagId) {
              throw new Error('tagId is required for delete action');
            }
    
            await client.deleteTag(tagId);
    
            return {
              content: [
                {
                  type: 'text' as const,
                  text: `Deleted tag with ID ${tagId}`
                }
              ]
            };
          }
    
          default:
            throw new Error(`Unknown action: ${action}`);
        }
      }
    );
  • Zod input schema defining parameters for the tool: action, optional tagId, limit, page, and payload.
    inputSchema: {
      action: z.enum(['list', 'get', 'create', 'update', 'delete']),
      tagId: z.number().int().positive().optional(),
      limit: z.number().int().min(1).max(100).optional(),
      page: z.number().int().min(1).optional(),
      payload: tagPayloadSchema.optional()
  • Zod schema for tag payload, requiring a name string between 1 and 255 characters.
    const tagPayloadSchema = z.object({
      name: z.string().min(1).max(255)
    });
  • Helper function to convert TagPayloadForm to the input format expected by createTag and updateTag methods.
    function toTagPayloadInput(payload: TagPayloadForm): CreateTagPayload & UpdateTagPayload {
      return {
        name: payload.name
      };
    }
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It mentions the actions (list, inspect, create, update, delete) but fails to detail critical traits like authentication requirements, rate limits, error handling, or the effects of destructive actions (e.g., deletion permanence). For a multi-action tool with no annotation coverage, this 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 appropriately sized and front-loaded, consisting of two concise sentences that directly state the tool's purpose and function without unnecessary details. Every sentence earns its place by providing essential information efficiently.

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?

Given the tool's complexity (5 parameters, multiple actions including destructive ones), lack of annotations, and no output schema, the description is incomplete. It does not cover behavioral aspects, parameter usage, or return values, leaving significant gaps for the agent to operate effectively in this context.

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 0%, so the description must compensate for undocumented parameters. It implies the 'action' parameter through the listed verbs but does not explain the semantics of other parameters like 'tagId', 'limit', 'page', or 'payload'. The description adds minimal value beyond what the schema's property names suggest, resulting in a baseline score due to incomplete parameter guidance.

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 tool's purpose as 'List, inspect, create, update, or delete tags' with the specific resource 'tags' and mentions their function 'to group and categorize contacts.' It distinguishes itself from sibling tools like 'monica_manage_contact_tags' by focusing on tag management rather than contact-tag relationships, but does not explicitly contrast with other tag-related tools if any exist.

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, such as 'monica_manage_contact_tags' for managing tags on contacts or other tag-related operations. It lacks explicit context, prerequisites, or exclusions, leaving the agent to infer usage based on the action parameter alone.

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/Jacob-Stokes/monica-mcp'

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