Skip to main content
Glama
yanmxa

Prometheus MCP Server

by yanmxa

prom_query

Execute PromQL instant queries to retrieve real-time Prometheus metrics for system monitoring and performance analysis.

Instructions

Execute a PromQL instant query

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesPromQL query expression
timeNoEvaluation timestamp (optional)
includesNoMetric properties to include in response (optional)

Implementation Reference

  • Handler logic for 'prom_query' tool: validates input arguments using isPromQueryArgs and executes the query via prometheusClient.query.
    case 'prom_query': {
      if (!isPromQueryArgs(args)) {
        throw new Error('Invalid arguments for prom_query');
      }
      const { query, time, includes } = args;
      result = await prometheusClient.query(query, time, includes);
      break;
  • src/tools.ts:11-23 (registration)
    Registration of the 'prom_query' tool in the exported tools array, defining name, description, and input schema.
    {
      name: 'prom_query',
      description: 'Execute a PromQL instant query',
      inputSchema: {
        type: 'object',
        properties: {
          query: { type: 'string', description: 'PromQL query expression' },
          time: { type: 'string', description: 'Evaluation timestamp (optional)' },
          includes: { type: 'array', items: { type: 'string' }, description: 'Metric properties to include in response (optional)' },
        },
        required: ['query'],
      },
    },
  • TypeScript interface defining the expected arguments for prom_query, matching the input schema.
    export interface PromQueryArgs {
      query: string;
      time?: string;
      includes?: string[];
    }
  • Type guard helper function to validate if arguments match PromQueryArgs structure.
    function isPromQueryArgs(args: unknown): args is PromQueryArgs {
      return typeof args === 'object' && args !== null && 'query' in args;
    }
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the action ('Execute') but doesn't describe what happens during execution—whether it's read-only, has side effects, requires authentication, has rate limits, or what the response format looks like. For a query execution tool, this leaves critical behavioral traits unspecified.

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, efficient sentence with zero waste. It's front-loaded with the core action and resource, making it easy to parse. Every word earns its place, and there's no redundant or verbose language.

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

Completeness2/5

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

Given the complexity of executing a PromQL query (which involves query language syntax, evaluation, and potential side effects), the description is incomplete. With no annotations and no output schema, it doesn't explain return values, error handling, or behavioral traits. For a tool with 3 parameters and no structured safety hints, this leaves significant gaps in understanding.

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 documents all three parameters (query, time, includes) with descriptions. The tool description adds no additional parameter semantics beyond what's in the schema. This meets the baseline of 3, as the schema does the heavy lifting, but the description doesn't compensate with extra context like examples or constraints.

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 ('Execute') and resource ('PromQL instant query'), making the purpose immediately understandable. It distinguishes from sibling tools like prom_range (which likely handles range queries) and prom_discover/prom_metadata/prom_targets (which are likely for metadata discovery). However, it doesn't explicitly contrast with these siblings, keeping it from a perfect score.

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 like prom_range or prom_discover. It doesn't mention prerequisites, typical use cases, or exclusions. The agent must infer usage from the name and context alone, which is insufficient for optimal tool selection.

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