Skip to main content
Glama

Get CPU, memory and network use of a deployment

edgegap_get_deployment_metrics
Read-only

Summarize a deployment's CPU, memory, and network use over time with anomaly flags to size a version or diagnose whether a crash was memory or CPU starvation before redeploying.

Instructions

Summarise a deployment's resource use over time: CPU, CPU throttling, memory and network, each as latest, average, p95 and peak, with the API's own labels, plus anomaly flags (spikes above mean + 3 sd, a rising trend such as a memory leak, any CPU throttling) collected in anomalies. Use it to size a version (cpu_units, memory_mb) from a real match, or to check whether a crash was memory or CPU starvation before redeploying. Defaults to the whole life of the deployment. To compare two versions, use edgegap_compare_versions.

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": {
      "request_id": "<request_id>"
    },
    "name": "edgegap_get_deployment_metrics"
  }
}

Input Schema

NameRequiredDescriptionDefault
stepNoAveraging step, e.g. "30s" or "5m". Default: the API's.
end_timeNoISO 8601. Default: now, or when it stopped.
request_idYesThe request_id of the deployment.
start_timeNoISO 8601. Default: when the deployment started.

Output Schema

NameRequiredDescriptionDefault
cpuNo
noteNo
memoryNo
totalsNo
request_idNo
network_receiveNo
network_transmitNo
cpu_throttle_rateNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed15 schema fields changedv0.19.0
    • addedOutput schema / properties / cpu / properties / anomalies
      Added value: +{
      +  "items": {
      +    "type": "string"
      +  },
      +  "type": "array"
      +}
    • addedOutput schema / properties / cpu / properties / nonzero_share
      Added value: +{
      +  "type": "number"
      +}
    • addedOutput schema / properties / cpu / properties / p95
      Added value: +{
      +  "type": "number"
      +}
    • addedOutput schema / properties / cpu_throttle_rate / properties / anomalies
      Added value: +{
      +  "items": {
      +    "type": "string"
      +  },
      +  "type": "array"
      +}
    • addedOutput schema / properties / cpu_throttle_rate / properties / nonzero_share
      Added value: +{
      +  "type": "number"
      +}
    • addedOutput schema / properties / cpu_throttle_rate / properties / p95
      Added value: +{
      +  "type": "number"
      +}
    • addedOutput schema / properties / memory / properties / anomalies
      Added value: +{
      +  "items": {
      +    "type": "string"
      +  },
      +  "type": "array"
      +}
    • addedOutput schema / properties / memory / properties / nonzero_share
      Added value: +{
      +  "type": "number"
      +}
    • addedOutput schema / properties / memory / properties / p95
      Added value: +{
      +  "type": "number"
      +}
    • addedOutput schema / properties / network_receive / properties / anomalies
      Added value: +{
      +  "items": {
      +    "type": "string"
      +  },
      +  "type": "array"
      +}
    • addedOutput schema / properties / network_receive / properties / nonzero_share
      Added value: +{
      +  "type": "number"
      +}
    • addedOutput schema / properties / network_receive / properties / p95
      Added value: +{
      +  "type": "number"
      +}
    • addedOutput schema / properties / network_transmit / properties / anomalies
      Added value: +{
      +  "items": {
      +    "type": "string"
      +  },
      +  "type": "array"
      +}
    • addedOutput schema / properties / network_transmit / properties / nonzero_share
      Added value: +{
      +  "type": "number"
      +}
    • addedOutput schema / properties / network_transmit / properties / p95
      Added value: +{
      +  "type": "number"
      +}
  2. Changed1 schema field changedv0.12.0
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "$schema": "http://json-schema.org/draft-07/schema#",
      +  "additionalProperties": {},
      +  "properties": {
      +    "cpu": {
      +      "additionalProperties": {},
      +      "properties": {
      +        "average": {
      +          "type": "number"
      +        },
      +        "from": {
      +          "type": "string"
      +        },
      +        "labels": {
      +          "items": {
      +            "type": "string"
      +          },
      +          "type": "array"
      +        },
      +        "latest": {
      +          "type": "number"
      +        },
      +        "peak": {
      +          "type": "number"
      +        },
      +        "samples": {
      +          "type": "number"
      +        },
      +        "to": {
      +          "type": "string"
      +        }
      +      },
      +      "type": "object"
      +    },
      +    "cpu_throttle_rate": {
      +      "additionalProperties": {},
      +      "properties": {
      +        "average": {
      +          "type": "number"
      +        },
      +        "from": {
      +          "type": "string"
      +        },
      +        "labels": {
      +          "items": {
      +            "type": "string"
      +          },
      +          "type": "array"
      +        },
      +        "latest": {
      +          "type": "number"
      +        },
      +        "peak": {
      +          "type": "number"
      +        },
      +        "samples": {
      +          "type": "number"
      +        },
      +        "to": {
      +          "type": "string"
      +        }
      +      },
      +      "type": "object"
      +    },
      +    "memory": {
      +      "additionalProperties": {},
      +      "properties": {
      +        "average": {
      +          "type": "number"
      +        },
      +        "from": {
      +          "type": "string"
      +        },
      +        "labels": {
      +          "items": {
      +            "type": "string"
      +          },
      +          "type": "array"
      +        },
      +        "latest": {
      +          "type": "number"
      +        },
      +        "peak": {
      +          "type": "number"
      +        },
      +        "samples": {
      +          "type": "number"
      +        },
      +        "to": {
      +          "type": "string"
      +        }
      +      },
      +      "type": "object"
      +    },
      +    "network_receive": {
      +      "additionalProperties": {},
      +      "properties": {
      +        "average": {
      +          "type": "number"
      +        },
      +        "from": {
      +          "type": "string"
      +        },
      +        "labels": {
      +          "items": {
      +            "type": "string"
      +          },
      +          "type": "array"
      +        },
      +        "latest": {
      +          "type": "number"
      +        },
      +        "peak": {
      +          "type": "number"
      +        },
      +        "samples": {
      +          "type": "number"
      +        },
      +        "to": {
      +          "type": "string"
      +        }
      +      },
      +      "type": "object"
      +    },
      +    "network_transmit": {
      +      "additionalProperties": {},
      +      "properties": {
      +        "average": {
      +          "type": "number"
      +        },
      +        "from": {
      +          "type": "string"
      +        },
      +        "labels": {
      +          "items": {
      +            "type": "string"
      +          },
      +          "type": "array"
      +        },
      +        "latest": {
      +          "type": "number"
      +        },
      +        "peak": {
      +          "type": "number"
      +        },
      +        "samples": {
      +          "type": "number"
      +        },
      +        "to": {
      +          "type": "string"
      +        }
      +      },
      +      "type": "object"
      +    },
      +    "note": {
      +      "type": "string"
      +    },
      +    "request_id": {
      +      "type": "string"
      +    },
      +    "totals": {
      +      "additionalProperties": {},
      +      "properties": {
      +        "disk_read": {
      +          "type": "number"
      +        },
      +        "disk_written": {
      +          "type": "number"
      +        },
      +        "received": {
      +          "type": "number"
      +        },
      +        "transmitted": {
      +          "type": "number"
      +        }
      +      },
      +      "type": "object"
      +    }
      +  },
      +  "type": "object"
      +}
  3. Addedv0.7.1

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true and openWorldHint=true, and the description goes beyond them by defining the anomaly semantics (spikes above mean + 3 sd, rising trend such as a memory leak, any CPU throttling) and stating the default time window. It does not mention rate limits, payload size, or behavior when the deployment is still running versus stopped, which keeps it from a 5.

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

