Skip to main content
Glama
dashboards.ts3.85 kB
import { z } from "zod"; import { RadSecurityClient } from "../client.js"; // Schema for list_widget_templates export const ListWidgetTemplatesSchema = z.object({ limit: z.number().optional().default(10).describe("Maximum number of results to return (default: 10, min: 1)"), offset: z.number().optional().default(0).describe("Pagination offset (default: 0, min: 0)"), visualization_type: z.string().optional().describe("Filter by visualization type"), category: z.string().optional().describe("Filter by category"), }); // Schema for get_widget_template export const GetWidgetTemplateSchema = z.object({ widget_template_id: z.string().describe("ID of the widget template"), }); // Schema for list_dashboard_templates export const ListDashboardTemplatesSchema = z.object({ limit: z.number().optional().default(10).describe("Maximum number of results to return (default: 10, min: 1)"), offset: z.number().optional().default(0).describe("Pagination offset (default: 0, min: 0)"), category: z.string().optional().describe("Filter by category"), }); // Schema for get_dashboard_template export const GetDashboardTemplateSchema = z.object({ dashboard_template_id: z.string().describe("ID of the dashboard template"), }); // Schema for list_dashboards export const ListDashboardsSchema = z.object({ limit: z.number().optional().default(10).describe("Maximum number of results to return (default: 10, min: 1)"), offset: z.number().optional().default(0).describe("Pagination offset (default: 0, min: 0)"), }); // Schema for get_dashboard export const GetDashboardSchema = z.object({ dashboard_id: z.string().describe("ID of the dashboard"), }); /** * List widget templates with optional filtering. */ export async function listWidgetTemplates( client: RadSecurityClient, limit: number = 50, offset: number = 0, visualization_type?: string, category?: string ): Promise<any> { const params: Record<string, any> = { limit, offset }; if (visualization_type) { params.visualization_type = visualization_type; } if (category) { params.category = category; } return client.makeRequest( `/accounts/${client.getAccountId()}/dashboards/widget_templates`, params ); } /** * Get details for a specific widget template. */ export async function getWidgetTemplate( client: RadSecurityClient, widget_template_id: string ): Promise<any> { return client.makeRequest( `/accounts/${client.getAccountId()}/dashboards/widget_templates/${widget_template_id}` ); } /** * List dashboard templates with optional filtering. */ export async function listDashboardTemplates( client: RadSecurityClient, limit: number = 50, offset: number = 0, category?: string ): Promise<any> { const params: Record<string, any> = { limit, offset }; if (category) { params.category = category; } return client.makeRequest( `/accounts/${client.getAccountId()}/dashboards/templates`, params ); } /** * Get details for a specific dashboard template. */ export async function getDashboardTemplate( client: RadSecurityClient, dashboard_template_id: string ): Promise<any> { return client.makeRequest( `/accounts/${client.getAccountId()}/dashboards/templates/${dashboard_template_id}` ); } /** * List dashboards. */ export async function listDashboards( client: RadSecurityClient, limit: number = 50, offset: number = 0 ): Promise<any> { const params: Record<string, any> = { limit, offset }; return client.makeRequest( `/accounts/${client.getAccountId()}/dashboards`, params ); } /** * Get details for a specific dashboard. */ export async function getDashboard( client: RadSecurityClient, dashboard_id: string ): Promise<any> { return client.makeRequest( `/accounts/${client.getAccountId()}/dashboards/${dashboard_id}` ); }

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

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