Skip to main content
Glama

send_linkedin_connection

Send LinkedIn connection invitations to expand your professional network using your account credentials. Connect with targeted professionals to build relationships and grow your business contacts.

Instructions

Send a connection invitation to LinkedIn user. Account ID is taken from environment.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
timeoutNoTimeout in seconds
userYesRecipient user URN (must include prefix, e.g. fsd_profile:ACoAA...)

Implementation Reference

  • Interface defining the input arguments for the send_linkedin_connection tool: user URN and optional timeout.
    export interface SendLinkedinConnectionArgs {
      user: string;
      timeout?: number;
    }
  • Validator function to check if arguments match SendLinkedinConnectionArgs type.
    export function isValidSendLinkedinConnectionArgs(
      args: unknown
    ): args is SendLinkedinConnectionArgs {
      if (typeof args !== "object" || args === null) return false;
      const obj = args as Record<string, unknown>;
      if (typeof obj.user !== "string" || !obj.user.trim()) return false;
      if (obj.timeout !== undefined && typeof obj.timeout !== "number") return false;
      return true;
    }
  • Closest matching handler implementation for sending LinkedIn connection requests. Note: tool name is 'send_linkedin_connection_request' which closely matches the queried name and uses the USER_CONNECTION endpoint.
    "send_linkedin_connection_request",
    "Send LinkedIn connection request (requires ACCOUNT_ID)",
    {
      user: z.string().describe("User URN (must include prefix)"),
      text: z.string().optional().describe("Optional message"),
      timeout: z.number().default(300).describe("Timeout in seconds")
    },
    async ({ user, text, timeout }) => {
      const normalizedUser = normalizeUserURN(user);
      if (!isValidUserURN(normalizedUser)) {
        return {
          content: [{ type: "text", text: "Invalid URN format. Must start with 'fsd_profile:'" }],
          isError: true
        };
      }
      const requestData: any = { timeout, user: normalizedUser, account_id: ACCOUNT_ID };
      if (text) requestData.text = text;
      log("Sending LinkedIn connection request to user:", normalizedUser);
      try {
        const response = await makeRequest(API_CONFIG.ENDPOINTS.USER_CONNECTION, requestData);
        return {
          content: [{ type: "text", text: JSON.stringify(response, null, 2) }]
        };
      } catch (error) {
        log("LinkedIn connection request error:", error);
        return {
          content: [{ type: "text", text: `LinkedIn connection request API error: ${formatError(error)}` }],
          isError: true
        };
      }
    }

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/anysiteio/hdw-mcp-server'

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