get_instagram_profile
Retrieve Instagram profile information including bio, follower counts, and posts by providing a username. This tool extracts public data from Instagram profiles for analysis or verification purposes.
Instructions
Get Instagram profile data
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| handle | Yes | Instagram username |
Implementation Reference
- src/index.ts:355-365 (handler)The handler logic within the CallToolRequestSchema request handler that executes the get_instagram_profile tool: makes an API call to Sociavault's Instagram profile endpoint using the provided handle, extracts data with extractInstagramProfile, and returns formatted JSON.if (name === "get_instagram_profile") { const { handle } = args as { handle: string }; const response = await axios.get(`${BASE_URL}/instagram/profile`, { headers: { "X-API-Key": API_KEY }, params: { handle }, }); const extracted = extractInstagramProfile(response.data); return { content: [{ type: "text", text: JSON.stringify(extracted, null, 2) }], }; }
- src/index.ts:212-222 (registration)Registration of the get_instagram_profile tool in the tools array used by the MCP server's ListToolsRequestSchema handler.{ name: "get_instagram_profile", description: "Get Instagram profile data", inputSchema: { type: "object", properties: { handle: { type: "string", description: "Instagram username" }, }, required: ["handle"], }, },
- src/index.ts:215-221 (schema)Input schema definition for the get_instagram_profile tool, specifying a required 'handle' string parameter.inputSchema: { type: "object", properties: { handle: { type: "string", description: "Instagram username" }, }, required: ["handle"], },
- src/index.ts:21-36 (helper)Helper function that parses and extracts key Instagram profile fields from the raw API response data.function extractInstagramProfile(data: any) { const user = data?.data?.user || data?.user || {}; return { username: user.username, full_name: user.full_name, biography: user.biography, followers: user.edge_followed_by?.count || 0, following: user.edge_follow?.count || 0, posts_count: user.edge_owner_to_timeline_media?.count || 0, is_verified: user.is_verified, is_private: user.is_private, is_business: user.is_business_account, external_url: user.external_url, profile_pic_url: user.profile_pic_url, }; }