Skip to main content
Glama

Browse Monica metadata catalogs

monica_browse_metadata

Look up Monica CRM reference data like countries, genders, and activity types to verify names and IDs before creating or updating records.

Instructions

Inspect Monica lookup catalogs (genders, countries, contact field types, activity types, relationship types). Helpful when you need to confirm the exact name/ID before performing other actions.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
resourceYes
searchNo
limitNo
pageNo

Implementation Reference

  • Registers the monica_browse_metadata tool with input schema and handler function.
    server.registerTool(
      'monica_browse_metadata',
      {
        title: 'Browse Monica metadata catalogs',
        description:
          'Inspect Monica lookup catalogs (genders, countries, contact field types, activity types, relationship types). Helpful when you need to confirm the exact name/ID before performing other actions.',
        inputSchema: {
          resource: metadataResourceSchema,
          search: z.string().min(1).max(255).optional(),
          limit: z.number().int().min(1).max(250).optional(),
          page: z.number().int().min(1).optional()
        }
      },
      async ({ resource, search, limit, page }) => {
        const query = search?.trim().toLowerCase();
        const { items, meta } = await fetchResource({ client, resource, limit, page });
    
        const filteredItems = query ? filterByQuery(resource, items, query) : items;
        const label = resourceLabels[resource];
        const summary = buildSummary(label, filteredItems.length, query, meta.currentPage, meta.lastPage);
    
        return {
          content: [
            {
              type: 'text' as const,
              text: summary
            }
          ],
          structuredContent: {
            resource,
            search: search ?? null,
            items: filteredItems,
            pagination: meta
          }
        };
      }
    );
  • Zod schema defining the supported metadata resources (genders, countries, etc.). Used in the tool's inputSchema.
    const metadataResourceSchema = z.enum([
      'genders',
      'countries',
      'contactFieldTypes',
      'activityTypes',
      'relationshipTypes',
      'currencies',
      'occupations'
    ]);
  • Handler logic: fetches metadata for the given resource, applies search filter if provided, generates summary text, and returns structured items with pagination.
    async ({ resource, search, limit, page }) => {
      const query = search?.trim().toLowerCase();
      const { items, meta } = await fetchResource({ client, resource, limit, page });
    
      const filteredItems = query ? filterByQuery(resource, items, query) : items;
      const label = resourceLabels[resource];
      const summary = buildSummary(label, filteredItems.length, query, meta.currentPage, meta.lastPage);
    
      return {
        content: [
          {
            type: 'text' as const,
            text: summary
          }
        ],
        structuredContent: {
          resource,
          search: search ?? null,
          items: filteredItems,
          pagination: meta
        }
      };
    }
  • Core helper function that fetches raw data from Monica client APIs based on the resource type, normalizes items and meta.
    async function fetchResource({ client, resource, limit, page }: FetchResourceArgs) {
      switch (resource) {
        case 'genders': {
          const response = await client.listGenders(limit, page);
          return {
            items: response.data.map(normalizeGender),
            meta: normalizeMeta(response.meta)
          };
        }
    
        case 'countries': {
          const response = await client.listCountries(limit, page);
          return {
            items: Object.values(response.data).map(normalizeCountry),
            meta: normalizeMeta(response.meta)
          };
        }
    
        case 'contactFieldTypes': {
          const response = await client.listContactFieldTypes({ limit, page });
          return {
            items: response.data.map(normalizeContactFieldType),
            meta: normalizeMeta(response.meta)
          };
        }
    
        case 'activityTypes': {
          const response = await client.listActivityTypes({ limit, page });
          return {
            items: response.data.map(normalizeActivityType),
            meta: normalizeMeta(response.meta)
          };
        }
    
        case 'relationshipTypes': {
          const response = await client.listRelationshipTypes({ limit, page });
          return {
            items: response.data.map(normalizeRelationshipType),
            meta: normalizeMeta(response.meta)
          };
        }
    
        case 'currencies': {
          const response = await client.listCurrencies({ limit, page });
          return {
            items: response.data.map(normalizeCurrency),
            meta: normalizeMeta(response.meta)
          };
        }
    
        case 'occupations': {
          const response = await client.listOccupations({ limit, page });
          return {
            items: response.data.map(normalizeOccupation),
            meta: normalizeMeta(response.meta)
          };
        }
    
        default:
          throw new Error(`Unsupported resource: ${resource satisfies never}`);
      }
    }
  • Filters the fetched items by the search query string, with resource-specific filtering logic.
    function filterByQuery(resource: MetadataResource, items: unknown[], query: string) {
      switch (resource) {
        case 'genders':
          return (items as ReturnType<typeof normalizeGender>[]).filter((gender) =>
            gender.name.toLowerCase().includes(query)
          );
    
        case 'countries':
          return (items as ReturnType<typeof normalizeCountry>[]).filter((country) =>
            country.name.toLowerCase().includes(query) || country.iso?.toLowerCase().includes(query)
          );
    
        case 'contactFieldTypes':
          return (items as ReturnType<typeof normalizeContactFieldType>[]).filter((type) =>
            type.name.toLowerCase().includes(query) || type.kind?.toLowerCase().includes(query)
          );
    
        case 'activityTypes':
          return (items as ReturnType<typeof normalizeActivityType>[]).filter((activityType) =>
            activityType.name.toLowerCase().includes(query) ||
            activityType.category?.name?.toLowerCase().includes(query)
          );
    
        case 'relationshipTypes':
          return (items as ReturnType<typeof normalizeRelationshipType>[]).filter((relationshipType) =>
            relationshipType.name.toLowerCase().includes(query) ||
            relationshipType.reverseName.toLowerCase().includes(query)
          );
    
        case 'currencies':
          return (items as ReturnType<typeof normalizeCurrency>[]).filter((currency) =>
            currency.iso.toLowerCase().includes(query) || currency.name.toLowerCase().includes(query)
          );
    
        case 'occupations':
          return (items as ReturnType<typeof normalizeOccupation>[]).filter((occupation) =>
            occupation.title.toLowerCase().includes(query) ||
            (occupation.company?.name?.toLowerCase().includes(query) ?? false)
          );
    
        default:
          return items;
      }
    }
