vk_photos_get
Retrieve photos from VKontakte albums using owner ID and album identifier to access user content.
Instructions
Get photos from albums
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| owner_id | No | Album owner ID | |
| album_id | No | Album ID or: wall, profile, saved | |
| count | No | Number of photos |
Implementation Reference
- src/index.js:207-218 (schema)Tool schema definition for vk_photos_get, including name, description, and inputSchema with properties for owner_id, album_id, and count
{ name: 'vk_photos_get', description: 'Get photos from albums', inputSchema: { type: 'object', properties: { owner_id: { type: 'number', description: 'Album owner ID' }, album_id: { type: 'string', description: 'Album ID or: wall, profile, saved' }, count: { type: 'number', description: 'Number of photos' }, }, }, }, - src/index.js:303-309 (handler)Handler case for vk_photos_get that calls vk.photosGet with args.owner_id, defaults album_id to 'wall', and defaults count to 50
case 'vk_photos_get': result = await vk.photosGet({ owner_id: args.owner_id, album_id: args.album_id || 'wall', count: args.count || 50, }); break; - src/index.js:73-73 (helper)VKClient.photosGet method that wraps the API call to VK's photos.get endpoint
photosGet(params) { return this.call('photos.get', params); } - src/index.js:225-319 (handler)handleToolCall function containing the switch statement that routes tool names to their respective handlers
async function handleToolCall(name, args) { try { let result; switch (name) { case 'vk_users_get': result = await vk.usersGet({ user_ids: args.user_ids, fields: args.fields || 'photo_200,online,status', }); break; case 'vk_wall_get': result = await vk.wallGet({ owner_id: args.owner_id, domain: args.domain, count: args.count || 20, offset: args.offset, }); break; case 'vk_wall_post': result = await vk.wallPost({ owner_id: args.owner_id, message: args.message, from_group: args.from_group ? 1 : 0, }); break; case 'vk_wall_create_comment': result = await vk.wallCreateComment({ owner_id: args.owner_id, post_id: args.post_id, message: args.message, }); break; case 'vk_groups_get': result = await vk.groupsGet({ user_id: args.user_id, filter: args.filter, fields: args.fields || 'description,members_count', count: args.count || 100, }); break; case 'vk_groups_get_by_id': result = await vk.groupsGetById({ group_ids: args.group_ids, fields: args.fields || 'description,members_count', }); break; case 'vk_friends_get': result = await vk.friendsGet({ user_id: args.user_id, order: args.order, fields: args.fields || 'photo_200,online', count: args.count || 100, }); break; case 'vk_newsfeed_get': result = await vk.newsfeedGet({ filters: args.filters || 'post', count: args.count || 20, start_from: args.start_from, }); break; case 'vk_stats_get': result = await vk.statsGet({ group_id: args.group_id, interval: args.interval || 'day', intervals_count: args.intervals_count || 7, }); break; case 'vk_photos_get': result = await vk.photosGet({ owner_id: args.owner_id, album_id: args.album_id || 'wall', count: args.count || 50, }); break; default: throw new Error(`Unknown tool: ${name}`); } return JSON.stringify(result, null, 2); } catch (error) { return JSON.stringify({ error: error.message }); } }