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 agentmods add skills/isdaniel/pgtuner_mcp/pg-index-optimizationnpx skills add isdaniel/pgtuner_mcp --skill pg-index-optimizationgit 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-index-optimization)<a href="https://agentmods.dev/skills/isdaniel/pgtuner_mcp/pg-index-optimization"><img src="https://agentmods.dev/badge/skills/isdaniel/pgtuner_mcp/pg-index-optimization.svg" alt="Measured on agentmods" 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.00044 | $0.03048 |
| Opus 5 | $0.00022 | $0.01524 |
| Sonnet 5 | $0.00009 | $0.00610 |
| Haiku 4.5 | $0.00004 | $0.00305 |
Grade A, and why
pg-index-optimization 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 6d 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 — 377 lines — stays where its author put it; the contents beside it link to each section on GitHub.
PostgreSQL Index Optimization
This skill guides comprehensive index analysis and optimization for PostgreSQL databases using pgtuner-mcp tools, including HypoPG hypothetical index testing.
When to Use This Skill
Use this skill when the user:
- Asks to optimize or review database indexes
- Wants to find and remove unused or duplicate indexes
- Reports slow queries that might benefit from better indexing
- Asks "what indexes should I create?" or "which indexes can I drop?"
- Mentions high storage usage from indexes or slow write performance
- Wants to test index ideas without creating them in production
MCP Resources Available
pgtuner://docs/tools-- Full tool reference documentationpgtuner://table/{schema}/{table_name}/indexes-- Quick view of existing indexes on a table (lightweight)pgtuner://table/{schema}/{table_name}/stats-- Table statistics for contextpgtuner://query/{query_hash}/stats-- Per-query stats to understand which queries benefit from indexes
Related MCP Prompt
This skill corresponds to the index_optimization MCP Prompt. If the user triggers that prompt, follow this skill's workflow.
Prerequisites
- The pgtuner-mcp server must be connected with a valid
DATABASE_URI - Required:
pg_stat_statementsextension for workload analysis - Recommended:
hypopgextension for hypothetical index testing - Recommended:
pgstattupleextension for index bloat analysis
Pre-Flight Checks
Before starting, check extension availability:
- Use
manage_hypothetical_indexeswithaction: "check"to verify HypoPG. If unavailable, skip Phase 3 (hypothetical testing) and rely on heuristic-based recommendations. - If
analyze_index_bloatreturns an error aboutpgstattuple, note that bloat measurements will be estimated rather than exact.
Agent Decision Tree
User asks about indexes
|
+--> "Which indexes can I drop?"
| --> Start with Phase 1 (cleanup), focus on Step 1.1
|
+--> "What indexes should I create?"
| --> Start with Phase 2 (missing indexes)
|
+--> "Comprehensive index review"
| --> Follow all 4 phases in order
|
+--> "Test a specific index idea"
| --> Skip to Phase 3 (hypothetical testing)
|
+--> After finding unused indexes, also check:
--> Read pgtuner://table/{schema}/{table}/indexes for quick context
--> Cross-reference: are the "unused" indexes UNIQUE? (warn user)
--> Cross-reference: how long has the DB been up?
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.
- 6d ago First seen · 377 lines · 44 tokens per session scan A d58d563b9d27
pg-index-optimization is a skill published in the GitHub repository isdaniel/pgtuner_mcp (28 stars, last pushed 3mo ago), licensed Apache-2.0. It adds 44 tokens to every session and 3,048 once invoked, about $0.0002 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…
safe-sql-execution
Use whenever code will build, return, fetch, or execute SQL that runs against a user's real Postgres database — even when the request reads like an ordinary feature or bug fix and never says "security," "injection," or "SafeSqlFragment." This covers: writing or editing any pg-meta function, query builder, or endpoint…
write-the-docs
Draft new or updated Supabase docs content for a feature or launch, grounded in product intent (Linear when available), a read of the actual code, and the docs style guide once one exists. Use when asked to write docs for a new feature, a product launch, or a Linear ticket that needs net-new content rather than a bug…
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.
fix-bug
Use when given a GitHub issue URL or number to investigate and implement a fix. Triggers on "fix issue", "fix bug", "fix.