Skip to main content
Glama
io.github.ryanmat/logicmonitor

io.github.ryanmat/logicmonitor

by ryanmat

correlate_metrics

Read-onlyIdempotent

Computes Pearson correlations across up to 10 metric series by aligning timestamps, building an NxN matrix, and flagging correlations above |r| > 0.7 over shared time buckets.

Instructions

Compute Pearson correlation between multiple metric series. Joins the series by timestamp bucket, as wide as the coarsest series' median sample interval with finer series averaged into it, and correlates over the buckets every series holds, reported as shared_samples. Builds an NxN correlation matrix and highlights strong correlations (|r| > 0.7). Maximum 10 sources.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "sources": "<sources>"
    },
    "name": "correlate_metrics"
  }
}

Input Schema

NameRequiredDescriptionDefault
sourcesYesList of metric sources to correlate
hours_backNoHours of data to analyze

Output Schema

NameRequiredDescriptionDefault
labelsYes
portalNoThe portal the call ran against, in multi-portal mode.
warningsNo
hours_backYes
bucket_secondsYes
shared_samplesYes
correlation_matrixYesPearson r for each pair of labels, in label order.
strong_correlationsYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv5.0.1
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "additionalProperties": false,
      +  "properties": {
      +    "bucket_seconds": {
      +      "type": "integer"
      +    },
      +    "correlation_matrix": {
      +      "description": "Pearson r for each pair of labels, in label order.",
      +      "items": {
      +        "items": {
      +          "type": [
      +            "number",
      +            "null"
      +          ]
      +        },
      +        "type": "array"
      +      },
      +      "type": "array"
      +    },
      +    "hours_back": {
      +      "type": "integer"
      +    },
      +    "labels": {
      +      "items": {
      +        "type": "string"
      +      },
      +      "type": "array"
      +    },
      +    "portal": {
      +      "description": "The portal the call ran against, in multi-portal mode.",
      +      "type": [
      +        "string",
      +        "null"
      +      ]
      +    },
      +    "shared_samples": {
      +      "type": "integer"
      +    },
      +    "strong_correlations": {
      +      "items": {
      +        "additionalProperties": false,
      +        "properties": {
      +          "correlation": {
      +            "type": "number"
      +          },
      +          "source_a": {
      +            "type": "string"
      +          },
      +          "source_b": {
      +            "type": "string"
      +          },
      +          "strength": {
      +            "enum": [
      +              "strong_positive",
      +              "strong_negative"
      +            ]
      +          }
      +        },
      +        "required": [
      +          "source_a",
      +          "source_b",
      +          "correlation",
      +          "strength"
      +        ],
      +        "type": "object"
      +      },
      +      "type": "array"
      +    },
      +    "warnings": {
      +      "items": {
      +        "type": "string"
      +      },
      +      "type": "array"
      +    }
      +  },
      +  "required": [
      +    "labels",
      +    "correlation_matrix",
      +    "strong_correlations",
      +    "shared_samples",
      +    "bucket_seconds",
      +    "hours_back"
      +  ],
      +  "type": "object"
      +}
  2. First observedv4.2.0

TDQS

A4/5.0
Behavior4/5

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

Annotations already cover readOnly, idempotent, non-destructive and open-world, yet the description still adds real substance: the timestamp-bucket join, that finer series are averaged into the coarsest series' median interval, that only buckets held by every series are correlated, and that shared_samples reports the overlap. The 10-source ceiling is a behavioral limit not stated in structured fields. It stops short of discussing cost or latency on wide matrices, which is the only remaining gap.

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?

Two sentences, front-loaded with the operation, then the join/output mechanics, then the limit. Dense technical content but every clause carries information an agent needs; nothing is redundant with the name or annotations.

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

Completeness5/5

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

For a tool with nontrivial bucketing semantics, the description explains the alignment algorithm, the sample-count reporting and the source ceiling, which is exactly what an agent needs to call it and interpret results. An output schema exists, so return-value details beyond the matrix shape and |r| > 0.7 highlighting are appropriately not restated.

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

Parameters4/5

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

Schema coverage is 100%, so the baseline is 3, but the description contributes extra meaning: the 'Maximum 10 sources' constraint on the sources array is not encoded in the schema, and the bucketing explanation clarifies what hours_back actually controls. It does not clarify the semantics of the nested device_id/instance_id/datapoint tuple, but the schema already labels those.

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 definition names a specific verb and resource, 'Compute Pearson correlation between multiple metric series', and adds the NxN matrix output, so the function is unambiguous. It does not explicitly distinguish itself from nearby readers such as analyze_metric or get_interface_metrics, leaving that differentiation to inference.

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

Usage Guidelines3/5

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

Usage is implied by the phrasing 'multiple metric series' and the hard 'Maximum 10 sources' cap, which tells the agent when the tool is applicable in scale terms. There is no explicit when-to-use or when-not-to-use guidance versus sibling analysis tools, and no prerequisite or exclusion statements.

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

Deploy Server

Other Tools