Skip to main content
Glama

createContact

Add new contact records in Clay by providing details like name, email, phone, and LinkedIn handle. Use this endpoint exclusively for creating new contacts, not for adding to groups.

Instructions

Create a new contact record in Clay. This endpoint should only be used when you need to create a completely new contact, not for adding contacts to groups.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
birthdayNoThe birthday of the contact. Use the format YYYY-MM-DD, if no year is specified use 0, month and day are required.
emailNoThe email of the contact.
first_nameNoThe first name of the contact.
last_nameNoThe last name of the contact.
linkedinNoThe LinkedIn handle of the contact.
organizationNoThe organization of the contact.
phoneNoThe phone number of the contact.
titleNoThe job title of the contact.
websiteNoThe website of the contact.

Implementation Reference

  • Handler function for the 'createContact' tool. It proxies the parameters to the external Clay API endpoint '/create-contact' using the shared callTool helper, authenticating with the session's apiKey.
    execute: async (params, { session }) => callTool("/create-contact", params, session),
  • Zod schema defining the input parameters for the createContact tool, including optional fields like names, phone, email, linkedin, etc.
    parameters: z.object({ first_name: z .string() .describe("The first name of the contact.") .optional(), last_name: z.string().describe("The last name of the contact.").optional(), phone: z .array(z.string()) .describe("The phone number of the contact.") .optional(), email: z .array(z.string()) .describe("The email of the contact.") .default([]), linkedin: z .string() .describe("The LinkedIn handle of the contact.") .optional(), website: z .array(z.string()) .describe("The website of the contact.") .default([]), title: z.string().describe("The job title of the contact.").optional(), organization: z .string() .describe("The organization of the contact.") .optional(), birthday: z .string() .describe( "The birthday of the contact. Use the format YYYY-MM-DD, if no year is specified use 0, month and day are required." ) .optional(), }),
  • index.js:199-238 (registration)
    Registration of the 'createContact' MCP tool with FastMCP server.addTool, including name, description, input schema, and handler.
    server.addTool({ name: "createContact", description: "Create a new contact record in Clay. This endpoint should only be used when you need to create a completely new contact, not for adding contacts to groups.", parameters: z.object({ first_name: z .string() .describe("The first name of the contact.") .optional(), last_name: z.string().describe("The last name of the contact.").optional(), phone: z .array(z.string()) .describe("The phone number of the contact.") .optional(), email: z .array(z.string()) .describe("The email of the contact.") .default([]), linkedin: z .string() .describe("The LinkedIn handle of the contact.") .optional(), website: z .array(z.string()) .describe("The website of the contact.") .default([]), title: z.string().describe("The job title of the contact.").optional(), organization: z .string() .describe("The organization of the contact.") .optional(), birthday: z .string() .describe( "The birthday of the contact. Use the format YYYY-MM-DD, if no year is specified use 0, month and day are required." ) .optional(), }), execute: async (params, { session }) => callTool("/create-contact", params, session), });
  • Shared helper function used by all tools (including createContact) to make authenticated POST requests to the external Clay API endpoints.
    async function callTool(path, params, session) { console.log('Calling tool', path, session) return fetch(`https://nexum.clay.earth/tools${path}`, { body: JSON.stringify(params), headers: { Authorization: `ApiKey ${session.apiKey}`, "Content-Type": "application/json", }, method: "POST", }).then((res) => res.text()); }

Other Tools

Related 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/clay-inc/clay-mcp'

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