Skip to main content
Glama

route_lead

Routes lead data through a ChiliPiper Concierge router and returns a booking calendar URL. Requires lead email and router slug.

Instructions

Route a lead through a ChiliPiper Concierge router. Submits lead/form data and returns a booking calendar URL.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
emailYesLead's email address (required)
routerYesRouter name/slug to route through
first_nameNoLead's first name
last_nameNoLead's last name
companyNoLead's company name
phoneNoLead's phone number
titleNoLead's job title
redirect_urlNoURL to redirect after booking
localeNoLanguage locale (e.g. en-US)
account_idNoSalesforce Account ID to associate
meeting_type_idNoForce a specific meeting type by UUID
extra_fieldsNoAdditional form fields as key-value pairs

Implementation Reference

  • index.js:37-124 (registration)
    The tool 'route_lead' is registered via server.tool() on line 37 with name 'route_lead' and description.
    server.tool(
      "route_lead",
      "Route a lead through a ChiliPiper Concierge router. Submits lead/form data and returns a booking calendar URL.",
      {
        email: z.string().describe("Lead's email address (required)"),
        router: z.string().describe("Router name/slug to route through"),
        first_name: z.string().optional().describe("Lead's first name"),
        last_name: z.string().optional().describe("Lead's last name"),
        company: z.string().optional().describe("Lead's company name"),
        phone: z.string().optional().describe("Lead's phone number"),
        title: z.string().optional().describe("Lead's job title"),
        redirect_url: z
          .string()
          .optional()
          .describe("URL to redirect after booking"),
        locale: z.string().optional().describe("Language locale (e.g. en-US)"),
        account_id: z
          .string()
          .optional()
          .describe("Salesforce Account ID to associate"),
        meeting_type_id: z
          .string()
          .optional()
          .describe("Force a specific meeting type by UUID"),
        extra_fields: z
          .record(z.string())
          .optional()
          .describe("Additional form fields as key-value pairs"),
      },
      async ({
        email,
        router,
        first_name,
        last_name,
        company,
        phone,
        title,
        redirect_url,
        locale,
        account_id,
        meeting_type_id,
        extra_fields,
      }) => {
        if (!DOMAIN) {
          return {
            content: [
              {
                type: "text",
                text: "Error: CHILIPIPER_DOMAIN environment variable is not set.",
              },
            ],
          };
        }
    
        const form = {
          PersonEmail: email,
          ...(first_name && { FirstName: first_name }),
          ...(last_name && { LastName: last_name }),
          ...(company && { Company: company }),
          ...(phone && { Phone: phone }),
          ...(title && { Title: title }),
          ...(extra_fields || {}),
        };
    
        const options = {
          router,
          ...(redirect_url && { dynamicRedirectLink: redirect_url }),
          ...(locale && { locale }),
          ...(account_id && { accountId: account_id }),
          ...(meeting_type_id && { meetingTypeId: meeting_type_id }),
          trigger: "ThirdPartyForm",
        };
    
        try {
          const result = await cpFetch(`${BASE_URL}/marketing/${DOMAIN}`, {
            method: "POST",
            body: JSON.stringify({ form, options }),
          });
          return {
            content: [{ type: "text", text: JSON.stringify(result, null, 2) }],
          };
        } catch (err) {
          return {
            content: [{ type: "text", text: `Error: ${err.message}` }],
          };
        }
      }
    );
  • Zod schema definitions for all input parameters of the route_lead tool (email, router, first_name, last_name, company, phone, title, redirect_url, locale, account_id, meeting_type_id, extra_fields).
    {
      email: z.string().describe("Lead's email address (required)"),
      router: z.string().describe("Router name/slug to route through"),
      first_name: z.string().optional().describe("Lead's first name"),
      last_name: z.string().optional().describe("Lead's last name"),
      company: z.string().optional().describe("Lead's company name"),
      phone: z.string().optional().describe("Lead's phone number"),
      title: z.string().optional().describe("Lead's job title"),
      redirect_url: z
        .string()
        .optional()
        .describe("URL to redirect after booking"),
      locale: z.string().optional().describe("Language locale (e.g. en-US)"),
      account_id: z
        .string()
        .optional()
        .describe("Salesforce Account ID to associate"),
      meeting_type_id: z
        .string()
        .optional()
        .describe("Force a specific meeting type by UUID"),
      extra_fields: z
        .record(z.string())
        .optional()
        .describe("Additional form fields as key-value pairs"),
    },
  • index.js:66-123 (handler)
    The async handler function that executes the route_lead tool logic: builds form/options payload, calls cpFetch POST to the ChiliPiper marketing API endpoint, and returns the result.
    async ({
      email,
      router,
      first_name,
      last_name,
      company,
      phone,
      title,
      redirect_url,
      locale,
      account_id,
      meeting_type_id,
      extra_fields,
    }) => {
      if (!DOMAIN) {
        return {
          content: [
            {
              type: "text",
              text: "Error: CHILIPIPER_DOMAIN environment variable is not set.",
            },
          ],
        };
      }
    
      const form = {
        PersonEmail: email,
        ...(first_name && { FirstName: first_name }),
        ...(last_name && { LastName: last_name }),
        ...(company && { Company: company }),
        ...(phone && { Phone: phone }),
        ...(title && { Title: title }),
        ...(extra_fields || {}),
      };
    
      const options = {
        router,
        ...(redirect_url && { dynamicRedirectLink: redirect_url }),
        ...(locale && { locale }),
        ...(account_id && { accountId: account_id }),
        ...(meeting_type_id && { meetingTypeId: meeting_type_id }),
        trigger: "ThirdPartyForm",
      };
    
      try {
        const result = await cpFetch(`${BASE_URL}/marketing/${DOMAIN}`, {
          method: "POST",
          body: JSON.stringify({ form, options }),
        });
        return {
          content: [{ type: "text", text: JSON.stringify(result, null, 2) }],
        };
      } catch (err) {
        return {
          content: [{ type: "text", text: `Error: ${err.message}` }],
        };
      }
    }
  • The cpFetch helper utility used by the route_lead handler to make authenticated HTTP requests to the ChiliPiper API.
    async function cpFetch(url, options = {}) {
      const headers = {
        "Content-Type": "application/json",
        ...(API_KEY ? { "x-api-token": API_KEY } : {}),
        ...options.headers,
      };
      const res = await fetch(url, { ...options, headers });
      const text = await res.text();
      if (!res.ok) {
        throw new Error(`ChiliPiper API ${res.status}: ${text}`);
      }
      try {
        return JSON.parse(text);
      } catch {
        return text;
      }
    }
Behavior2/5

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

No annotations are present, so the description must disclose all behavioral traits. It only states that it submits data and returns a URL, omitting side effects, idempotency, error handling, or authentication requirements.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is concise with two sentences, conveying the core action and output. It could be more structured (e.g., bullet points), but remains efficient.

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

Completeness2/5

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

Given 12 parameters and no output schema, the description is insufficient. It does not explain the routing workflow, expected behavior, or how the booking URL is returned, leaving the agent underinformed.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 100% coverage, describing all 12 parameters. The description adds no additional meaning beyond the schema, but does not contradict it. Baseline score of 3 applies.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Route a lead') and the system ('ChiliPiper Concierge router'), and mentions the return of a booking URL. However, it does not differentiate from the sibling tool 'route_concierge', leaving ambiguity for the agent.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus alternatives like 'route_concierge' or 'get_booking_link'. The agent receives no context for selection.

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/hyypeman/chilipiper-mcp'

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