Behavior2/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 tool is for inspection/lookup, which implies read-only behavior, but doesn't explicitly state this is a safe read operation, doesn't mention authentication requirements, rate limits, or what the output format looks like. For a tool with 4 parameters and no 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?

The description is perfectly concise with two sentences that each earn their place: the first states the core functionality, the second provides usage context. It's front-loaded with the main purpose and wastes no words.

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 (4 parameters, no annotations, no output schema), the description is incomplete. It doesn't explain what the tool returns, how pagination works with limit/page, the search functionality, or the relationship between parameters. For a catalog browsing tool with multiple parameters, this leaves too many gaps for effective agent use.

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 undocumented parameters. The description mentions 'search' functionality implicitly ('confirm the exact name/ID') but doesn't explain any of the 4 parameters: what 'resource' selection does, how 'search' works, what 'limit' and 'page' control, or their relationships. This adds minimal value beyond the bare schema.

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 inspecting Monica lookup catalogs and lists specific examples (genders, countries, etc.), which is a specific verb+resource combination. However, it doesn't explicitly distinguish this read-only catalog browsing from sibling tools that manage those same resources (like monica_manage_contact_field_type or monica_manage_activity_type), missing full sibling differentiation.

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

Usage Guidelines4/5

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

The description provides clear context for when to use this tool ('when you need to confirm the exact name/ID before performing other actions'), which implicitly suggests it's for lookup/validation before mutations. However, it doesn't explicitly state when NOT to use it or name specific alternative tools for different scenarios, keeping it from a perfect score.

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