Skip to main content
Glama

get-smzdm-rank

Retrieve trending product recommendations, deals, shopping guides, reviews, and consumer insights from SMZDM to inform purchasing decisions.

Instructions

获取什么值得买热门,包含商品推荐、优惠信息、购物攻略、产品评测及消费经验分享的实用中文消费类资讯

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
unitNo

Implementation Reference

  • Core handler function that parses input, fetches hot rank data from SMZDM API, validates response, and maps to structured output including title, description, cover, author, stats, hashtags, and link.
    func: async (args) => { const { unit } = smzdmRequestSchema.parse(args); const resp = await http.get<{ error_code: number; error_msg: string; data: any[]; }>('https://post.smzdm.com/rank/json_more', { params: { unit, }, }); if (resp.data.error_code !== 0 || !Array.isArray(resp.data.data)) { throw new Error(resp.data.error_msg || '获取什么值得买热门失败'); } return resp.data.data.map((item) => { return { title: item.title, description: item.content, cover: item.pic_url, author: item.nickname, publish_time: item.publish_time, collection_count: item.collection_count, comment_count: item.comment_count, up_count: item.up_count, hashtags: safeJsonParse<any[]>(item.tag) ?.map((tag) => `#${tag.title}`) .join(' '), link: item.article_url, }; }); },
  • Zod input schema defining optional 'unit' parameter (1: daily hot, 7: weekly hot, 30: monthly hot, defaults to 1).
    const smzdmRequestSchema = z.object({ unit: z .union([z.literal(1).describe('今日热门'), z.literal(7).describe('周热门'), z.literal(30).describe('月热门')]) .optional() .default(1), });
  • Tool registration via defineToolConfig, including name, description, schema reference, and handler function.
    export default defineToolConfig({ name: 'get-smzdm-rank', description: '获取什么值得买热门,包含商品推荐、优惠信息、购物攻略、产品评测及消费经验分享的实用中文消费类资讯', zodSchema: smzdmRequestSchema, func: async (args) => { const { unit } = smzdmRequestSchema.parse(args); const resp = await http.get<{ error_code: number; error_msg: string; data: any[]; }>('https://post.smzdm.com/rank/json_more', { params: { unit, }, }); if (resp.data.error_code !== 0 || !Array.isArray(resp.data.data)) { throw new Error(resp.data.error_msg || '获取什么值得买热门失败'); } return resp.data.data.map((item) => { return { title: item.title, description: item.content, cover: item.pic_url, author: item.nickname, publish_time: item.publish_time, collection_count: item.collection_count, comment_count: item.comment_count, up_count: item.up_count, hashtags: safeJsonParse<any[]>(item.tag) ?.map((tag) => `#${tag.title}`) .join(' '), link: item.article_url, }; }); }, });

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/baranwang/mcp-trends-hub'

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