Skip to main content
Glama
byndcloud

Unofficial Dex CRM MCP Server

by byndcloud

dex_get_contact

Retrieve a contact's details and timeline entries by ID from Dex CRM, with automatic pagination for notes.

Instructions

Retrieve a single contact by ID. Automatically fetches the contact's notes/timeline entries and includes them in the response under a 'notes' key. Use notesLimit to control how many notes are fetched (default 50). If the contact has more notes than a single page, pagination is handled automatically.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
contactIdYes
includeNotesNoFetch and include the contact's notes/timeline entries. Defaults to true.
notesLimitNoMax number of notes to fetch. Defaults to 50. Paginated automatically if above 50.

Implementation Reference

  • The handler function for 'dex_get_contact' that fetches contact data and associated timeline notes.
    async (args) => {
      try {
        const fetchNotes = args.includeNotes !== false;
        const notesLimit = args.notesLimit ?? 50;
        const PAGE_SIZE = 50;
    
        const contactPromise = dex.get<Record<string, unknown>>(
          `/v1/contacts/${args.contactId}`
        );
    
        if (!fetchNotes) {
          return toResult(await contactPromise);
        }
    
        const firstPage = await dex.get<{
          data?: { items?: unknown[]; nextCursor?: string };
        }>("/v1/timeline/", {
          contactId: args.contactId,
          take: String(Math.min(notesLimit, PAGE_SIZE)),
        });
    
        const allItems: unknown[] = firstPage.data?.items ?? [];
        let nextCursor = firstPage.data?.nextCursor;
        let remaining = notesLimit - allItems.length;
    
        while (nextCursor && remaining > 0) {
          const page = await dex.get<{
            data?: { items?: unknown[]; nextCursor?: string };
          }>("/v1/timeline/", {
            contactId: args.contactId,
            take: String(Math.min(remaining, PAGE_SIZE)),
            cursor: nextCursor,
          });
    
          const items = page.data?.items ?? [];
          if (items.length === 0) break;
    
          allItems.push(...items);
          nextCursor = page.data?.nextCursor;
          remaining -= items.length;
        }
    
        const contact = await contactPromise;
        contact.notes = allItems;
    
        return toResult(contact);
      } catch (error) {
  • The tool registration block for 'dex_get_contact' defining its parameters and description.
    server.tool(
      "dex_get_contact",
      "Retrieve a single contact by ID. Automatically fetches the contact's notes/timeline entries " +
        "and includes them in the response under a 'notes' key. Use notesLimit to control how many " +
        "notes are fetched (default 50). If the contact has more notes than a single page, pagination " +
        "is handled automatically.",
      {
        contactId: z.string(),
        includeNotes: z
          .boolean()
          .optional()
          .describe("Fetch and include the contact's notes/timeline entries. Defaults to true."),
        notesLimit: z
          .number()
          .min(1)
          .optional()
          .describe("Max number of notes to fetch. Defaults to 50. Paginated automatically if above 50."),
      },
Behavior4/5

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

With no annotations provided, the description carries full burden and does well by disclosing key behaviors: automatic fetching of notes/timeline entries, inclusion in response under 'notes' key, pagination handling for notes, and default values for parameters. It doesn't mention rate limits, authentication needs, or error conditions, but covers core operational behavior adequately.

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?

Three sentences with zero waste - each sentence adds critical information: core functionality, notes behavior, and pagination details. The description is front-loaded with the main purpose and efficiently structured.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a read operation with 3 parameters and no output schema, the description provides good coverage of what the tool does and how it behaves. It explains the response structure (includes notes under 'notes' key) and pagination behavior. However, without annotations or output schema, it could benefit from mentioning error cases or response format details beyond notes.

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?

Schema description coverage is 67% (2 of 3 parameters have descriptions). The description adds meaningful context beyond the schema: it explains that notes are automatically fetched and included under a 'notes' key, clarifies the relationship between notesLimit and pagination, and mentions the default value for notesLimit. This compensates well for the partial schema coverage.

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 specific action ('Retrieve a single contact by ID') and distinguishes it from sibling tools like 'dex_list_contacts' (which lists multiple contacts) and 'dex_search' (which searches contacts). It also specifies the resource ('contact') and includes unique behavior about fetching notes.

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 implies usage context by specifying it's for retrieving a single contact by ID, which differentiates it from list/search operations. However, it doesn't explicitly state when NOT to use this tool or mention alternatives like 'dex_list_contacts' for multiple contacts or 'dex_search' for filtered searches.

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/byndcloud/unofficial-dex-mcp'

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