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.5 | $0.00021 | $0.01251 |
| Sonnet 5.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 2mo 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.
- 2mo 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 (30 stars, last pushed 5mo ago), licensed Apache-2.0. It adds 52 tokens to every session and 3,128 once invoked, about $0.0002 per session on Opus 5.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.
pg-slow-query-diagnosis compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| pg-slow-query-diagnosisisdaniel/pgtuner_mcp | Skill | 30 | 5mo ago | Apache-2.0 | A | 52 | Claude Code, Codex |
| exasol-mcp-serverexasol/mcp-server | Skill | 18 | 2d ago | MIT | A | 36 | Claude Code, Codex |
| tencent-pg-slowquery-diagnosisTencentCloudCommunity/mcp-server | Skill | 32 | 3mo ago | Apache-2.0 | A | 75 | Claude Code, Codex |
| amazon aurora dsqlawslabs/mcp | Skill | 9.9k | yesterday | Apache-2.0 | A | 46 | Claude Code |
| sql-optimizerMathews-Tom/armory | Skill | 340 | 5d ago | MIT | A | 78 | Claude Code |
| profiling-slow-api-endpointsPostHog/posthog | Skill | 41k | today | none | A | 113 | Claude Code, Codex |
| ecto-constraint-debugoliver-kriska/claude-elixir-phoenix | Skill | 574 | yesterday | MIT | A | 36 | Claude Code |