vk_newsfeed_get
Retrieve personalized newsfeed content from VKontakte, enabling users to filter posts, photos, and videos with pagination controls.
Instructions
Get user newsfeed
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| filters | No | Filter by type: post, photo, video | |
| count | No | Number of items | |
| start_from | No | Pagination cursor |
Implementation Reference
- src/index.js:287-293 (handler)Handler function for vk_newsfeed_get tool that calls vk.newsfeedGet() with filters, count, and start_from parameters
case 'vk_newsfeed_get': result = await vk.newsfeedGet({ filters: args.filters || 'post', count: args.count || 20, start_from: args.start_from, }); break; - src/index.js:183-193 (schema)Tool schema definition for vk_newsfeed_get with input parameters including filters, count, and start_from
name: 'vk_newsfeed_get', description: 'Get user newsfeed', inputSchema: { type: 'object', properties: { filters: { type: 'string', description: 'Filter by type: post, photo, video' }, count: { type: 'number', description: 'Number of items' }, start_from: { type: 'string', description: 'Pagination cursor' }, }, }, }, - src/index.js:67-67 (helper)Helper method in VKClient class that wraps the VK API newsfeed.get method call
newsfeedGet(params) { return this.call('newsfeed.get', params); } - src/index.js:29-49 (helper)Core API call method that makes HTTP POST requests to VK API endpoint
async call(method, params = {}) { const body = new URLSearchParams({ ...params, access_token: this.accessToken, v: this.apiVersion, }); const response = await fetch(`${VK_API_BASE}/${method}`, { method: 'POST', headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, body: body.toString(), }); const data = await response.json(); if (data.error) { throw new Error(`VK API Error ${data.error.error_code}: ${data.error.error_msg}`); } return data.response; }