Skip to main content
Glama
bulatko

vk-mcp-server

vk_users_get

Retrieve user profile information from VKontakte using IDs or screen names, specifying which fields to return.

Instructions

Get information about VK users by their IDs or screen names

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
user_idsNoComma-separated user IDs or screen names
fieldsNoProfile fields to return

Implementation Reference

  • The tool handler for vk_users_get - extracts arguments (user_ids, fields) and calls the VK client's usersGet method with default fields if not provided
    case 'vk_users_get':
      result = await vk.usersGet({
        user_ids: args.user_ids,
        fields: args.fields || 'photo_200,online,status',
      });
      break;
  • Tool registration and input schema definition for vk_users_get - defines the tool name, description, and expected parameters (user_ids and fields)
    const tools = [
      {
        name: 'vk_users_get',
        description: 'Get information about VK users by their IDs or screen names',
        inputSchema: {
          type: 'object',
          properties: {
            user_ids: { type: 'string', description: 'Comma-separated user IDs or screen names' },
            fields: { type: 'string', description: 'Profile fields to return' },
          },
        },
      },
  • VKClient usersGet method - a wrapper that calls the VK API's users.get method with provided parameters
    // Users
    usersGet(params) { return this.call('users.get', params); }
  • VKClient.call method - the core API call handler that constructs the request with access token, API version, and makes the POST request to VK's 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