list_opportunities
Search and filter sales deals in Copper CRM to view opportunity details like name, value, status, and pipeline stage for tracking and management.
Instructions
Search Copper opportunities (deals). Optionally filter by company or person. Returns deal name, value, status, and pipeline stage.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | No | Opportunity name to search | |
| company_ids | No | Filter by company IDs | |
| person_ids | No | Filter by associated person IDs (custom field) | |
| page_size | No | Results per page (default 20, max 200) | |
| page_number | No | Page number (default 1) |
Implementation Reference
- server.js:272-294 (handler)The handler function for 'list_opportunities' which processes inputs, fetches data from the Copper API, maps the results, and returns them.
async ({ name, company_ids, person_ids, page_size, page_number }) => { const body = {}; if (name) body.name = name; if (company_ids) body.company_ids = company_ids; if (person_ids) body.person_ids = person_ids; body.page_size = page_size || 20; body.page_number = page_number || 1; const results = await copperFetch("/opportunities/search", { method: "POST", body }); const opps = results.map((o) => ({ id: o.id, name: o.name, company_id: o.company_id, company_name: o.company_name, monetary_value: o.monetary_value, status: o.status, pipeline_id: o.pipeline_id, pipeline_stage_id: o.pipeline_stage_id, close_date: o.close_date, win_probability: o.win_probability, })); return jsonResult(opps); } - server.js:265-271 (schema)The Zod schema definition for the 'list_opportunities' tool inputs.
{ name: z.string().optional().describe("Opportunity name to search"), company_ids: z.array(z.number()).optional().describe("Filter by company IDs"), person_ids: z.array(z.number()).optional().describe("Filter by associated person IDs (custom field)"), page_size: z.number().optional().describe("Results per page (default 20, max 200)"), page_number: z.number().optional().describe("Page number (default 1)"), }, - server.js:262-264 (registration)Registration of the 'list_opportunities' tool using server.tool.
server.tool( "list_opportunities", "Search Copper opportunities (deals). Optionally filter by company or person. Returns deal name, value, status, and pipeline stage.",