Skip to main content
Glama

get_all_badges

Retrieve all available badges for your organization to view badge IDs and names for management and selection purposes.

Instructions

Retrieve all available badges for the authenticated organization. Returns a list of badges with their IDs and names.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNoMaximum number of badges to return (default: 100, max: 100)

Implementation Reference

  • MCP tool handler: validates input with GetAllBadgesSchema, calls apiClient.getAllBadges, formats and returns the list of badges or error response.
    case 'get_all_badges': { const validatedArgs = GetAllBadgesSchema.parse(args); const result = await apiClient.getAllBadges(validatedArgs.limit); if (result.success && result.data) { const badgeList = result.data.map((badge: Badge, index: number) => `${index + 1}. ${badge.name} (ID: ${badge.id})` ).join('\n'); return { content: [ { type: 'text', text: `🏆 Available Badges (${result.data.length}):\n\n${badgeList}\n\n${JSON.stringify(result, null, 2)}`, }, ], }; } return { content: [ { type: 'text', text: `📋 Badge List Result:\n\n${JSON.stringify(result, null, 2)}`, }, ], }; }
  • Zod schema defining the optional 'limit' parameter for the get_all_badges tool input validation.
    const GetAllBadgesSchema = z.object({ limit: z.number().optional().describe('Maximum number of badges to return (default: 100)'), });
  • src/index.ts:260-276 (registration)
    Tool registration in the MCP tools array, defining name, description, and JSON inputSchema.
    { name: 'get_all_badges', description: 'Retrieve all available badges for the authenticated organization. Returns a list of badges with their IDs and names.', inputSchema: { type: 'object', properties: { limit: { type: 'number', description: 'Maximum number of badges to return (default: 100, max: 100)', default: 100, minimum: 1, maximum: 100, }, }, required: [], }, },
  • API client helper method that performs the HTTP GET request to '/badge/getall' to fetch badges.
    async getAllBadges(limit = 100): Promise<ApiResponse<Badge[]>> { const response = await this.client.get('/badge/getall', { params: { limit }, }); return response.data; }

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

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