Skip to main content
Glama

get_all_badges

Retrieve all available badges for your organization to view IDs and names. Use this tool to access badge information 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 dispatcher handler for 'get_all_badges': validates input using schema, calls the API client method, formats and returns the list of badges in a user-friendly 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)}`, }, ], }; }
  • Core API client handler that performs the HTTP GET request to '/badge/getall' endpoint to fetch the list of badges.
    async getAllBadges(limit = 100): Promise<ApiResponse<Badge[]>> { const response = await this.client.get('/badge/getall', { params: { limit }, }); return response.data; }
  • Zod schema defining the input parameters for the get_all_badges tool (optional limit parameter).
    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 object added to the MCP tools array, specifying name, description, and input schema for listTools request.
    { 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: [], }, },

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