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
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Maximum number of badges to return (default: 100, max: 100) |
Implementation Reference
- src/index.ts:428-455 (handler)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)}`, }, ], }; }
- src/index.ts:179-184 (handler)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; }
- src/index.ts:69-71 (schema)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: [], }, },