Skip to main content
Glama
bulatko

vk-mcp-server

vk_stats_get

Retrieve community statistics from VKontakte for administrators to analyze engagement and growth trends over specified time periods.

Instructions

Get community statistics (admin only)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
group_idYesCommunity ID
intervalNo
intervals_countNoNumber of intervals

Implementation Reference

  • Tool handler logic for vk_stats_get - executes when the tool is called, passes arguments to the VK API statsGet method with default values for interval ('day') and intervals_count (7)
    case 'vk_stats_get':
      result = await vk.statsGet({
        group_id: args.group_id,
        interval: args.interval || 'day',
        intervals_count: args.intervals_count || 7,
      });
      break;
  • Tool registration and input schema definition for vk_stats_get - defines the tool name, description, and required/optional parameters (group_id, interval, intervals_count)
    {
      name: 'vk_stats_get',
      description: 'Get community statistics (admin only)',
      inputSchema: {
        type: 'object',
        properties: {
          group_id: { type: 'number', description: 'Community ID' },
          interval: { type: 'string', enum: ['day', 'week', 'month', 'year', 'all'] },
          intervals_count: { type: 'number', description: 'Number of intervals' },
        },
        required: ['group_id'],
      },
    },
  • VK API helper method that wraps the stats.get API call, used by the vk_stats_get tool handler
    statsGet(params) { return this.call('stats.get', params); }
  • Core VK API call method that handles authentication, HTTP requests, and error responses for all VK API methods including stats.get
    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