Skip to main content
Glama
ahmedselimmansor-ctrl

LinkedIn MCP Server

get_connections

Retrieve your 1st-degree LinkedIn connections. Use the optional limit parameter to control the number of connections returned.

Instructions

List the user's 1st-degree connections (requires r_network permission).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNoMaximum number of connections to retrieve (default: 50).

Implementation Reference

  • The getConnections method on LinkedInClient makes an API GET request to /connections?q=viewer&start=0&count=<limit> to fetch the user's 1st-degree connections.
    async getConnections(limit: number = 50) {
      // Note: To use the /connections API, specific permissions are needed (r_network).
      const response = await this.client.get("/connections?q=viewer&start=0&count=" + limit);
      return response.data;
    }
  • handleNetworkTool function: the 'get_connections' case calls client.getConnections(args?.limit) and returns the JSON-stringified result.
    export async function handleNetworkTool(name: string, args: any, client: LinkedInClient) {
      switch (name) {
        case "get_connections": {
          const result = await client.getConnections(args?.limit);
          return {
            content: [
              {
                type: "text",
                text: JSON.stringify(result, null, 2),
              },
            ],
          };
        }
  • Schema definition (input validation) for get_connections tool: accepts optional 'limit' number parameter (default: 50).
    export const networkTools = [
      {
        name: "get_connections",
        description: "List the user's 1st-degree connections (requires r_network permission).",
        inputSchema: {
          type: "object",
          properties: {
            limit: {
              type: "number",
              description: "Maximum number of connections to retrieve (default: 50).",
            },
          },
        },
      },
  • src/index.ts:47-55 (registration)
    Registration via ListToolsRequestSchema handler: networkTools (including get_connections) are spread into the list of available tools.
    server.setRequestHandler(ListToolsRequestSchema, async () => {
      return {
        tools: [
          ...profileTools,
          ...contentTools,
          ...networkTools,
          ...organizationTools,
        ],
      };
  • src/index.ts:72-74 (registration)
    Registration via CallToolRequestSchema handler: when tool name matches a network tool, handleNetworkTool is dispatched.
    if (networkTools.some((t) => t.name === name)) {
      return await handleNetworkTool(name, args, linkedinClient);
    }
Behavior3/5

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

No annotations provided, so description carries burden. States permission requirement and that it lists connections (implying read-only), but lacks details on rate limits, idempotency, or side effects.

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

Conciseness5/5

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

Single, focused sentence with front-loaded purpose. No extraneous words; efficient for an agent.

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

Completeness3/5

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

Adequately describes the basic function and permission requirement, but omits details like default limit, pagination behavior, and potential errors. Sufficient for a simple tool with no output schema.

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

Parameters2/5

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

Schema coverage is 100%, but description adds no extra meaning beyond the schema. Does not mention the limit parameter or its default value, missing an opportunity to enhance clarity.

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

Purpose5/5

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

Description clearly states the tool lists the user's 1st-degree connections, using a specific verb and resource, and distinguishes it from sibling tools like create_article_post or get_my_profile.

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

Usage Guidelines4/5

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

Specifies the required r_network permission, giving clear prerequisites. Implicitly distinct from siblings, but no explicit when-not-to-use or alternatives.

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/ahmedselimmansor-ctrl/Linekedin_MCP_server'

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