Skip to main content
Glama

get_albums

Retrieve photo albums from a specific band using its unique identifier. This tool enables users to access and view band photo collections through the Band API integration.

Instructions

Get photo albums from a specific band in BAND.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
band_keyYesband ID

Implementation Reference

  • The main handler function for the get_albums tool. It fetches photo albums from the BAND API using the provided band_key and returns the JSON response as text content.
    export async function handleToolCall(band_key: string) {
      const albumsData = await bandApiClient.get<AlbumsResponse>(
        "/v2/band/albums",
        { band_key }
      );
      return {
        content: [
          {
            type: "text",
            text: JSON.stringify(albumsData, null, 2),
          },
        ],
      };
    }
  • Defines the tool schema including input (band_key) and detailed output schema for the albums response structure.
    export const ToolDefinition: Tool = {
      name: "get_albums",
      description: "Get photo albums from a specific band in BAND.",
      inputSchema: {
        type: "object",
        properties: {
          band_key: {
            type: "string",
            title: "Band ID",
            description: "band ID",
          },
        },
        required: ["band_key"],
      },
      outputSchema: {
        type: "object",
        properties: {
          result_code: {
            type: "number",
            description: "Result code",
          },
          result_data: {
            type: "object",
            description: "Result data",
            properties: {
              paging: {
                type: "object",
                description: "Paging information",
              },
              items: {
                type: "array",
                description: "List of photo albums",
                items: {
                  type: "object",
                  properties: {
                    photo_album_key: {
                      type: "string",
                      description: "photo album identifier",
                    },
                    name: {
                      type: "string",
                      description: "album name",
                    },
                    photo_count: {
                      type: "number",
                      description: "number of photos in album",
                    },
                    cover_photo: {
                      type: "object",
                      description: "album cover photo information",
                    },
                    created_at: {
                      type: "number",
                      description: "album created time",
                    },
                  },
                },
              },
            },
          },
        },
        required: ["result_code", "result_data"],
      },
    };
  • src/tools.ts:60-61 (registration)
    Registers the get_albums tool in the main dispatcher switch statement, calling the albums module's handler.
    case "get_albums":
      return albums.handleToolCall(a.band_key as string);
  • src/tools.ts:22-22 (registration)
    Includes the get_albums ToolDefinition in the exported bandTools array for tool listing and discovery.
    albums.ToolDefinition,
  • Re-exports ToolDefinition and handleToolCall from tool.ts for use in the main tools.ts module.
    import {ToolDefinition, handleToolCall} from "./tool.js";
    
    const albums = {ToolDefinition, handleToolCall}
    
    export default albums;

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/kanghouchao/band-mcp-server'

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