Skip to main content
Glama

Querypointintimemetrics

queryPointInTimeMetrics

Execute point-in-time queries for one or more engineering metrics.

Returns current metric values for specified time periods, with support for batch queries. Time range (startTime/endTime) cannot exceed 6 months (180 days).

COMPARISON FIELD: If you need to compare against a different time window, use the comparison field with type='TIME_WINDOW'. The ONLY valid type is TIME_WINDOW. Do NOT use PERIOD_OVER_PERIOD or any other type. Example: {"type": "TIME_WINDOW", "startTime": "2025-01-01T00:00:00", "endTime": "2025-01-15T00:00:00"}

PREREQUISITES - Follow this workflow:

  1. Discover all available metrics ONCE: Call listMetricDefinitions (view='basic') - cache this response

  2. Get metric query metadata ONCE per metric: Call listMetricDefinitions (view='full', key=METRIC_KEY)

    • supportedAggregations: Valid aggregation methods

    • orderByAttribute: Attribute path for sorting by metric values

    • groupByOptions[].key: Valid groupBy keys (use exact values, do NOT guess)

    • filterOptions[].key: Valid filter keys (use exact values, do NOT guess) Cache the full view response for each metric. Reuse the metadata from cached responses for subsequent queries on the same metric.

  3. Construct query: Use the query metadata from the full view responses in step 2 to build valid point-in-time requests

IMPORTANT: Cache only results from listMetricDefinitions. Do NOT cache point-in-time query results - always execute fresh queries for current data. Only refresh cached listMetricDefinitions responses if no longer in your context window or explicitly requested. Do NOT guess attribute names - always use exact values from listMetricDefinitions responses.

Response includes:

  • Lightweight metadata: Column definitions optimized for programmatic use

  • Row data: Actual metric values and dimensional data

  • No heavy schemas: Source definitions excluded (get from listMetricDefinitions instead)

Error responses:

  • 400: Invalid metric names, date range, validation errors, or unsupported metric combinations

  • 403: Restricted Feature (contact help@cortex.io)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitYesMaximum number of results to return
