Skip to main content
Glama

Manage contact addresses

monica_manage_contact_address

Manage contact addresses in Monica CRM by listing, creating, updating, or deleting address records with street, city, postal code, and country details.

Instructions

List, get, create, update, or delete contact addresses. Use this simplified tool instead of monica_manage_contact when managing addresses. Provide contactId and addressPayload with name, street, city, province, postalCode, and countryName (country lookup is automatic).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
actionYes
contactIdNo
addressIdNo
addressPayloadNo
limitNo
pageNo

Implementation Reference

  • Tool registration for monica_manage_contact_address, including wrapper handler that delegates to core handleContactOperation with section set to 'address'.
    server.registerTool(
      'monica_manage_contact_address',
      {
        title: 'Manage contact addresses',
        description:
          'List, get, create, update, or delete contact addresses. Use this simplified tool instead of monica_manage_contact when managing addresses. Provide contactId and addressPayload with name, street, city, province, postalCode, and countryName (country lookup is automatic).',
        inputSchema: addressInputSchema
      },
      async (rawInput) => {
        const input = z.object(addressInputSchema).parse(rawInput);
    
        return handleContactOperation(
          {
            section: 'address',
            action: input.action,
            contactId: input.contactId,
            addressId: input.addressId,
            addressPayload: input.addressPayload,
            limit: input.limit,
            page: input.page
          },
          context
        );
      }
    );
  • Input schema validation for the monica_manage_contact_address tool.
    const addressInputSchema = {
      action: z.enum(['list', 'get', 'create', 'update', 'delete']),
      contactId: z.number().int().positive().optional(),
      addressId: z.number().int().positive().optional(),
      addressPayload: addressPayloadSchema.optional(),
      limit: z.number().int().min(1).max(100).optional(),
      page: z.number().int().min(1).optional()
    };
  • Schema for addressPayload used in create/update operations.
    const addressPayloadSchema = z.object({
      contactId: z.number().int().positive(),
      name: z.string().min(1).max(255),
      street: z.string().max(255).optional().nullable(),
      city: z.string().max(255).optional().nullable(),
      province: z.string().max(255).optional().nullable(),
      postalCode: z.string().max(255).optional().nullable(),
      countryId: z.string().max(3).optional().nullable(),
      countryIso: z.string().max(3).optional().nullable(),
      countryName: z.string().max(255).optional().nullable()
    });
  • Core handler logic for address operations (list, get, create, update, delete) in the shared handleContactOperation function, called by the tool wrapper.
    case 'address': {
      switch (input.action) {
        case 'list': {
          const response = await client.listAddresses({
            contactId: input.contactId!,
            limit: input.limit,
            page: input.page
          });
          const addresses = response.data.map(normalizeAddress);
    
          const summary = addresses.length
            ? `Fetched ${addresses.length} address${addresses.length === 1 ? '' : 'es'} for contact ${input.contactId}.`
            : `No addresses found for contact ${input.contactId}.`;
    
          return {
            content: [
              {
                type: 'text' as const,
                text: summary
              }
            ],
            structuredContent: {
              section: input.section,
              action: input.action,
              contactId: input.contactId,
              addresses,
              pagination: {
                currentPage: response.meta.current_page,
                lastPage: response.meta.last_page,
                perPage: response.meta.per_page,
                total: response.meta.total
              }
            }
          };
        }
    
        case 'get': {
          const response = await client.getAddress(input.addressId!);
          const address = normalizeAddress(response.data);
    
          return {
            content: [
              {
                type: 'text' as const,
                text: `Retrieved address "${address.name}" (ID ${address.id}).`
              }
            ],
            structuredContent: {
              section: input.section,
              action: input.action,
              address
            }
          };
        }
    
        case 'create': {
          const payload = input.addressPayload!;
          const countryId = await resolveCountryId(client, {
            countryId: payload.countryId,
            countryIso: payload.countryIso,
            countryName: payload.countryName
          });
    
          const result = await client.createAddress(
            toAddressPayloadInput({ ...payload, countryId })
          );
          const address = normalizeAddress(result.data);
          logger.info({ addressId: address.id, contactId: address.contact.id }, 'Created Monica address');
    
          return {
            content: [
              {
                type: 'text' as const,
                text: `Created address "${address.name}" (ID ${address.id}) for contact ${address.contact.id}.`
              }
            ],
            structuredContent: {
              section: input.section,
              action: input.action,
              address
            }
          };
        }
    
        case 'update': {
          const payload = input.addressPayload!;
          const countryId = await resolveCountryId(client, {
            countryId: payload.countryId,
            countryIso: payload.countryIso,
            countryName: payload.countryName
          });
    
          const result = await client.updateAddress(
            input.addressId!,
            toAddressPayloadInput({ ...payload, countryId })
          );
          const address = normalizeAddress(result.data);
          logger.info({ addressId: input.addressId }, 'Updated Monica address');
    
          return {
            content: [
              {
                type: 'text' as const,
                text: `Updated address "${address.name}" (ID ${address.id}).`
              }
            ],
            structuredContent: {
              section: input.section,
              action: input.action,
              addressId: input.addressId,
              address
            }
          };
        }
    
        case 'delete': {
          const result = await client.deleteAddress(input.addressId!);
          logger.info({ addressId: input.addressId }, 'Deleted Monica address');
    
          return {
            content: [
              {
                type: 'text' as const,
                text: `Deleted address ID ${input.addressId}.`
              }
            ],
            structuredContent: {
              section: input.section,
              action: input.action,
              addressId: input.addressId,
              result
            }
          };
        }
    
        default:
          return unreachable(input.action as never);
      }
    }
  • Helper function to transform address payload input for Monica API calls.
    function toAddressPayloadInput(
      payload: AddressPayloadForm & { countryId: string | null }
    ): CreateAddressPayload & UpdateAddressPayload {
      return {
        contactId: payload.contactId,
        name: payload.name,
        street: payload.street ?? null,
        city: payload.city ?? null,
        province: payload.province ?? null,
        postalCode: payload.postalCode ?? null,
        countryId: payload.countryId
      };
    }
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 of behavioral disclosure. It mentions the multi-action nature (list/get/create/update/delete) and the automatic country lookup feature, which adds useful context. However, it doesn't cover important behavioral aspects like authentication requirements, error handling, rate limits, or what happens during delete operations, leaving significant gaps for a tool with mutation capabilities.

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 efficiently structured in two sentences: the first states the purpose and usage guidance, the second provides parameter guidance. Every sentence adds value with zero wasted words, making it easy to parse and understand quickly.

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 multi-action tool with 6 parameters, 0% schema description coverage, no annotations, and no output schema, the description provides good purpose and usage guidance but lacks sufficient behavioral context (especially for mutation operations) and doesn't fully compensate for the missing parameter documentation. The automatic country lookup hint is helpful but doesn't make up for other gaps.

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

Parameters4/5

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

With 0% schema description coverage, the description provides valuable parameter context by explaining that 'contactId and addressPayload with name, street, city, province, postalCode, and countryName' are needed, and that 'country lookup is automatic.' This clarifies the purpose of key parameters beyond what the bare schema provides, though it doesn't cover all 6 parameters or explain the action enum values.

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 with specific verbs ('list, get, create, update, or delete') and resource ('contact addresses'), distinguishing it from the sibling tool 'monica_manage_contact' by explicitly positioning it as a simplified alternative for address management. This provides precise differentiation.

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 explicitly states when to use this tool ('Use this simplified tool instead of monica_manage_contact when managing addresses'), providing clear guidance on alternatives and context. This helps the agent choose between sibling tools effectively.

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