Skip to main content
Glama
yanmxa

Prometheus MCP Server

by yanmxa

prom_targets

Retrieve Prometheus scrape target status to monitor active or dropped metrics collection for system performance analysis.

Instructions

Get scrape target information

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
stateNo

Implementation Reference

  • Handler logic for 'prom_targets' tool in handleToolCall: validates arguments and delegates to prometheusClient.targets(state)
    case 'prom_targets': {
      if (!isPromTargetsArgs(args)) {
        throw new Error('Invalid arguments for prom_targets');
      }
      const { state } = args as PromTargetsArgs;
      result = await prometheusClient.targets(state);
      break;
    }
  • Core implementation in PrometheusClient.targets(): makes HTTP GET to Prometheus /api/v1/targets endpoint with optional state parameter
    async targets(state?: 'active' | 'dropped' | 'any'): Promise<PrometheusResponse<TargetsResult>> {
      const params: Record<string, string> = {};
      if (state) params.state = state;
      const response = await this.client.get<PrometheusResponse<TargetsResult>>('/api/v1/targets', { params });
      return response.data;
    }
  • src/tools.ts:54-64 (registration)
    Registration of 'prom_targets' tool in the tools array, including name, description, and inputSchema
      {
        name: 'prom_targets',
        description: 'Get scrape target information',
        inputSchema: {
          type: 'object',
          properties: {
            state: { type: 'string', enum: ['active', 'dropped', 'any'] },
          },
        },
      },
    ];
  • Input schema definition for 'prom_targets' tool arguments
    inputSchema: {
      type: 'object',
      properties: {
        state: { type: 'string', enum: ['active', 'dropped', 'any'] },
      },
    },
  • TypeScript interface PromTargetsArgs matching the input schema
    export interface PromTargetsArgs {
      state?: 'active' | 'dropped' | 'any';
    }
Behavior1/5

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

No annotations are provided, so the description carries full burden for behavioral disclosure. It only states what the tool does ('Get scrape target information') without any details on permissions, rate limits, response format, or side effects. This leaves the agent with insufficient information about how the tool behaves.

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 extremely concise with a single sentence 'Get scrape target information'. It's front-loaded and wastes no words, though this brevity contributes to its inadequacy in other dimensions.

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

Completeness1/5

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

Given the tool's complexity (inferred from sibling tools suggesting Prometheus monitoring context), no annotations, no output schema, and poor parameter documentation, the description is completely inadequate. It doesn't explain what 'scrape target information' includes, how results are returned, or any operational constraints.

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

Parameters2/5

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

The input schema has one parameter 'state' with enum values, but schema description coverage is 0%, meaning the schema doesn't explain what 'state' means. The description doesn't mention parameters at all, failing to compensate for the lack of schema documentation. This leaves the agent guessing about parameter usage.

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

Purpose2/5

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

The description 'Get scrape target information' restates the tool name 'prom_targets' in slightly different words, making it tautological. It specifies the verb 'Get' and resource 'scrape target information', but doesn't clarify what 'scrape target information' means or how it differs from sibling tools like prom_discover, prom_query, or prom_range.

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

Usage Guidelines1/5

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

No guidance is provided on when to use this tool versus alternatives. The description doesn't mention any context, prerequisites, or exclusions, and it doesn't reference sibling tools to help the agent choose appropriately among Prometheus-related functions.

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/yanmxa/prometheus-mcp-server'

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