Skip to main content
Glama

send_linkedin_chat_message

Send direct messages to LinkedIn users through the HorizonDataWave API using account credentials from environment settings.

Instructions

Send a chat message via LinkedIn management API. Account ID is taken from environment.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
companyNoCompany URN where the account is admin (format: company:123456)
textYesMessage text
timeoutNoTimeout in seconds
userYesRecipient user URN (must include prefix, e.g. fsd_profile:ACoAA...)

Implementation Reference

  • Registration and inline handler implementation for the 'send_linkedin_chat_message' tool. Normalizes and validates the recipient URN, constructs API payload with account_id and message text, sends POST request to the AnySite LinkedIn management chat message endpoint, and returns the API response or error.
    server.tool(
      "send_linkedin_chat_message",
      "Send LinkedIn chat message (requires ACCOUNT_ID)",
      {
        user: z.string().describe("Recipient user URN (must include prefix)"),
        company: z.string().optional().describe("Company URN"),
        text: z.string().describe("Message text"),
        timeout: z.number().default(300).describe("Timeout in seconds")
      },
      async ({ user, company, 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, text, account_id: ACCOUNT_ID };
        if (company) requestData.company = company;
        log("Starting LinkedIn send chat message for user:", normalizedUser);
        try {
          const response = await makeRequest(API_CONFIG.ENDPOINTS.CHAT_MESSAGE, requestData);
          return {
            content: [{ type: "text", text: JSON.stringify(response, null, 2) }]
          };
        } catch (error) {
          log("LinkedIn send chat message error:", error);
          return {
            content: [{ type: "text", text: `LinkedIn send chat message API error: ${formatError(error)}` }],
            isError: true
          };
        }
      }
    );
  • TypeScript interface defining the structure of input arguments for the send_linkedin_chat_message tool.
    export interface SendLinkedinChatMessageArgs {
      user: string;
      company?: string;
      text: string;
      timeout?: number;
    }
  • Type guard validation function for SendLinkedinChatMessageArgs inputs.
    export function isValidSendLinkedinChatMessageArgs(
      args: unknown
    ): args is SendLinkedinChatMessageArgs {
      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.company !== undefined && typeof obj.company !== "string") return false;
      if (typeof obj.text !== "string" || !obj.text.trim()) return false;
      if (obj.timeout !== undefined && typeof obj.timeout !== "number") return false;
      return true;
    }
  • Utility function used by the handler to normalize LinkedIn user URN by prepending 'fsd_profile:' if missing.
    const normalizeUserURN = (urn: string): string => {
      if (!urn.includes("fsd_profile:")) {
        return `fsd_profile:${urn}`;
      }
      return urn;
  • Utility function used by the handler to validate if a URN starts with 'fsd_profile:'.
    const isValidUserURN = (urn: string): boolean => {
      return urn.startsWith("fsd_profile:");
    };
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions the Account ID source but lacks critical details such as rate limits, error handling, whether the message is sent immediately or queued, or what happens on failure. For a mutation tool (sending messages) with zero annotation coverage, this is a significant gap in transparency.

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 a single, efficient sentence that front-loads the core purpose. It avoids unnecessary words, but it could be slightly more structured by separating the authentication note into a second sentence for clarity.

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 the complexity of a mutation tool (sending messages) with no annotations and no output schema, the description is insufficient. It lacks details on behavioral traits (e.g., success/failure responses, side effects), and while the schema covers parameters well, the overall context for safe and effective use is incomplete.

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% description coverage, so the schema already documents all four parameters thoroughly. The description adds no additional meaning beyond what the schema provides (e.g., it doesn't explain parameter interactions or provide examples). This meets the baseline of 3 when schema coverage is high.

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 ('send a chat message') and the target platform ('via LinkedIn management API'), which provides a specific verb+resource combination. However, it doesn't explicitly differentiate from sibling tools like 'send_linkedin_connection' or 'send_linkedin_post', which would require a 5.

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?

The description mentions that 'Account ID is taken from environment,' which provides some context about authentication, but it doesn't offer guidance on when to use this tool versus alternatives (e.g., 'send_linkedin_connection' or 'send_linkedin_post'), nor does it specify prerequisites or exclusions. This leaves the agent with minimal usage direction.

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

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