Skip to main content
Glama
0xteamhq

Grafana MCP Server

by 0xteamhq

list_contact_points

Retrieve Grafana notification contact points with filtering options to manage alert destinations and configurations.

Instructions

Lists Grafana notification contact points, returning a summary including UID, name, and type

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNoMaximum number of results to return
nameNoFilter contact points by name

Implementation Reference

  • The main handler function for the list_contact_points tool, which creates a GrafanaClient, calls listContactPoints on it, applies client-side filters for name and limit, formats the response, and returns the result.
    handler: async (params, context: ToolContext) => { try { const client = new GrafanaClient(context.config.grafanaConfig); let contactPoints = await client.listContactPoints(); // Apply filtering if name is provided if (params.name) { contactPoints = contactPoints.filter((cp: any) => cp.name === params.name); } // Apply limit if (params.limit) { contactPoints = contactPoints.slice(0, params.limit); } // Format the response const formatted = contactPoints.map((cp: any) => ({ uid: cp.uid, name: cp.name, type: cp.type, settings: cp.settings, })); return createToolResult(formatted); } catch (error: any) { return createErrorResult(error.message); } },
  • Zod input schema for the list_contact_points tool defining optional name filter and limit.
    const ListContactPointsSchema = z.object({ name: z.string().optional().describe('Filter contact points by name'), limit: z.number().optional().describe('Maximum number of results to return'), });
  • The registerAlertingTools function that registers the list_contact_points tool (along with related alerting tools) to the MCP server.
    export function registerAlertingTools(server: any) { server.registerTool(listAlertRules); server.registerTool(getAlertRuleByUid); server.registerTool(listContactPoints); }
  • GrafanaClient helper method that performs the actual API call to fetch contact points from Grafana's /api/v1/provisioning/contact-points endpoint.
    async listContactPoints(): Promise<any[]> { try { const response = await this.client.get('/api/v1/provisioning/contact-points'); return response.data; } catch (error) { this.handleError(error); } }

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/0xteamhq/mcp-grafana'

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