Skip to main content
Glama

get-ifanr-news

Retrieve technology news and updates from iFanr covering tech products, digital devices, and internet trends to stay informed on Chinese tech developments.

Instructions

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

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNo
offsetNo

Implementation Reference

  • The handler function that parses input arguments, makes an HTTP GET request to the Ifanr API, validates the response, and maps the news objects to a standardized format with title, description, and 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 validating input parameters: limit (default 20) and offset (default 0).
    const ifanrRequestSchema = z.object({ limit: z.number().int().optional().default(20), offset: z.number().int().optional().default(0), });
  • Registers the tool using defineToolConfig, specifying name, description, schema, and handler function.
    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