get_facebook_profile
Extract Facebook profile or page data by providing a URL to retrieve user information and content details.
Instructions
Get Facebook profile/page data
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | Yes | Facebook profile or page URL |
Implementation Reference
- src/index.ts:499-509 (handler)Handler for get_facebook_profile: calls Sociavault API with the provided Facebook URL, extracts profile data using helper function, and returns JSON.if (name === "get_facebook_profile") { const { url } = args as { url: string }; const response = await axios.get(`${BASE_URL}/facebook/profile`, { headers: { "X-API-Key": API_KEY }, params: { url }, }); const extracted = extractFacebookProfile(response.data); return { content: [{ type: "text", text: JSON.stringify(extracted, null, 2) }], }; }
- src/index.ts:314-327 (registration)Tool registration including name, description, and input schema (requires 'url' parameter). Added to the tools list for MCP server.{ name: "get_facebook_profile", description: "Get Facebook profile/page data", inputSchema: { type: "object", properties: { url: { type: "string", description: "Facebook profile or page URL", }, }, required: ["url"], }, },
- src/index.ts:172-185 (helper)Helper function to extract and standardize Facebook profile data from API response.function extractFacebookProfile(data: any) { const profile = data?.data?.profile || data?.profile || data?.data || {}; return { name: profile.name, username: profile.username, about: profile.about || profile.bio || "", followers: profile.followers || profile.follower_count || 0, likes: profile.likes || profile.like_count || 0, is_verified: profile.is_verified || false, profile_picture: profile.profile_picture || profile.picture?.data?.url, category: profile.category, website: profile.website, }; }