Skip to main content
Glama
Selenium39

Weibo MCP Server

get_profile

Retrieve detailed profile information for a specific Weibo user by providing their unique identifier.

Instructions

获取指定微博用户的详细资料信息

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
uidYes微博用户的唯一标识符

Implementation Reference

  • src/server.ts:35-46 (registration)
    Registration of the 'get_profile' MCP tool, including input schema (uid: number), description, and inline handler function that delegates to WeiboCrawler.extractWeiboProfile(uid) and returns JSON-formatted profile.
    server.tool("get_profile", "获取指定微博用户的详细资料信息", { uid: z.number().describe("微博用户的唯一标识符") }, async ({ uid }) => { const profile = await crawler.extractWeiboProfile(uid); return { content: [{ type: "text", text: JSON.stringify(profile) }] }; } );
  • Core implementation of profile extraction: performs HTTP GET request to the Weibo profile API URL with default headers, extracts userInfo from response, handles errors by returning empty object.
    async extractWeiboProfile(uid: number): Promise<Record<string, any>> { try { const response = await axios.get(PROFILE_URL.replace('{userId}', uid.toString()), { headers: DEFAULT_HEADERS }); return response.data.data.userInfo; } catch (error) { console.error(`无法获取UID为'${uid}'的用户资料`, error); return {}; } }
  • API endpoint URL template used for fetching user profiles, with {userId} placeholder.
    export const PROFILE_URL = 'https://m.weibo.cn/api/container/getIndex?type=uid&value={userId}';
  • Default HTTP headers used in profile extraction requests.
    export const DEFAULT_HEADERS = { 'Content-Type': 'application/json' };

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/Selenium39/mcp-server-weibo'

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