search_people
Find Copper CRM contacts by name, email, or phone number to retrieve person records with IDs for activity creation.
Instructions
Search Copper contacts by name, email, or phone. Returns matching person records with IDs for use in create_activity.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | No | Full name or partial name to search | |
| emails | No | Email addresses to match | |
| phone_number | No | Phone number to match | |
| page_size | No | Results per page (default 20, max 200) | |
| page_number | No | Page number (default 1) |
Implementation Reference
- server.js:91-113 (handler)The handler function for the search_people tool, which constructs the request body for the /people/search endpoint and formats the results.
async ({ name, emails, phone_number, page_size, page_number }) => { const body = {}; if (name) body.name = name; if (emails) body.emails = emails; if (phone_number) body.phone_number = phone_number; body.page_size = page_size || 20; body.page_number = page_number || 1; const results = await copperFetch("/people/search", { method: "POST", body }); const people = results.map((p) => ({ id: p.id, name: p.name, first_name: p.first_name, last_name: p.last_name, emails: p.emails, phone_numbers: p.phone_numbers, company_id: p.company_id, company_name: p.company_name, title: p.title, })); return jsonResult(people); } ); - server.js:81-113 (registration)The registration of the search_people tool using McpServer.
server.tool( "search_people", "Search Copper contacts by name, email, or phone. Returns matching person records with IDs for use in create_activity.", { name: z.string().optional().describe("Full name or partial name to search"), emails: z.array(z.string()).optional().describe("Email addresses to match"), phone_number: z.string().optional().describe("Phone number to match"), page_size: z.number().optional().describe("Results per page (default 20, max 200)"), page_number: z.number().optional().describe("Page number (default 1)"), }, async ({ name, emails, phone_number, page_size, page_number }) => { const body = {}; if (name) body.name = name; if (emails) body.emails = emails; if (phone_number) body.phone_number = phone_number; body.page_size = page_size || 20; body.page_number = page_number || 1; const results = await copperFetch("/people/search", { method: "POST", body }); const people = results.map((p) => ({ id: p.id, name: p.name, first_name: p.first_name, last_name: p.last_name, emails: p.emails, phone_numbers: p.phone_numbers, company_id: p.company_id, company_name: p.company_name, title: p.title, })); return jsonResult(people); } );