Skip to main content
Glama
Linked-API
by Linked-API

get_conversation

Retrieve LinkedIn message conversations with specific contacts by providing their profile URL. Optionally filter messages by date to access relevant communication history.

Instructions

Allows you to get a conversation with a LinkedIn person using standard LinkedIn messaging.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
personUrlYesThe LinkedIn URL of the person whose conversation you want to poll (e.g., 'https://www.linkedin.com/in/john-doe')
sinceNoOptional ISO 8601 timestamp to only retrieve messages since this date (e.g., '2024-01-15T10:30:00Z'). If not provided, the entire conversation history will be returned.

Implementation Reference

  • Core handler function that executes the 'get_conversation' tool logic: polls for conversations, syncs if necessary, and returns the result.
    public override async execute({
      linkedapi,
      args: { personUrl, since },
    }: {
      linkedapi: LinkedApi;
      args: { personUrl: string; since?: string };
      workflowTimeout: number;
      progressToken?: string | number;
    }): Promise<TMappedResponse<TConversationPollResult>> {
      const conversations = await this.getConversation(linkedapi, personUrl, since);
      if (conversations.errors.length === 0) {
        return conversations;
      }
      const workflowId = await linkedapi.syncConversation.execute({ personUrl });
      await linkedapi.syncConversation.result(workflowId);
      return await this.getConversation(linkedapi, personUrl, since);
    }
  • Input schema definition for the 'get_conversation' tool, specifying parameters personUrl (required) and since (optional).
    inputSchema: {
      type: 'object',
      properties: {
        personUrl: {
          type: 'string',
          description:
            "The LinkedIn URL of the person whose conversation you want to poll (e.g., 'https://www.linkedin.com/in/john-doe')",
        },
        since: {
          type: 'string',
          description:
            "Optional ISO 8601 timestamp to only retrieve messages since this date (e.g., '2024-01-15T10:30:00Z'). If not provided, the entire conversation history will be returned.",
        },
      },
      required: ['personUrl'],
    },
  • Registration of the GetConversationTool instance in the LinkedApiTools constructor's tools array.
    new GetConversationTool(progressCallback),
  • Helper function that performs the actual conversation polling using linkedapi.pollConversations.
    private async getConversation(
      linkedapi: LinkedApi,
      personUrl: string,
      since?: string,
    ): Promise<TMappedResponse<TConversationPollResult>> {
      const conversations = await linkedapi.pollConversations([
        {
          personUrl: personUrl,
          type: 'st',
          since: since,
        },
      ]);
      return {
        data: conversations.data ? conversations.data[0] : undefined,
        errors: conversations.errors,
      };
    }
  • Import statement for GetConversationTool used in registration.
    import { GetConversationTool } from './tools/get-conversation.js';

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/Linked-API/linkedapi-mcp'

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