Skip to main content
Glama

Binalyze AIR MCP Server

Official
by binalyze
MIT License
66
7
  • Linux
  • Apple
users.ts2.97 kB
import axios from 'axios'; import { config } from '../../../config'; export interface UserProfile { name: string; surname: string; department: string; } export interface UserRole { _id: string; createdAt: string; updatedAt: string; name: string; createdBy: string; tag: string; privilegeTypes: string[]; } export interface User { _id: string; email: string; username: string; organizationIds: string; strategy: string; profile: UserProfile; tfaEnabled: boolean; createdAt: string; updatedAt: string; roles: UserRole[]; } export interface OrganizationUsersResponse { success: boolean; result: { entities: User[]; filters: Array<{ name: string; type: string; options: string[]; filterUrl: string | null; }>; sortables: string[]; totalEntityCount: number; currentPage: number; pageSize: number; previousPage: number; totalPageCount: number; nextPage: number; }; statusCode: number; errors: string[]; } export const api = { async getOrganizationUsers(organizationId: number | string): Promise<OrganizationUsersResponse> { try { const response = await axios.get( `${config.airHost}/api/public/organizations/${organizationId}/users`, { headers: { 'Content-Type': 'application/json', 'Authorization': `Bearer ${config.airApiToken}` } } ); return response.data; } catch (error) { console.error(`Error fetching users for organization ${organizationId}:`, error); throw error; } }, async assignUsersToOrganization(organizationId: number | string, userIds: string[]): Promise<{ success: boolean; result: null; statusCode: number; errors: string[]; }> { try { const response = await axios.post( `${config.airHost}/api/public/organizations/${organizationId}/assign-users`, { userIds }, { headers: { 'Content-Type': 'application/json', 'Authorization': `Bearer ${config.airApiToken}` } } ); return response.data; } catch (error) { console.error(`Error assigning users to organization ${organizationId}:`, error); throw error; } }, async removeUserFromOrganization(organizationId: number | string, userId: string): Promise<{ success: boolean; result: null; statusCode: number; errors: string[]; }> { try { const response = await axios.delete( `${config.airHost}/api/public/organizations/${organizationId}/remove-user/${userId}`, { headers: { 'Content-Type': 'application/json', 'Authorization': `Bearer ${config.airApiToken}` } } ); return response.data; } catch (error) { console.error(`Error removing user ${userId} from organization ${organizationId}:`, error); throw error; } } };

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/binalyze/air-mcp'

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