Skip to main content
Glama
Selenium39

Weibo MCP Server

get_profile

Retrieve detailed profile information for a specific Weibo user using their unique identifier (uid). Access essential data for analysis or integration purposes.

Instructions

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

Input Schema

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

Implementation Reference

  • src/server.ts:35-46 (registration)
    Registration of the MCP 'get_profile' tool, including description, Zod input schema for 'uid', and async handler that delegates to WeiboCrawler.extractWeiboProfile(uid) and formats response as text content with JSON.
    server.tool("get_profile", "获取指定微博用户的详细资料信息", { uid: z.number().describe("微博用户的唯一标识符") }, async ({ uid }) => { const profile = await crawler.extractWeiboProfile(uid); return { content: [{ type: "text", text: JSON.stringify(profile) }] }; } );
  • Input schema definition for the 'get_profile' tool using Zod, requiring a numeric 'uid' parameter.
    { uid: z.number().describe("微博用户的唯一标识符") },
  • Handler function for 'get_profile' tool that fetches profile via crawler and returns JSON string in MCP content format.
    async ({ uid }) => { const profile = await crawler.extractWeiboProfile(uid); return { content: [{ type: "text", text: JSON.stringify(profile) }] }; }
  • Core helper method in WeiboCrawler class that implements the profile fetching logic using axios GET to PROFILE_URL with UID, 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 {}; } }

Other Tools

Related Tools

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