Skip to main content
Glama

gulliver_top

Read-only

Identify high-cost repeated queries across query histories, lint top groups, propose same-rows rewrites, and estimate monthly savings without executing or modifying anything.

Instructions

Workload review: the most expensive repeated queries (grouped by shape, literals ignored) from Gulliver's receipts, pg_stat_statements, BigQuery JOBS_BY_PROJECT, Snowflake QUERY_HISTORY or a CSV/JSONL file. For the top ones: lint, a same-rows rewrite and the saving per month (labeled exact or heuristic), plus repeated aggregates worth a summary table. The history query is budget-checked; nothing is run or changed. Use it to find where money goes across many queries; use gulliver_preflight or gulliver_fix for one query.

Input Schema

NameRequiredDescriptionDefault
daysNoHistory window in days.
pathNoCSV / JSONL / JSON file for source 'file' (absolute path; columns query, calls, bytes, runtime_s, cost_usd).
limitNoQuery groups to return.
sourceNoauto (the connection's own history), receipts, pg_stat_statements, bigquery_jobs, snowflake_history or file.auto
analyzeNoHow many of the top groups to lint, rewrite and price. 0 only lists them.
dialectNoDialect of the SQL in a file. Omit for the connection's.
rank_byNoauto: cost when known, else runtime.auto
connectionNoConnection name as listed by gulliver_status (from gulliver.toml or GULLIVER_DSN). Omit for the default connection.

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv0.3.1
    • changedInput schema / properties / analyze / description
      Previous value: -"Top groups to lint, rewrite and price."New value: +"How many of the top groups to lint, rewrite and price. 0 only lists them."
    • changedInput schema / properties / connection / description
      Previous value: -"Connection name from gulliver_status. Omit for the default."New value: +"Connection name as listed by gulliver_status (from gulliver.toml or GULLIVER_DSN). Omit for the default connection."
  2. Addedv0.1.1

TDQS

A4.3/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true and destructiveHint=false, so the safety profile is covered; the description still adds real context beyond them — the history query is budget-checked, nothing is run or changed, and savings are labeled 'exact or heuristic' rather than presented as certain. It does not mention runtime cost, pagination, or what happens when budget is exceeded, which keeps it below 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?

It is front-loaded with the core action and squeezed into a few dense sentences with no filler, and the usage-routing sentence comes last where it is needed. The first sentence is long and stacks five data sources in a row, which costs some readability.

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 an 8-parameter, multi-source read-only analysis tool with an output schema covering return values, the description supplies what the schema cannot: source scope, the budget check, safety, and the alternative tools. The main omission is any hint of result scale or behavior when no history is available for the chosen source.

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 description coverage is 100%, so the schema already carries the parameter definitions and 3 is the floor. The description adds meaning the schema does not: what 'analyze' actually produces (lint, a same-rows rewrite, saving per month) and that grouping is by query shape with literals ignored, which clarifies how 'limit' and 'rank_by' behave.

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?

The description names a specific verb and resource — a workload review of the most expensive repeated queries, grouped by shape with literals ignored — and enumerates the concrete sources (receipts, pg_stat_statements, BigQuery JOBS_BY_PROJECT, Snowflake QUERY_HISTORY, file). It also explicitly separates itself from gulliver_preflight/gulliver_fix for single-query work, so an agent can route correctly 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 Guidelines4/5

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

It gives an explicit when-to-use rule: 'use it to find where money goes across many queries; use gulliver_preflight or gulliver_fix for one query,' naming the alternatives directly. The gap is gulliver_review, the closest-sounding sibling, which is never mentioned or differentiated, leaving some ambiguity for fleet-level review tasks.

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