tencent-pg-slowquery-diagnosis

tencent-pg-slowquery-diagnosis is a skill for Claude Code, Codex from TencentCloudCommunity/mcp-server. It costs 75 tokens per session (988 once invoked), scanned A, original, Apache-2.0.

A diagnostic workflow for investigating slow SQL queries and unusual performance in Tencent Cloud PostgreSQL, a managed database service.

In plain words
What is it for?
Finding causes of slow queries, latency spikes, and performance degradation through Tencent Cloud’s PostgreSQL API.
Why use it?
It collects evidence before suggesting changes and requires the database region and instance to be identified before checking cloud data.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Finding causes of slow queries, latency spikes, and performance degradation through Tencent Cloud’s PostgreSQL API.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/tencentcloudcommunity/mcp-server/tencent-pg-slowquery-diagnosis
Install

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.

Any agent
npx skills add TencentCloudCommunity/mcp-server --skill tencent-pg-slowquery-diagnosis
Clone the repo
git clone --depth 1 https://github.com/TencentCloudCommunity/mcp-server

Made for: Claude Code, Codex.

Wrote 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.

agentmods badge for tencent-pg-slowquery-diagnosis

README.md
[![agentmods](https://agentmods.dev/badge/skills/tencentcloudcommunity/mcp-server/tencent-pg-slowquery-diagnosis/github.svg)](https://agentmods.dev/skills/tencentcloudcommunity/mcp-server/tencent-pg-slowquery-diagnosis)
Your own site
<a href="https://agentmods.dev/skills/tencentcloudcommunity/mcp-server/tencent-pg-slowquery-diagnosis"><img src="https://agentmods.dev/badge/skills/tencentcloudcommunity/mcp-server/tencent-pg-slowquery-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.

agentmods 80×15 button for tencent-pg-slowquery-diagnosis

Your own site · 80×15
<a href="https://agentmods.dev/skills/tencentcloudcommunity/mcp-server/tencent-pg-slowquery-diagnosis"><img src="https://agentmods.dev/badge/skills/tencentcloudcommunity/mcp-server/tencent-pg-slowquery-diagnosis.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 75 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 988 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce invoked
Fable 5.1 $0.00075 $0.00988
Opus 5 $0.00037 $0.00494
Sonnet 5 $0.00015 $0.00198
Haiku 4.5 $0.00007 $0.00099

Measured 10d ago against content hash c361838a1a58, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-10, from the pricing page.

Security

Grade A, and why

tencent-pg-slowquery-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 10d 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.

src/postgres/skills/tencent-pg-slowquery-diagnosis/SKILL.md · 43 lines

How it starts

The opening of the file, as written. The whole thing — 43 lines — stays where its author put it; the contents beside it link to each section on GitHub.

tencent-pg-slowquery-diagnosis

When to use

  • Need to analyze slow SQL, latency spikes, or performance degradation.
  • Need a first-pass diagnosis before proposing or executing tuning and change actions.
  • Need a reusable workflow that calls Tencent Cloud OpenAPI directly instead of relying on a deployed MCP server.

Steps

  1. Confirm the scope first: region, target instance, optional database or SQL fingerprint, and preferred time window. If the region, instance ID, or both are missing from the user's request, immediately reply with a direct message (no interactive prompt or choice menu) that includes: (a) the console link https://console.cloud.tencent.com/postgres where the user can find their instance ID and region, and (b) a concrete example reply format like "ap-guangzhou postgres-abc12345". Do not proceed with any API call until the target scope is confirmed.
  2. Normalize region input before any OpenAPI call by following @references/common/region_normalization.md. Accept standard region codes such as ap-guangzhou and common aliases such as 广州, 上海, 成都, 北京, then convert them to the canonical region code like ap-guangzhou, ap-shanghai, ap-chengdu, ap-beijing. If the input cannot be normalized safely, stop and use the invalid-region template in @references/common/error_handling.md, including the official region links.
  3. Check runtime prerequisites using a foolproof order. Prefer TENCENTCLOUD_SECRET_ID, TENCENTCLOUD_SECRET_KEY, TENCENTCLOUD_REGION, and optional TENCENTCLOUD_SESSION_TOKEN; also accept compatible names such as MCP_REQUEST_SECRET_ID, MCP_REQUEST_SECRET_KEY, MCP_REQUEST_SESSION_TOKEN, MCP_SECRET_ID, and MCP_SECRET_KEY. If required values are missing, stop and use the missing-credentials template in @references/common/error_handling.md, including one copyable example plus the official API key and region links.
  4. Call Tencent Cloud PostgreSQL OpenAPI directly. Any aligned Action listed in @references/api_reference.md may be used. Start with read-only evidence collection first. For audit, business, fee-impacting, or critical write actions, explain impact clearly and require explicit confirmation before execution.
  5. Prefer the official Tencent Cloud SDK. If the SDK is unavailable, do not block on that alone; generate properly TC3-signed HTTPS requests locally instead. Read credentials only from environment variables or other secure runtime context; never hardcode or persist them in code, skill files, or query parameters. If the user still wants the SDK path, follow the missing-sdk template in @references/common/error_handling.md, offer the install command, and ask whether to execute it.
  6. Gather evidence in this order:
    • current instance state, lifecycle, and ongoing task context
    • slow-query and query-analysis evidence
    • error-log evidence when errors may explain the slowdown
    • parameter, backup, readonly-topology, and other aligned context only when they help explain the symptom
  7. Use @references/api_reference.md as the diagnosis frame and aligned action catalog.
  8. Rank likely causes rather than forcing a single root cause. If the user asks for remediation and the evidence supports it, only then move to the smallest aligned action that addresses the issue, with explicit confirmation when required.
  9. Keep optimization guidance conservative. Recommend or execute changes only when the evidence points in that direction and the action is within the aligned 48-action boundary.

Read the full file on GitHub · 43 lines

Files

What ships with it

2 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

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.

  1. 10d ago First seen · 43 lines · 75 tokens per session scan A c361838a1a58

Subscribe to this mod's changes

tencent-pg-slowquery-diagnosis is a skill published in the GitHub repository TencentCloudCommunity/mcp-server (29 stars, last pushed 1mo ago), licensed Apache-2.0. It adds 75 tokens to every session and 988 once invoked, about $0.0004 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.

Related

Other skills, from other repositories

pg-bloat-analysis

Detects and remediates table and index bloat in PostgreSQL using pgstattuple analysis. Identifies fragmentation, dead tuples, and wasted space with prioritized maintenance actions including VACUUM, REINDEX, and pgrepack recommendations.

isdaniel/pgtuner_mcp · 53 tokens

pg-index-optimization

Performs comprehensive PostgreSQL index optimization including unused index cleanup, duplicate detection, missing index recommendations, and hypothetical index testing with HypoPG. Provides actionable CREATE/DROP INDEX statements with estimated impact.

isdaniel/pgtuner_mcp · 44 tokens

pg-slow-query-diagnosis

Diagnoses slow PostgreSQL queries by analyzing pgstatstatements, execution plans, index opportunities, and table statistics. Guides the agent through a systematic investigation workflow using pgtuner-mcp tools to produce actionable optimization recommendations.

isdaniel/pgtuner_mcp · 52 tokens

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.

awslabs/mcp · 46 tokens

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".

Mathews-Tom/armory · 78 tokens

ecto-constraint-debug

Debug Ecto constraint violations - trace triggers, check migrations, find duplicate data. Use when seeing uniqueconstraint, foreignkeyconstraint, or checkconstraint errors.

oliver-kriska/claude-elixir-phoenix · 36 tokens