Skip to main content
Glama
Jing-yilin

LinkedIn MCP Server

by Jing-yilin

get_group

Retrieve LinkedIn group details and save structured data. Use this tool to extract group information from URLs or IDs and store cleaned JSON files for analysis.

Instructions

Get LinkedIn group information. Returns cleaned data in TOON format.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlNoLinkedIn group URL
groupIdNoLinkedIn group ID
save_dirNoDirectory to save cleaned JSON data

Implementation Reference

  • The main handler function that implements the 'get_group' tool logic. It prepares parameters from input args, makes an API request to '/group' endpoint, cleans the response data using DataCleaners.cleanGroup, and returns a formatted CallToolResult.
    private async getGroup(args: Record<string, any>): Promise<CallToolResult> { const params: Record<string, any> = {}; if (args.url) params.url = args.url; if (args.groupId) params.groupId = args.groupId; if (!params.url && !params.groupId) { throw new Error('At least one of url or groupId is required'); } const data = await this.makeRequest('/group', params); const cleaned = DataCleaners.cleanGroup(data.element); return this.formatResponse(cleaned, { saveDir: args.save_dir, toolName: 'get_group', }); }
  • The tool registration and input schema definition for 'get_group' in the ListTools response, including name, description, and inputSchema specifying url, groupId, and save_dir parameters.
    { name: 'get_group', description: 'Get LinkedIn group information. Returns cleaned data in TOON format.', inputSchema: { type: 'object', properties: { url: { type: 'string', description: 'LinkedIn group URL' }, groupId: { type: 'string', description: 'LinkedIn group ID' }, save_dir: { type: 'string', description: 'Directory to save cleaned JSON data' }, }, required: [], }, } as Tool,
  • src/index.ts:533-551 (registration)
    The dispatch switch case in CallToolRequestHandler that registers and routes 'get_group' calls to the getGroup handler method.
    switch (name) { case 'get_profile': return await this.getProfile(args as Record<string, any>); case 'search_profiles': return await this.searchProfiles(args as Record<string, any>); case 'get_profile_posts': return await this.getProfilePosts(args as Record<string, any>); case 'get_profile_comments': return await this.getProfileComments(args as Record<string, any>); case 'get_profile_reactions': return await this.getProfileReactions(args as Record<string, any>); case 'get_company': return await this.getCompany(args as Record<string, any>); case 'search_companies': return await this.searchCompanies(args as Record<string, any>); case 'get_company_posts': return await this.getCompanyPosts(args as Record<string, any>); case 'get_job': return await this.getJob(args as Record<string, any>); case 'search_jobs': return await this.searchJobs(args as Record<string, any>); case 'get_post': return await this.getPost(args as Record<string, any>); case 'search_posts': return await this.searchPosts(args as Record<string, any>); case 'get_post_comments': return await this.getPostComments(args as Record<string, any>); case 'get_post_reactions': return await this.getPostReactions(args as Record<string, any>); case 'get_group': return await this.getGroup(args as Record<string, any>); case 'search_groups': return await this.searchGroups(args as Record<string, any>); case 'search_geo_id': return await this.searchGeoId(args as Record<string, any>); default: throw new McpError(ErrorCode.MethodNotFound, `Unknown tool: ${name}`);
  • The DataCleaners.cleanGroup helper function used by the get_group handler to clean and structure the raw API response data for the group information.
    cleanGroup(raw: any): any { if (!raw) return null; return { id: raw.id, linkedinUrl: raw.linkedinUrl, name: raw.name, members: raw.members || raw.memberCount, summary: raw.summary || raw.description, }; },

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/Jing-yilin/linkedin-mcp-server'

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