Skip to main content
Glama
Jing-yilin

LinkedIn MCP Server

by Jing-yilin

search_groups

Find LinkedIn groups by keywords to discover professional communities, network with industry peers, and access group data in structured format.

Instructions

Search LinkedIn groups. Returns cleaned data in TOON format.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
searchYesKeywords to search
pageNoPage number
save_dirNoDirectory to save cleaned JSON data
max_itemsNoMaximum results (default: 10)

Implementation Reference

  • The handler function that executes the 'search_groups' tool. It constructs parameters from input args, makes an API request to '/group-search', cleans the results using DataCleaners.cleanGroup, limits the number of items, and formats the response including optional saving to file and pagination info.
    private async searchGroups(args: Record<string, any>): Promise<CallToolResult> { const params: Record<string, any> = { search: args.search }; if (args.page) params.page = args.page; const data = await this.makeRequest('/group-search', params); const maxItems = args.max_items || 10; const cleaned = (data.elements || []).slice(0, maxItems).map(DataCleaners.cleanGroup); return this.formatResponse(cleaned, { saveDir: args.save_dir, toolName: 'search_groups', pagination: data.pagination, }); }
  • src/index.ts:497-510 (registration)
    The registration of the 'search_groups' tool in the listTools handler, defining its name, description, and input schema for validation.
    { name: 'search_groups', description: 'Search LinkedIn groups. Returns cleaned data in TOON format.', inputSchema: { type: 'object', properties: { search: { type: 'string', description: 'Keywords to search' }, page: { type: 'integer', description: 'Page number', default: 1 }, save_dir: { type: 'string', description: 'Directory to save cleaned JSON data' }, max_items: { type: 'integer', description: 'Maximum results (default: 10)', default: 10 }, }, required: ['search'], }, } as Tool,
  • The input schema definition for the 'search_groups' tool, specifying parameters like search query (required), page, save_dir, and max_items.
    inputSchema: { type: 'object', properties: { search: { type: 'string', description: 'Keywords to search' }, page: { type: 'integer', description: 'Page number', default: 1 }, save_dir: { type: 'string', description: 'Directory to save cleaned JSON data' }, max_items: { type: 'integer', description: 'Maximum results (default: 10)', default: 10 }, }, required: ['search'], },
  • Helper function in DataCleaners that processes and cleans raw group data from the API, extracting key fields like id, url, name, members, and summary.
    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, }; },
  • src/index.ts:549-549 (registration)
    Dispatch case in the main CallToolRequestSchema handler that routes 'search_groups' calls to the searchGroups method.
    case 'search_groups': return await this.searchGroups(args as Record<string, any>);

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