Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx skills add isdaniel/pgtuner_mcp --skill pg-slow-query-diagnosisgit clone --depth 1 https://github.com/isdaniel/pgtuner_mcpWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/isdaniel/pgtuner_mcp/pg-slow-query-diagnosis)<a href="https://agentmods.dev/skills/isdaniel/pgtuner_mcp/pg-slow-query-diagnosis"><img src="https://agentmods.dev/badge/skills/isdaniel/pgtuner_mcp/pg-slow-query-diagnosis/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/isdaniel/pgtuner_mcp/pg-slow-query-diagnosis"><img src="https://agentmods.dev/badge/skills/isdaniel/pgtuner_mcp/pg-slow-query-diagnosis.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00052 | $0.03128 |
| Opus 5 | $0.00026 | $0.01564 |
| Sonnet 5 | $0.00010 | $0.00626 |
| Haiku 4.5 | $0.00005 | $0.00313 |
Grade A, and why
pg-slow-query-diagnosis scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 11d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 295 lines — stays where its author put it; the contents beside it link to each section on GitHub.
PostgreSQL Slow Query Diagnosis
This skill guides systematic diagnosis and optimization of slow queries in PostgreSQL databases using the pgtuner-mcp server tools.
When to Use This Skill
Use this skill when the user:
- Reports slow queries or poor query performance
- Asks "why is my query slow?" or "how can I speed up this query?"
- Wants to find and fix the top resource-consuming queries
- Mentions high query latency, timeouts, or slow API responses
- Asks to investigate
pg_stat_statementsdata
MCP Resources Available
Before calling tools, the agent can read lightweight resources for quick context:
pgtuner://docs/tools-- Full tool reference documentationpgtuner://docs/workflows-- Recommended workflow patternspgtuner://query/{query_hash}/stats-- Detailed stats for a specific query byqueryid(fromget_slow_queriesoutput)pgtuner://table/{schema}/{table_name}/stats-- Quick table statistics without running the full toolpgtuner://table/{schema}/{table_name}/indexes-- Indexes on a specific table
Related MCP Prompt
This skill corresponds to the diagnose_slow_queries MCP Prompt and partially to query_tuning. If the user triggers either prompt, follow this skill's workflow.
Prerequisites
- The pgtuner-mcp server must be connected with a valid
DATABASE_URI - Required:
pg_stat_statementsextension (check availability early -- if missing, tool will return an error) - Optional:
hypopgextension for hypothetical index testing - Optional:
pglastlibrary on the server for SQL parsing in index recommendations
Pre-Flight Checks
Before starting the workflow, verify extension availability:
- If
get_slow_queriesreturns an error aboutpg_stat_statements, inform the user it must be enabled and provide setup instructions. - If the user wants hypothetical index testing, use
manage_hypothetical_indexeswithaction: "check"to verify HypoPG is available. If not, skip Step 4 and rely on heuristic recommendations.
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 11d ago First seen · 295 lines · 52 tokens per session scan A 8ac3fbe307f1
pg-slow-query-diagnosis is a skill published in the GitHub repository isdaniel/pgtuner_mcp (29 stars, last pushed 3mo ago), licensed Apache-2.0. It adds 52 tokens to every session and 3,128 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other skills, from other repositories
exasol-mcp-server
Exasol MCP Server usage guide: common workflows for database exploration, query debugging, BucketFS management, and working with UDFs and preprocessors.
tencent-pg-slowquery-diagnosis
Diagnose slow SQL and performance anomalies for Tencent Cloud PostgreSQL by calling Tencent Cloud OpenAPI directly. This skill can use the full aligned PostgreSQL OpenAPI action set documented in @references/apireference.md. Start with evidence collection first, and require explicit confirmation before any write…
amazon aurora dsql
Deprecated compatibility redirect for Aurora DSQL guidance. Use when a request concerns DSQL, Aurora DSQL, distributed SQL, DSQL schemas, migrations, queries, authentication, performance, or application development.
sql-optimizer
Analyzes SQL queries for missing indexes, N+1 patterns, suboptimal joins, and full table scans. Interprets EXPLAIN, detects anti-patterns, rewrites queries. Triggers on: "optimize this query", "slow query", "add indexes", "explain plan", "N+1 query", "why is this query slow".
ecto-constraint-debug
Debug Ecto constraint violations - trace triggers, check migrations, find duplicate data. Use when seeing uniqueconstraint, foreignkeyconstraint, or checkconstraint errors.
solr-query
To build and debug Solr queries: eDisMax, block join, JSON facets, kNN, explain.