Skip to main content
Glama
WhaTap MCP Server

WhaTap MCP Server

Official
by whatap

whatap_query_data

Run MXQL, PromQL, or saved queries to fetch server, APM, Kubernetes, and database monitoring data for a WhaTap project.

Instructions

Execute a data query. Call this directly when you know the projectCode — no prerequisite tools needed.

THREE MODES:

  • MXQL: whatap_query_data(projectCode=X, path="v2/sys/server_base")

  • PromQL: whatap_query_data(projectCode=X, query="rate(node_cpu[5m])")

  • Saved: whatap_query_data(projectCode=X, savedQuery="CPU by Pod")

COMMON PATHS (use directly — no need to call data_availability or describe_query first):

  • Server: cpu/mem/disk/net → v2/sys/server_base, v2/sys/server_disk, v2/sys/server_network

  • APM: tps/response/error → v2/app/tps_pcode, v2/app/resp_time_pcode, v2/app/tx_error_pcode

  • APM per agent: → v2/app/tps_oid, v2/app/resp_time_oid, v2/app/act_tx/act_tx_oid

  • K8s: pods/nodes/events → v2/container/kube_pod, v2/container/kube_node, v2/container/kube_event

  • Container: → v2/container/container_stat

  • DB active sessions: → v2/db/instance_active_session

  • DB SQL stats: → db_oracle_dma_sqlstat_top_elapse, db_postgresql_sqlstat_top_elapse, db_mysql_sqlstat_top_elapse

If the path returns no data, THEN call data_availability(projectCode=X) to find the right path.

Pass params for MXQL queries that accept $-prefixed variables. Use the variable name as the key: params={"$oid": "12345", "$field": "gc_time"} (a bare "oid" is accepted too). Call whatap_describe_query(path) first — a query whose SELECT contains $field returns no metric column until you supply it.

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": {
      "projectCode": "<projectCode>"
    },
    "name": "whatap_query_data"
  }
}

Input Schema

NameRequiredDescriptionDefault
pathNoMXQL query path from the yard (e.g., "v2/sys/server_base", "v2/app/tps_pcode"). Discover paths with whatap_data_availability.
limitNoMaximum rows to return (default: 100).
queryNoPromQL expression to execute (e.g., "rate(node_cpu_seconds_total[5m])"). For reusable queries, use whatap_create_promql first.
paramsNoQuery parameters for MXQL $-prefixed variables. Example: {"oid": "12345", "okind": "myApp"}
timeRangeNoTime range (default: "5m"). Examples: "5m", "1h", "6h", "1d", "last 30 minutes".5m
savedQueryNoName of a saved PromQL query (created with whatap_create_promql). Example: "CPU by Pod"
projectCodeYesProject code (pcode). Get this by calling whatap_list_projects first — it returns all accessible projects with their pcodes.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.5.3

TDQS

A4.5/5.0
Behavior4/5

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

No annotations are supplied, so the description carries the burden, and it does disclose real behavior: the three execution modes, the silent-empty-result failure mode for $field queries, and the fallback escalation to data_availability. It stops short of describing the return shape (rows vs. columns vs. metric series) or any cost/rate characteristics, which matters for a tool with no output schema.

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 direct-call rule and a THREE MODES block, then structured bullets — easy to scan. The COMMON PATHS list is long, but it is explicitly justified as avoiding an extra discovery round-trip, so it earns its space; only the trailing params paragraph is slightly dense.

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

Completeness4/5

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

For a seven-parameter tool with a nested object and no output schema, the definition covers mode selection, prerequisite ordering, parameter conventions, and the main failure mode. The remaining gap is return-value shape and how multiple params interact (e.g., what happens if both query and savedQuery are supplied).

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 schema already documents all seven parameters; the description nonetheless adds genuine meaning beyond it by explaining the $-prefix convention for params, that a bare 'oid' key is also accepted, and that an unsupplied $field yields no metric column. It also maps parameter choice to mode (path vs. query vs. savedQuery), which the flat schema does not make explicit.

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?

States a concrete verb+resource ('Execute a data query') and immediately decomposes it into three named modes (MXQL, PromQL, Saved) with concrete invocation examples. It distinguishes itself from whatap_data_availability and whatap_describe_query by declaring when those are *not* needed, so an agent can select it without opening any sibling 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?

Explicitly says 'Call this directly when you know the projectCode — no prerequisite tools needed,' then gives the exception path: only call data_availability if the path returns no data, and call describe_query first when the SELECT contains $field. That is a complete when/when-not/alternative routing rule with the triggering conditions spelled out.

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