Skip to main content
Glama

get-ifanr-news

Fetch curated tech updates from iFanr on products, gadgets, and internet trends. Use Trends Hub to stay informed on cutting-edge technology insights with customizable limits and offsets.

Instructions

获取爱范儿科技快讯,包含最新的科技产品、数码设备、互联网动态等前沿科技资讯

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNo
offsetNo

Implementation Reference

  • The main handler function that parses input args, fetches news from ifanr API using http.get, processes the response, and maps to title, description, link.
    func: async (args: unknown) => { const { limit, offset } = ifanrRequestSchema.parse(args); const resp = await http.get<{ objects: any[]; }>('https://sso.ifanr.com/api/v5/wp/buzz', { params: { limit, offset, }, }); if (!Array.isArray(resp.data.objects)) { throw new Error('获取爱范儿快讯失败'); } return resp.data.objects.map((item) => { return { title: item.post_title, description: item.post_content, link: item.buzz_original_url || `https://www.ifanr.com/${item.post_id}`, }; }); },
  • Zod schema for input validation: optional limit (default 20) and offset (default 0). Used in handler and tool config.
    const ifanrRequestSchema = z.object({ limit: z.number().int().optional().default(20), offset: z.number().int().optional().default(0), });
  • Tool registration using defineToolConfig, setting name, description, schema, and handler function. Exported as default.
    export default defineToolConfig({ name: 'get-ifanr-news', description: '获取爱范儿科技快讯,包含最新的科技产品、数码设备、互联网动态等前沿科技资讯', zodSchema: ifanrRequestSchema, func: async (args: unknown) => { const { limit, offset } = ifanrRequestSchema.parse(args); const resp = await http.get<{ objects: any[]; }>('https://sso.ifanr.com/api/v5/wp/buzz', { params: { limit, offset, }, }); if (!Array.isArray(resp.data.objects)) { throw new Error('获取爱范儿快讯失败'); } return resp.data.objects.map((item) => { return { title: item.post_title, description: item.post_content, link: item.buzz_original_url || `https://www.ifanr.com/${item.post_id}`, }; }); }, });

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