dex_search
Search across Dex CRM entities including contacts, groups, tags, reminders, notes, and views using keywords and filters to find specific data.
Instructions
Search across Dex entities by keyword. Set 'entity' to choose what to search: 'contacts' (name, email, company), 'groups', 'tags', 'reminders', 'notes' (timeline entries), or 'views'. For reminders you can also filter by startDate, endDate, and isComplete. For contacts you can filter by archived status.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| entity | Yes | ||
| searchQuery | No | ||
| take | No | ||
| cursor | No | ||
| archived | No | ||
| enhanced | No | ||
| startDate | No | ||
| endDate | No | ||
| isComplete | No |
Implementation Reference
- src/tools/search.ts:43-76 (handler)The handler function for dex_search, which executes the search logic using the dex client.
async (args) => { try { const endpoint = entityEndpoints[args.entity]; const query: Record<string, string | number | boolean | undefined> = {}; if (args.searchQuery !== undefined) query.searchQuery = args.searchQuery; if (args.take !== undefined) query.take = args.take; if (args.cursor !== undefined) query.cursor = args.cursor; if (args.entity === "contacts") { if (args.archived !== undefined) query.archived = args.archived; if (args.enhanced !== undefined) query.enhanced = args.enhanced; } if (args.entity === "reminders") { if (args.startDate !== undefined) query.startDate = args.startDate; if (args.endDate !== undefined) query.endDate = args.endDate; if (args.isComplete !== undefined) query.isComplete = args.isComplete; } if (args.entity === "notes") { if (args.startDate !== undefined) query.startDate = args.startDate; if (args.endDate !== undefined) query.endDate = args.endDate; } const result = await dex.get( endpoint, Object.keys(query).length ? query : undefined ); return toResult(result); } catch (error) { return toError(error); } } - src/tools/search.ts:32-42 (schema)The zod schema defining input parameters for the dex_search tool.
{ entity: z.enum(["contacts", "groups", "tags", "reminders", "notes", "views"]), searchQuery: z.string().optional(), take: z.number().optional(), cursor: z.string().optional(), archived: z.boolean().optional(), enhanced: z.boolean().optional(), startDate: z.string().optional(), endDate: z.string().optional(), isComplete: z.boolean().optional(), }, - src/tools/search.ts:28-78 (registration)Registration logic for the dex_search tool on the MCP server.
export function registerSearchTools(server: McpServer): void { server.tool( "dex_search", "Search across Dex entities by keyword. Set 'entity' to choose what to search: 'contacts' (name, email, company), 'groups', 'tags', 'reminders', 'notes' (timeline entries), or 'views'. For reminders you can also filter by startDate, endDate, and isComplete. For contacts you can filter by archived status.", { entity: z.enum(["contacts", "groups", "tags", "reminders", "notes", "views"]), searchQuery: z.string().optional(), take: z.number().optional(), cursor: z.string().optional(), archived: z.boolean().optional(), enhanced: z.boolean().optional(), startDate: z.string().optional(), endDate: z.string().optional(), isComplete: z.boolean().optional(), }, async (args) => { try { const endpoint = entityEndpoints[args.entity]; const query: Record<string, string | number | boolean | undefined> = {}; if (args.searchQuery !== undefined) query.searchQuery = args.searchQuery; if (args.take !== undefined) query.take = args.take; if (args.cursor !== undefined) query.cursor = args.cursor; if (args.entity === "contacts") { if (args.archived !== undefined) query.archived = args.archived; if (args.enhanced !== undefined) query.enhanced = args.enhanced; } if (args.entity === "reminders") { if (args.startDate !== undefined) query.startDate = args.startDate; if (args.endDate !== undefined) query.endDate = args.endDate; if (args.isComplete !== undefined) query.isComplete = args.isComplete; } if (args.entity === "notes") { if (args.startDate !== undefined) query.startDate = args.startDate; if (args.endDate !== undefined) query.endDate = args.endDate; } const result = await dex.get( endpoint, Object.keys(query).length ? query : undefined ); return toResult(result); } catch (error) { return toError(error); } } ); }