get_my_profile
Retrieve your LinkedIn profile information, including work experience, education, and skills, to access your professional data.
Instructions
Retrieve the authenticated user's LinkedIn profile information.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "get_my_profile"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/linkedin-client.ts:36-39 (handler)The LinkedInClient.getMyProfile() method that executes the actual API call to LinkedIn's /userinfo endpoint to fetch the authenticated user's profile.
async getMyProfile() { const response = await this.client.get("/userinfo"); return response.data; } - src/tools/profile/index.ts:15-31 (handler)The handleProfileTool function that handles the 'get_my_profile' tool case, calling client.getMyProfile() and returning the result as JSON text.
export async function handleProfileTool(name: string, args: any, client: LinkedInClient) { switch (name) { case "get_my_profile": { const profile = await client.getMyProfile(); return { content: [ { type: "text", text: JSON.stringify(profile, null, 2), }, ], }; } default: throw new McpError(ErrorCode.MethodNotFound, `Unknown profile tool: ${name}`); } } - src/tools/profile/index.ts:4-13 (schema)The tool registration metadata including name 'get_my_profile', description, and inputSchema (no required parameters).
export const profileTools = [ { name: "get_my_profile", description: "Retrieve the authenticated user's LinkedIn profile information.", inputSchema: { type: "object", properties: {}, }, }, ]; - src/index.ts:46-96 (registration)The MCP server registration where tools are listed via ListToolsRequestSchema and routed via CallToolRequestSchema. The 'get_my_profile' tool is included via spreading profileTools and routed via handleProfileTool.
// Register tools server.setRequestHandler(ListToolsRequestSchema, async () => { return { tools: [ ...profileTools, ...contentTools, ...networkTools, ...organizationTools, ], }; }); // Handle tool execution server.setRequestHandler(CallToolRequestSchema, async (request) => { try { const name = request.params.name; const args = request.params.arguments; if (profileTools.some((t) => t.name === name)) { return await handleProfileTool(name, args, linkedinClient); } if (contentTools.some((t) => t.name === name)) { return await handleContentTool(name, args, linkedinClient); } if (networkTools.some((t) => t.name === name)) { return await handleNetworkTool(name, args, linkedinClient); } if (organizationTools.some((t) => t.name === name)) { return await handleOrganizationTool(name, args, linkedinClient); } throw new McpError( ErrorCode.MethodNotFound, `Unknown tool: ${name}` ); } catch (error: any) { console.error("Error executing tool:", error); return { content: [ { type: "text", text: `Error: ${error.message}`, }, ], isError: true, }; } }); - src/linkedin-client.ts:42-45 (helper)Helper method getMyUrn() that also calls /userinfo to get the profile sub/ID, used to construct a URN for other API operations.
async getMyUrn(): Promise<string> { const response = await this.client.get("/userinfo"); return `urn:li:person:${response.data.sub}`; }