Skip to main content
Glama

Manage contact profile

monica_manage_contact_profile

Create, update, or delete contact profiles in Monica CRM by specifying first name, last name, and optional details like nickname, description, gender, and birthdate.

Instructions

Create, update, or delete a contact profile. Use this simplified tool instead of monica_manage_contact when working with contact profiles. Provide firstName, lastName, and optional fields like nickname, description, genderName, birthdate, etc. Gender is optional - omit if unknown.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
actionYes
contactIdNo
profileNo

Implementation Reference

  • Registration of the monica_manage_contact_profile tool. This thin wrapper registers a dedicated tool that delegates to the shared handleContactOperation with section='profile'.
    server.registerTool(
      'monica_manage_contact_profile',
      {
        title: 'Manage contact profile',
        description:
          'Create, update, or delete a contact profile. Use this simplified tool instead of monica_manage_contact when working with contact profiles. Provide firstName, lastName, and optional fields like nickname, description, genderName, birthdate, etc. Gender is optional - omit if unknown.',
        inputSchema: profileInputSchema
      },
      async (rawInput) => {
        const input = z.object(profileInputSchema).parse(rawInput);
    
        return handleContactOperation(
          {
            section: 'profile',
            action: input.action,
            contactId: input.contactId,
            profile: input.profile
          },
          context
        );
      }
    );
  • Handler logic for profile operations (create, update, delete contact profiles) in the shared handleContactOperation function, invoked by the wrapper tool.
    case 'profile': {
      if (input.action === 'delete') {
        await client.deleteContact(input.contactId!);
        logger.info({ contactId: input.contactId }, 'Deleted Monica contact');
    
        return {
          content: [
            {
              type: 'text' as const,
              text: `Deleted contact ID ${input.contactId}.`
            }
          ],
          structuredContent: {
            section: input.section,
            action: input.action,
            contactId: input.contactId
          }
        };
      }
    
      const profile = input.profile!;
      const contactId = input.contactId;
      const genderId = await resolveGenderId(client, profile.genderId, profile.genderName);
      const payload = toContactProfileInput({ ...profile, genderId });
    
      if (input.action === 'create') {
        const response = await client.createContact(payload);
        const contact = normalizeContactDetail(response.data);
        logger.info({ contactId: contact.id }, 'Created Monica contact');
    
        return {
          content: [
            {
              type: 'text' as const,
              text: `Created contact ${contact.name || `#${contact.id}`} (ID ${contact.id}).`
            }
          ],
          structuredContent: {
            section: input.section,
            action: input.action,
            contact
          }
        };
      }
    
      const response = await client.updateContact(contactId!, payload);
      const contact = normalizeContactDetail(response.data);
      logger.info({ contactId }, 'Updated Monica contact');
    
      return {
        content: [
          {
            type: 'text' as const,
            text: `Updated contact ${contact.name || `#${contact.id}`} (ID ${contact.id}).`
          }
        ],
        structuredContent: {
          section: input.section,
          action: input.action,
          contactId,
          contact
        }
      };
    }
  • Zod schema defining the contact profile input structure, used in the tool's inputSchema.
    const contactProfileSchema = z.object({
      firstName: z.string().min(1).max(50),
      lastName: z.string().max(100).optional().nullable(),
      nickname: z.string().max(100).optional().nullable(),
      description: z.string().max(2000).optional().nullable(),
      genderId: z.number().int().positive().optional(),
      genderName: z.string().min(1).max(50).optional(),
      isPartial: z.boolean().optional(),
      isDeceased: z.boolean().optional(),
      birthdate: birthdateSchema.optional(),
      deceasedDate: deceasedDateSchema.optional(),
      remindOnDeceasedDate: z.boolean().optional()
    });
  • Helper function to transform the input profile form to the Monica API ContactProfileInput format.
    function toContactProfileInput(profile: ContactProfileForm & { genderId?: number }): ContactProfileInput {
      return {
        firstName: profile.firstName,
        lastName: profile.lastName ?? null,
        nickname: profile.nickname ?? null,
        description: profile.description ?? null,
        genderId: profile.genderId,
        isPartial: profile.isPartial,
        isDeceased: profile.isDeceased,
        birthdate: profile.birthdate as ContactProfileInput['birthdate'],
        deceasedDate: profile.deceasedDate as ContactProfileInput['deceasedDate'],
        remindOnDeceasedDate: profile.remindOnDeceasedDate
      };
    }
  • Tool-specific input schema combining action, optional contactId, and profile data.
    const profileInputSchema = {
      action: z.enum(['create', 'update', 'delete']),
      contactId: z.number().int().positive().optional(),
      profile: contactProfileSchema.optional()
    };
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. While it mentions the three actions (create/update/delete), it doesn't explain permission requirements, whether deletions are permanent, how updates handle missing fields, or error conditions. For a 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.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is efficiently structured in two sentences: first states purpose and sibling differentiation, second provides parameter guidance. Every sentence adds value, though it could be slightly more front-loaded with critical behavioral information given the mutation nature.

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 mutation tool with 3 parameters (including complex nested objects), 0% schema description coverage, no annotations, and no output schema, the description is incomplete. It doesn't explain what happens during different actions, what the tool returns, or how to handle the profile object's many fields beyond the few mentioned.

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?

The description mentions key parameters (firstName, lastName, nickname, description, genderName, birthdate) and notes gender is optional. However, with 0% schema description coverage and 3 total parameters (including complex nested objects), the description doesn't fully explain the action enum, contactId usage, or the profile object structure. It adds some value but doesn't compensate for the complete schema coverage gap.

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 tool's purpose: 'Create, update, or delete a contact profile.' It specifies the resource (contact profile) and distinguishes it from sibling 'monica_manage_contact' by noting this is a 'simplified tool' for profiles specifically.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides explicit guidance: 'Use this simplified tool instead of monica_manage_contact when working with contact profiles.' This directly tells the agent when to use this tool versus a key alternative, fulfilling the highest scoring criteria.

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