Skip to main content
Glama

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
NameRequiredDescriptionDefault
nameNoOpportunity name to search
company_idsNoFilter by company IDs
person_idsNoFilter by associated person IDs (custom field)
page_sizeNoResults per page (default 20, max 200)
page_numberNoPage number (default 1)

Implementation Reference

  • 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);
    }
  • 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.",

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/dazanza/copper-mcp'

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