Conciseness4/5

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

Front-loaded with the metric inventory, then the use cases, then the sibling routing — a sensible order. The middle sentence is dense (anomaly definitions plus field name), but every clause carries information an agent would otherwise have to infer.

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 read-only metrics tool with an output schema, full parameter coverage, and annotations, the description supplies everything needed: what is measured, how it is aggregated, how anomalies are flagged, the default window, and which sibling to use instead. Nothing material for correct invocation is missing.

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 request_id, step, start_time and end_time are already documented with defaults. The description only adds the aggregate default ("whole life of the deployment"), which reinforces but does not extend the schema's per-parameter semantics. Baseline 3 applies when the schema does the heavy lifting.

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

Purpose5/5

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

Opens with a specific verb and resource ("Summarise a deployment's resource use over time") and enumerates exactly which metrics are returned (CPU, throttling, memory, network) with the aggregation shape (latest, average, p95, peak). It also names the sibling edgegap_compare_versions as the different tool for cross-version comparison, so an agent can distinguish it without opening a schema.

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

Usage Guidelines5/5

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

Gives two concrete when-to-use scenarios: sizing a version's cpu_units/memory_mb from a real match, and diagnosing whether a crash was memory or CPU starvation before redeploying. It also names the explicit alternative and the condition that selects it ("To compare two versions, use edgegap_compare_versions").

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