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);
      }
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden for behavioral disclosure. It states what the tool returns (summary with UID, name, type) but doesn't mention important behavioral aspects like whether results are paginated, authentication requirements, rate limits, error conditions, or whether this is a read-only operation. For a list tool with zero annotation coverage, this leaves significant gaps.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, well-structured sentence that efficiently communicates the core functionality. It's front-loaded with the main action and includes the return format without unnecessary elaboration. Every word earns its place.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a list tool with 2 parameters and 100% schema coverage but no annotations or output schema, the description provides basic completeness. It states what's being listed and the return format, but lacks behavioral context that would be helpful for an agent. The absence of output schema means the description's mention of return format is valuable, but more behavioral transparency would improve completeness.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already fully documents both parameters (limit and name). The description adds no additional parameter semantics beyond what's in the schema. According to scoring rules, when schema coverage is high (>80%), the baseline is 3 even with no param info in the description.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb ('Lists') and resource ('Grafana notification contact points'), making the purpose immediately understandable. It distinguishes from siblings by specifying the exact resource type, though it doesn't explicitly differentiate from other list tools like list_alert_rules or list_datasources beyond naming the resource.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites, when this tool is appropriate versus other list tools, or any context-specific usage recommendations. The agent must infer usage from the tool name alone.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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