Skip to main content
Glama
bulatko

vk-mcp-server

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
NameRequiredDescriptionDefault
filtersNoFilter by type: post, photo, video
countNoNumber of items
start_fromNoPagination cursor

Implementation Reference

  • 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;
  • 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' },
        },
      },
    },
  • Helper method in VKClient class that wraps the VK API newsfeed.get method call
    newsfeedGet(params) { return this.call('newsfeed.get', params); }
  • 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;
    }

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/bulatko/vk-mcp-server'

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