contextYes Explain why you're invoking this tool now and how its output will be used. Then state how this call supports your *overall objective* and fits into your broader plan across all tool calls (e.g., why this tool vs. others, and what step it unblocks). Never share any personal details or sensitive information.
endTimeYesEnd time for the query period
filtersYesFilters to apply to the data
groupByYesFields to group results by
metricsYesList of metrics to query with their aggregation functions
orderByYesSort order for results
nextPageNoPagination token for next page of results
startTimeYesStart time for the query period
comparisonNo
daysOfWeekNoOptional day-of-week restriction (ISO: Monday=1..Sunday=7). When set, the query filters out rows whose time-attribute does not fall on one of these weekdays. Use {1,2,3,4,5} to exclude weekends. Empty set matches nothing.
session_idYesSession continuity handle, one of two values: the ses_ ID issued for the task underway, or start. This server cannot link your calls between requests on its own, so session continuity travels in this parameter instead. If you were handed a session_id for this task — for example by the agent that spawned you — send that exact value from your first call. Otherwise send start on your first call; the server will issue an opaque correlation ID in the mcp_session field of the result, or in a text block at the start of the result beginning [session_id issued. Then send that exact ses_ value on every later call and hand it to any subagents working the same task. start always begins a new, unrelated task — never send it mid-task. If you send a value this server does not recognize, the result reports it: mcp_session.status of unrecognized, or a text block beginning [session_id unrecognized; re-send the ID issued for this task, or start if none was issued yet. Never invent a ses_ value.
timeAttributeNoDeprecated: use timeAttributes instead. Single time attribute override as a fully-qualified path (e.g. 'pull_requests.date_closed').
timeAttributesNoTime attributes to use for queries. Each entry is a fully-qualified attribute path (e.g. 'pull_requests.date_closed'). The source is inferred from the prefix. For single-source queries, provide one entry. For multi-source, provide one per source to override.
nestedAggregationsNoNested aggregations for advanced sub-queries

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changed
    • changedInput schema / properties / metrics / items / properties / aggregation / enum
      Previous value: -[
      -  "SUM",
      -  "AVG",
      -  "COUNT",
      -  "RATIO",
      -  "MIN",
      -  "MAX",
      -  "P50",
      -  "P95",
      -  "RANKING",
      -  "COLLECT",
      -  "COLLECT_UNIQUE",
      -  "COUNT_UNIQUE"
      -]New value: +[
      +  "SUM",
      +  "AVG",
      +  "COUNT",
      +  "RATIO",
      +  "MIN",
      +  "MAX",
      +  "P50",
      +  "P95",
      +  "RANKING",
      +  "COLLECT",
      +  "COLLECT_UNIQUE",
      +  "COUNT_UNIQUE",
      +  "LATEST"
      +]
    • changedInput schema / properties / nestedAggregations / items / properties / aggregations / items / properties / aggregation / enum
      Previous value: -[
      -  "SUM",
      -  "AVG",
      -  "COUNT",
      -  "RATIO",
      -  "MIN",
      -  "MAX",
      -  "P50",
      -  "P95",
      -  "RANKING",
      -  "COLLECT",
      -  "COLLECT_UNIQUE",
      -  "COUNT_UNIQUE"
      -]New value: +[
      +  "SUM",
      +  "AVG",
      +  "COUNT",
      +  "RATIO",
      +  "MIN",
      +  "MAX",
      +  "P50",
      +  "P95",
      +  "RANKING",
      +  "COLLECT",
      +  "COLLECT_UNIQUE",
      +  "COUNT_UNIQUE",
      +  "LATEST"
      +]
  2. Changed2 schema fields changed
    • removedInput schema / properties / metrics / items / properties / aggregation / description
      Removed value: -"Type of aggregation function applied to the attribute"
    • removedInput schema / properties / nestedAggregations / items / properties / aggregations / items / properties / aggregation / description
      Removed value: -"Type of aggregation function applied to the attribute"
  3. Changed20 schema fields changed
    • addedInput schema / properties / comparison / anyOf
      Added value: +[
      +  {
      +    "allOf": [
      +      {
      +        "description": "Optional comparison to previous time period",
      +        "properties": {
      +          "type": {
      +            "type": "string"
      +          }
      +        },
      +        "required": [
      +          "type"
      +        ],
      +        "type": "object"
      +      },
      +      {
      +        "properties": {
      +          "peerFilters": {
      +            "items": {
      +              "description": "Filters to apply to the query",
      +              "properties": {
      +                "attribute": {
      +                  "type": "string"
      +                },
      +                "operator": {
      +                  "enum": [
      +                    "ANY",
      +                    "BETWEEN",
      +                    "CONTAINS",
      +                    "EQUAL",
      +                    "GREATER_THAN",
      +                    "GREATER_THAN_OR_EQUAL",
      +                    "IN",
      +                    "IS_NOT_NULL",
      +                    "IS_NULL",
      +                    "LESS_THAN",
      +                    "LESS_THAN_OR_EQUAL",
      +                    "LIKE",
      +                    "NOT_EQUAL",
      +                    "NOT_IN",
      +                    "NOT_LIKE"
      +                  ],
      +                  "type": "string"
      +                },
      +                "predicate": {
      +                  "type": "object"
      +                }
      +              },
      +              "required": [
      +                "attribute",
      +                "operator",
      +                "predicate"
      +              ],
      +              "type": "object"
      +            },
      +            "type": "array"
      +          }
      +        },
      +        "required": [
      +          "peerFilters"
      +        ],
      +        "type": "object"
      +      }
      +    ],
      +    "type": "object"
      +  },
      +  {
      +    "allOf": [
      +      {
      +        "description": "Optional comparison to previous time period",
      +        "properties": {
      +          "type": {
      +            "type": "string"
      +          }
      +        },
      +        "required": [
      +          "type"
      +        ],
      +        "type": "object"
      +      },
      +      {
      +        "properties": {
      +          "decimalPlaces": {
      +            "format": "int32",
      +            "type": "integer"
      +          },
      +          "endTime": {
      +            "format": "date-time",
      +            "type": "string"
      +          },
      +          "startTime": {
      +            "format": "date-time",
      +            "type": "string"
      +          }
      +        },
      +        "required": [
      +          "decimalPlaces",
      +          "endTime",
      +          "startTime"
      +        ],
      +        "type": "object"
      +      }
      +    ],
      +    "type": "object"
      +  }
      +]
    • removedInput schema / properties / comparison / oneOf
      Removed value: -[
      -  {
      -    "allOf": [
      -      {
      -        "description": "List of column definitions describing each field in the result rows",
      -        "discriminator": {
      -          "propertyName": "type"
      -        },
      -        "properties": {
      -          "alias": {
      -            "type": "string"
      -          },
      -          "category": {
      -            "type": "string"
      -          },
      -          "description": {
      -            "type": "string"
      -          },
      -          "name": {
      -            "type": "string"
      -          },
      -          "ordinal": {
      -            "format": "int32",
      -            "type": "integer"
      -          },
      -          "type": {
      -            "type": "string"
      -          }
      -        },
      -        "required": [
      -          "alias",
      -          "name",
      -          "ordinal",
      -          "type"
      -        ],
      -        "type": "object"
      -      },
      -      {
      -        "properties": {
      -          "ordinal": {
      -            "description": "Zero-based column position in the result data rows - use this to map column metadata to actual row data values",
      -            "format": "int32",
      -            "type": "integer"
      -          },
      -          "windowSize": {
      -            "description": "Duration of the time window represented by this column",
      -            "properties": {
      -              "nano": {
      -                "format": "int32",
      -                "type": "integer"
      -              },
      -              "negative": {
      -                "type": "boolean"
      -              },
      -              "positive": {
      -                "type": "boolean"
      -              },
      -              "seconds": {
      -                "format": "int64",
      -                "type": "integer"
      -              },
      -              "units": {
      -                "items": {
      -                  "properties": {
      -                    "dateBased": {
      -                      "type": "boolean"
      -                    },
      -                    "duration": {
      -                      "properties": {
      -                        "nano": {
      -                          "format": "int32",
      -                          "type": "integer"
      -                        },
      -                        "negative": {
      -                          "type": "boolean"
      -                        },
      -                        "positive": {
      -                          "type": "boolean"
      -                        },
      -                        "seconds": {
      -                          "format": "int64",
      -                          "type": "integer"
      -                        },
      -                        "zero": {
      -                          "type": "boolean"
      -                        }
      -                      },
      -                      "type": "object"
      -                    },
      -                    "durationEstimated": {
      -                      "type": "boolean"
      -                    },
      -                    "timeBased": {
      -                      "type": "boolean"
      -                    }
      -                  },
      -                  "type": "object"
      -                },
      -                "type": "array"
      -              },
      -              "zero": {
      -                "type": "boolean"
      -              }
      -            },
      -            "type": "object"
      -          }
      -        },
      -        "type": "object"
      -      }
      -    ],
      -    "required": [
      -      "alias",
      -      "name",
      -      "ordinal",
      -      "windowSize"
      -    ],
      -    "type": "object"
      -  }
      -]
    • addedInput schema / properties / daysOfWeek
      Added value: +{
      +  "description": "Optional day-of-week restriction (ISO: Monday=1..Sunday=7). When set, the query filters out rows whose time-attribute does not fall on one of these weekdays. Use {1,2,3,4,5} to exclude weekends. Empty set matches nothing.",
      +  "items": {
      +    "description": "Optional day-of-week restriction (ISO: Monday=1..Sunday=7). When set, the query filters out rows whose time-attribute does not fall on one of these weekdays. Use {1,2,3,4,5} to exclude weekends. Empty set matches nothing.",
      +    "format": "int32",
      +    "type": "integer"
      +  },
      +  "type": "array",
      +  "uniqueItems": true
      +}
    • changedInput schema / properties / filters / items / description
      Previous value: -"Filters to apply to the data"New value: +"Filters to apply to the query"
    • removedInput schema / properties / metrics / items / description
      Removed value: -"Optional nested metrics for advanced queries"
    • addedInput schema / properties / metrics / items / properties / aggregation / description
      Added value: +"Type of aggregation function applied to the attribute"
    • changedInput schema / properties / metrics / items / properties / aggregation / enum
      Previous value: -[
      -  "SUM",
      -  "AVG",
      -  "COUNT",
      -  "RATIO",
      -  "MIN",
      -  "MAX",
      -  "P50",
      -  "P95",
      -  "RANKING"
      -]New value: +[
      +  "SUM",
      +  "AVG",
      +  "COUNT",
      +  "RATIO",
      +  "MIN",
      +  "MAX",
      +  "P50",
      +  "P95",
      +  "RANKING",
      +  "COLLECT",
      +  "COLLECT_UNIQUE",
      +  "COUNT_UNIQUE"
      +]
    • addedInput schema / properties / metrics / items / properties / density
      Added value: +{
      +  "enum": [
      +    "REQUIRED",
      +    "OPTIONAL"
      +  ],
      +  "type": "string"
      +}
    • addedInput schema / properties / metrics / items / properties / endTime
      Added value: +{
      +  "format": "date-time",
      +  "type": "string"
      +}
    • addedInput schema / properties / metrics / items / properties / filters
      Added value: +{
      +  "items": {
      +    "description": "Filters to apply to the query",
      +    "properties": {
      +      "attribute": {
      +        "type": "string"
      +      },
      +      "operator": {
      +        "enum": [
      +          "ANY",
      +          "BETWEEN",
      +          "CONTAINS",
      +          "EQUAL",
      +          "GREATER_THAN",
      +          "GREATER_THAN_OR_EQUAL",
      +          "IN",
      +          "IS_NOT_NULL",
      +          "IS_NULL",
      +          "LESS_THAN",
      +          "LESS_THAN_OR_EQUAL",
      +          "LIKE",
      +          "NOT_EQUAL",
      +          "NOT_IN",
      +          "NOT_LIKE"
      +        ],
      +        "type": "string"
      +      },
      +      "predicate": {
      +        "type": "object"
      +      }
      +    },
      +    "required": [
      +      "attribute",
      +      "operator",
      +      "predicate"
      +    ],
      +    "type": "object"
      +  },
      +  "type": "array"
      +}
    • addedInput schema / properties / metrics / items / properties / startTime
      Added value: +{
      +  "format": "date-time",
      +  "type": "string"
      +}
    • addedInput schema / properties / nestedAggregations
      Added value: +{
      +  "description": "Nested aggregations for advanced sub-queries",
      +  "items": {
      +    "description": "Nested aggregations for advanced sub-queries",
      +    "properties": {
      +      "aggregations": {
      +        "items": {
      +          "properties": {
      +            "aggregation": {
      +              "description": "Type of aggregation function applied to the attribute",
      +              "enum": [
      +                "SUM",
      +                "AVG",
      +                "COUNT",
      +                "RATIO",
      +                "MIN",
      +                "MAX",
      +                "P50",
      +                "P95",
      +                "RANKING",
      +                "COLLECT",
      +                "COLLECT_UNIQUE",
      +                "COUNT_UNIQUE"
      +              ],
      +              "type": "string"
      +            },
      +            "density": {
      +              "enum": [
      +                "REQUIRED",
      +                "OPTIONAL"
      +              ],
      +              "type": "string"
      +            },
      +            "endTime": {
      +              "format": "date-time",
      +              "type": "string"
      +            },
      +            "filters": {
      +              "items": {
      +                "description": "Filters to apply to the query",
      +                "properties": {
      +                  "attribute": {
      +                    "type": "string"
      +                  },
      +                  "operator": {
      +                    "enum": [
      +                      "ANY",
      +                      "BETWEEN",
      +                      "CONTAINS",
      +                      "EQUAL",
      +                      "GREATER_THAN",
      +                      "GREATER_THAN_OR_EQUAL",
      +                      "IN",
      +                      "IS_NOT_NULL",
      +                      "IS_NULL",
      +                      "LESS_THAN",
      +                      "LESS_THAN_OR_EQUAL",
      +                      "LIKE",
      +                      "NOT_EQUAL",
      +                      "NOT_IN",
      +                      "NOT_LIKE"
      +                    ],
      +                    "type": "string"
      +                  },
      +                  "predicate": {
      +                    "type": "object"
      +                  }
      +                },
      +                "required": [
      +                  "attribute",
      +                  "operator",
      +                  "predicate"
      +                ],
      +                "type": "object"
      +              },
      +              "type": "array"
      +            },
      +            "metric": {
      +              "type": "string"
      +            },
      +            "startTime": {
      +              "format": "date-time",
      +              "type": "string"
      +            }
      +          },
      +          "required": [
      +            "aggregation",
      +            "metric"
      +          ],
      +          "type": "object"
      +        },
      +        "type": "array"
      +      },
      +      "filters": {
      +        "items": {
      +          "description": "Filters to apply to the query",
      +          "properties": {
      +            "attribute": {
      +              "type": "string"
      +            },
      +            "operator": {
      +              "enum": [
      +                "ANY",
      +                "BETWEEN",
      +                "CONTAINS",
      +                "EQUAL",
      +                "GREATER_THAN",
      +                "GREATER_THAN_OR_EQUAL",
      +                "IN",
      +                "IS_NOT_NULL",
      +                "IS_NULL",
      +                "LESS_THAN",
      +                "LESS_THAN_OR_EQUAL",
      +                "LIKE",
      +                "NOT_EQUAL",
      +                "NOT_IN",
      +                "NOT_LIKE"
      +              ],
      +              "type": "string"
      +            },
      +            "predicate": {
      +              "type": "object"
      +            }
      +          },
      +          "required": [
      +            "attribute",
      +            "operator",
      +            "predicate"
      +          ],
      +          "type": "object"
      +        },
      +        "type": "array"
      +      },
      +      "groupBy": {
      +        "items": {
      +          "type": "string"
      +        },
      +        "type": "array"
      +      },
      +      "timeAttribute": {
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "aggregations",
      +      "groupBy"
      +    ],
      +    "type": "object"
      +  },
      +  "type": "array"
      +}
    • removedInput schema / properties / nestedGroupBy
      Removed value: -{
      -  "description": "Fields to group nested results by",
      -  "items": {
      -    "description": "Fields to group nested results by",
      -    "type": "string"
      -  },
      -  "type": "array"
      -}
    • removedInput schema / properties / nestedMetrics
      Removed value: -{
      -  "description": "Optional nested metrics for advanced queries",
      -  "items": {
      -    "description": "Optional nested metrics for advanced queries",
      -    "properties": {
      -      "aggregation": {
      -        "enum": [
      -          "SUM",
      -          "AVG",
      -          "COUNT",
      -          "RATIO",
      -          "MIN",
      -          "MAX",
      -          "P50",
      -          "P95",
      -          "RANKING"
      -        ],
      -        "type": "string"
      -      },
      -      "metric": {
      -        "type": "string"
      -      }
      -    },
      -    "required": [
      -      "aggregation",
      -      "metric"
      -    ],
      -    "type": "object"
      -  },
      -  "type": "array"
      -}
    • removedInput schema / properties / nestedTimeAttribute
      Removed value: -{
      -  "description": "Time attribute for nested queries",
      -  "type": "string"
      -}
    • changedInput schema / properties / orderBy / items / description
      Previous value: -"Sort order for results"New value: +"Ordering specification for results"
    • addedInput schema / properties / session_id
      Added value: +{
      +  "description": "Session continuity handle, one of two values: the ses_ ID issued for the task underway, or start. This server cannot link your calls between requests on its own, so session continuity travels in this parameter instead. If you were handed a session_id for this task — for example by the agent that spawned you — send that exact value from your first call. Otherwise send start on your first call; the server will issue an opaque correlation ID in the mcp_session field of the result, or in a text block at the start of the result beginning [session_id issued. Then send that exact ses_ value on every later call and hand it to any subagents working the same task. start always begins a new, unrelated task — never send it mid-task. If you send a value this server does not recognize, the result reports it: mcp_session.status of unrecognized, or a text block beginning [session_id unrecognized; re-send the ID issued for this task, or start if none was issued yet. Never invent a ses_ value.",
      +  "pattern": "^(start|ses_[0-9A-Za-z]{27})$",
      +  "type": "string"
      +}
    • changedInput schema / properties / timeAttribute / description
      Previous value: -"Time attribute to use for queries"New value: +"Deprecated: use timeAttributes instead. Single time attribute override as a fully-qualified path (e.g. 'pull_requests.date_closed')."
    • addedInput schema / properties / timeAttributes
      Added value: +{
      +  "description": "Time attributes to use for queries. Each entry is a fully-qualified attribute path (e.g. 'pull_requests.date_closed'). The source is inferred from the prefix. For single-source queries, provide one entry. For multi-source, provide one per source to override.",
      +  "items": {
      +    "description": "Time attributes to use for queries. Each entry is a fully-qualified attribute path (e.g. 'pull_requests.date_closed'). The source is inferred from the prefix. For single-source queries, provide one entry. For multi-source, provide one per source to override.",
      +    "type": "string"
      +  },
      +  "type": "array"
      +}
    • changedInput schema / required
      Previous value: -[
      -  "endTime",
      -  "filters",
      -  "groupBy",
      -  "limit",
      -  "metrics",
      -  "orderBy",
      -  "startTime",
      -  "context"
      -]New value: +[
      +  "endTime",
      +  "filters",
      +  "groupBy",
      +  "limit",
      +  "metrics",
      +  "orderBy",
      +  "startTime",
      +  "session_id",
      +  "context"
      +]
  4. First observed

TDQS

Score is being calculated.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources